Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 394281 - sys-apps/openrc Use sys-apps/iproute2 to create tap/tun interfaces
Summary: sys-apps/openrc Use sys-apps/iproute2 to create tap/tun interfaces
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet
Keywords:
Depends on:
Blocks: openrc-tracker
  Show dependency tree
 
Reported: 2011-12-11 00:50 UTC by Christopher Byrne
Modified: 2013-04-25 23:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch net/tuntap.sh to use iproute2 (openrc-tuntap.patch,2.01 KB, patch)
2011-12-11 00:50 UTC, Christopher Byrne
Details | Diff
Patch net/tuntap.sh to use iproute2 - round 2 (openrc-tuntap.patch,1.87 KB, patch)
2011-12-11 10:06 UTC, Christopher Byrne
Details | Diff
openrc-tuntap.patch (openrc-tuntap.patch,2.96 KB, text/plain)
2011-12-12 17:34 UTC, William Hubbs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Byrne 2011-12-11 00:50:56 UTC
Created attachment 295427 [details, diff]
Patch net/tuntap.sh to use iproute2

Currently the tuntap moduel requires either sys-apps/usermode-utils or net-misc/openvpn, however sys-apps/iproute2 can create these devices too (however this fact isn't documented very well)

Syntax is "ip tuntap ${devname} name mode <tun|tap>"

I created a patch to use (and prefer) iproute2 if available, and prefer it, unless "ifconfig" is set in ${MODULES}. LAtter not testest:

Also note: tuntap support wasn't added until iproute2 2.6.34 (around May 2010), the oldest stable version in the tree (as of Dec 10 2011) is 2.6.29.1-r1, however the newest stable is 2.6.35-r2 which does support it. However users of older iproute2 tools can still get it to work by openvpn_opts or tunctl_opts
Comment 1 SpanKY gentoo-dev 2011-12-11 05:16:36 UTC
i wouldn't bother with MODULES checking

this block needs spacing:
+    if [ -n "${i_opts}"-a "${use_iproute2}"="true" ] ...
should be:
+    if [ -n "${i_opts}" -a "${use_iproute2}" = "true" ] ...

this block is wrong:
+    elif type ip >/dev/null 2>&1 && [ use_iproute=true ]; then
should be:
+    elif type ip >/dev/null 2>&1 && [ "${use_iproute}" = "true" ]; then
Comment 2 Christopher Byrne 2011-12-11 10:06:47 UTC
Created attachment 295449 [details, diff]
Patch net/tuntap.sh to use iproute2 - round 2

This fixes the spacing problems (actually makes them moot since I've removed the MODULES checking, which greatly simplfies things)
Comment 3 SpanKY gentoo-dev 2011-12-12 05:39:45 UTC
Comment on attachment 295449 [details, diff]
Patch net/tuntap.sh to use iproute2 - round 2

looks fine to me, but someone else should prob review/merge since i haven't really done any work on the network layer

this file in general looks like it could do with a rework in terms of the backend code ...
Comment 4 William Hubbs gentoo-dev 2011-12-12 07:15:29 UTC
I am testing this now.
Comment 5 William Hubbs gentoo-dev 2011-12-12 17:34:24 UTC
Created attachment 295575 [details]
openrc-tuntap.patch

Salah,

this is round 3 of the patch. I found some typos and added the
documentation to net.example.

Everything seems to work here, so let me know what you think of this
version.
Comment 6 Christopher Byrne 2011-12-12 18:20:03 UTC
Looks good to me
Comment 7 William Hubbs gentoo-dev 2011-12-13 04:16:03 UTC
Your patch is in commit a38a507.
Thanks for the report and the patch.