Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 287373 Details for
Bug 384029
sys-apps/openrc-0.8.3: add support for macvlan
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
macvlan.sh: module to support macvlan configuration
openrc-macvlan.diff (text/plain), 3.03 KB, created by
Stef Simoens
on 2011-09-21 22:32:13 UTC
(
hide
)
Description:
macvlan.sh: module to support macvlan configuration
Filename:
MIME Type:
Creator:
Stef Simoens
Created:
2011-09-21 22:32:13 UTC
Size:
3.03 KB
patch
obsolete
>diff -uwrN openrc-0.8.3/doc/net.example.Linux.in openrc-0.8.3-stef/doc/net.example.Linux.in >--- openrc-0.8.3/doc/net.example.Linux.in 2011-06-20 04:37:55.000000000 +0200 >+++ openrc-0.8.3-stef/doc/net.example.Linux.in 2011-09-22 00:21:31.291069786 +0200 >@@ -581,6 +581,18 @@ > # NOTE: depend functions only work in /etc/conf.d/net > # and not in profile configs such as /etc/conf.d/net.foo > >+# MAC-VLAN support >+# The following configuration can be used to create a new interface 'macvlan0' >+# linked to 'eth0' >+#macvlan_macvlan0="eth0" >+ >+# MAC-VLAN mode (private, vepa, bridge, passtru) >+#mode_macvlan0="private" >+ >+# IP address, MAC address, ... are configured as a normal interface >+#config_macvlan0="192.168.20.20/24" >+#mac_macvlan0="00:50:06:20:20:20" >+ > #----------------------------------------------------------------------------- > # Bonding > # For link bonding/trunking on 2.4 kernels, or kernels without sysfs >diff -uwrN openrc-0.8.3/net/macvlan.sh openrc-0.8.3-stef/net/macvlan.sh >--- openrc-0.8.3/net/macvlan.sh 1970-01-01 01:00:00.000000000 +0100 >+++ openrc-0.8.3-stef/net/macvlan.sh 2011-09-22 00:15:32.818938763 +0200 >@@ -0,0 +1,69 @@ >+# 2011-09-22 Stef Simoens <stef@bgs.org> >+# based on vlan.sh & tuntap.sh >+# Copyright (c) 2007-2008 Roy Marples <roy@marples.name> >+# All rights reserved. Released under the 2-clause BSD license. >+ >+_ip() >+{ >+ if [ -x /bin/ip ]; then >+ echo /bin/ip >+ else >+ echo /sbin/ip >+ fi >+} >+ >+macvlan_depend() >+{ >+ program $(_ip) >+ after interface >+ before dhcp macchanger >+} >+ >+_is_macvlan() >+{ >+ [ -n "$(export RC_SVCNAME="net.${IFACE}"; service_get_value macvlan)" ] >+} >+ >+_check_macvlan() >+{ >+ if [ ! -d /sys/module/macvlan ]; then >+ modprobe macvlan >+ if [ ! -d /sys/module/macvlan ]; then >+ eerror "MAC-VLAN support is not present in this kernel" >+ return 1 >+ fi >+ fi >+} >+ >+macvlan_pre_start() >+{ >+ # MAC-VLAN needs an existing interface to link to >+ local macvlan= >+ eval macvlan=\$macvlan_${IFVAR} >+ [ -z "${macvlan}" ] && return 0 >+ >+ _check_macvlan || return 1 >+ >+ # optional mode, default to "private" >+ local mode= >+ eval mode=\$mode_${IFVAR} >+ [ -z "${mode}" ] && mode="private" >+ >+ ebegin "Creating MAC-VLAN ${IFACE} to ${macvlan}" >+ e="$(ip link add link "${macvlan}" name "${IFACE}" type macvlan mode "${mode}" 2>&1 1>/dev/null)" >+ if [ -n "${e}" ]; then >+ eend 1 "${e}" >+ else >+ eend 0 && service_set_value macvlan "${macvlan}" >+ fi >+} >+ >+ >+macvlan_post_stop() >+{ >+ _is_macvlan || return 0 >+ >+ ebegin "Removing MAC-VLAN ${IFACE}" >+ ip link delete "${IFACE}" type macvlan >/dev/null >+ eend $? >+} >diff -uwrN openrc-0.8.3/net/Makefile.Linux openrc-0.8.3-stef/net/Makefile.Linux >--- openrc-0.8.3/net/Makefile.Linux 2011-06-20 04:37:55.000000000 +0200 >+++ openrc-0.8.3-stef/net/Makefile.Linux 2011-09-22 00:16:21.107876302 +0200 >@@ -2,7 +2,7 @@ > INC+= adsl.sh apipa.sh arping.sh bonding.sh br2684ctl.sh bridge.sh \ > ccwgroup.sh clip.sh ethtool.sh iproute2.sh ifplugd.sh ip6to4.sh \ > ipppd.sh iwconfig.sh netplugd.sh pppd.sh pump.sh tuntap.sh udhcpc.sh \ >- vlan.sh >+ vlan.sh macvlan.sh > > .SUFFIXES: .sh.Linux.in > .sh.Linux.in.sh:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 384029
: 287373