]> git.ipfire.org Git - people/arne_f/network.git/commitdiff
bridge: Automatically enable promisc mode.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Sep 1981 02:13:37 +0000 (02:13 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Sep 1981 02:13:37 +0000 (02:13 +0000)
There is (maybe) a bug in the linux kernel that
we need to set every bridge into promisc mode to
get traffic out through the bridges.

functions.device
hooks/zones/bridge

index 3bf8df5421220bc6bc06ebca6a74d68b434e0416..8dea6bd692c224ef3659f4d1c3e8a847b49ad3f4 100644 (file)
@@ -276,6 +276,17 @@ function device_is_promisc() {
        ip link show ${device} | grep -qE "<.*PROMISC.*>"
 }
 
+function device_set_promisc() {
+       local device=${1}
+       local state=${2}
+
+       assert device_exists ${device}
+       assert isset state
+       assert isoneof state on off
+
+       ip link set ${device} promisc ${state}
+}
+
 # Check if the device is free
 function device_is_free() {
        ! device_is_used $@
index 022ca65486bf63e17ad3f60352a3d8022b687755..7fe89d63b7e2b3b2db2d3f0d2192891188556b6e 100755 (executable)
@@ -114,6 +114,10 @@ function _up() {
 
        device_set_up ${zone}
 
+       # XXX Currently, there is a bug (in the linux kernel?) that we need to
+       # set our bridges to promisc mode.
+       device_set_promisc ${zone} on
+
        # Bring all ports up
        zone_ports_up ${zone}
        zone_configs_up ${zone}
@@ -137,6 +141,9 @@ function _down() {
        zone_configs_down ${zone}
        zone_ports_down ${zone}
 
+       # XXX See remark in _up().
+       device_set_promisc ${zone} off
+
        device_set_down ${zone}
        brctl delbr ${zone}