aboutsummaryrefslogtreecommitdiff
path: root/net.Linux/iproute2.sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-11-01 22:25:53 +0000
committerRoy Marples <roy@marples.name>2007-11-01 22:25:53 +0000
commit80124a050c626584f19fbac917276946224bcde7 (patch)
treec94990be30f3bf00785a8577fb7ef7cf1bd46f21 /net.Linux/iproute2.sh
parenta1f80bc7a74b5b3b899eadeb63ccfbdec6d860d0 (diff)
Work cleanly with bridges on kernels without TCP, #197791.
Diffstat (limited to 'net.Linux/iproute2.sh')
-rw-r--r--net.Linux/iproute2.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/net.Linux/iproute2.sh b/net.Linux/iproute2.sh
index e6652c0f..8357f259 100644
--- a/net.Linux/iproute2.sh
+++ b/net.Linux/iproute2.sh
@@ -43,6 +43,15 @@ _is_wireless() {
grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/wireless
}
+_set_flag() {
+ local flag=$1 opt="on"
+ if [ "${flag#-}" != "${flag}" ]; then
+ flag=${flag#-}
+ opt="off"
+ fi
+ ip link set "${IFACE}" "${flag}" "${opt}"
+}
+
_get_mac_address() {
local mac=$(LC_ALL=C ip link show "${IFACE}" | sed -n \
-e 'y/abcdef/ABCDEF/' \
@@ -181,7 +190,8 @@ iproute2_pre_start() {
}
iproute2_post_start() {
- ip route flush table cache dev "${IFACE}"
+ # Kernel may not have tcp built in
+ [ -e /proc/net/route ] && ip route flush table cache dev "${IFACE}"
}
iproute2_post_stop() {