diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2012-10-10 00:07:26 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2012-10-10 00:10:52 +0000 |
commit | 9a9c2acd8d0a44799c1c0199bf7e14640f6a86f3 (patch) | |
tree | b3cc17d31d41fa67204b42179b227f2003e1d556 | |
parent | b68d4b3580b6c3b38712e415ac5b874228103cd1 (diff) |
net/{bridge,iproute2}: Stricter iproute2 ip link syntax & promisc handling
The 'dev' argument is only optional for ethX devices, for others it is
mandatory, so we should always include it.
Also tweak when promisc mode is applied to bridges.
Patches submitted by Denis Kaganovich <mahatma@bspu.unibel.by>.
X-Gentoo-Bug: #431204
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=431204
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r-- | net/bridge.sh | 3 | ||||
-rw-r--r-- | net/iproute2.sh | 12 |
2 files changed, 7 insertions, 8 deletions
diff --git a/net/bridge.sh b/net/bridge.sh index 4f3618aa..60d3eebc 100644 --- a/net/bridge.sh +++ b/net/bridge.sh @@ -119,10 +119,8 @@ bridge_pre_start() return 1 fi # The interface is known to exist now - _set_flag promisc _up if ! brctl addif "${BR_IFACE}" "${x}"; then - _set_flag -promisc eend 1 return 1 fi @@ -144,6 +142,7 @@ bridge_pre_start() ) || return 1 # Bring up the bridge + _set_flag promisc _up } diff --git a/net/iproute2.sh b/net/iproute2.sh index eb311c87..3bab7b74 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -10,12 +10,12 @@ iproute2_depend() _up() { - ip link set "${IFACE}" up + ip link set dev "${IFACE}" up } _down() { - ip link set "${IFACE}" down + ip link set dev "${IFACE}" down } _exists() @@ -57,7 +57,7 @@ _set_flag() flag=${flag#-} opt="off" fi - ip link set "${IFACE}" "${flag}" "${opt}" + ip link set dev "${IFACE}" "${flag}" "${opt}" } _get_mac_address() @@ -79,7 +79,7 @@ _get_mac_address() _set_mac_address() { - ip link set "${IFACE}" address "$1" + ip link set dev "${IFACE}" address "$1" } _get_inet_addresses() @@ -274,12 +274,12 @@ iproute2_pre_start() # MTU support local mtu= eval mtu=\$mtu_${IFVAR} - [ -n "${mtu}" ] && ip link set "${IFACE}" mtu "${mtu}" + [ -n "${mtu}" ] && ip link set dev "${IFACE}" mtu "${mtu}" # TX Queue Length support local len= eval len=\$txqueuelen_${IFVAR} - [ -n "${len}" ] && ip link set "${IFACE}" txqueuelen "${len}" + [ -n "${len}" ] && ip link set dev "${IFACE}" txqueuelen "${len}" return 0 } |