summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2010-12-12 00:43:05 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2010-12-12 00:58:47 +0000
commit400b45d590b883050e171a34daec3fe40b58b76e (patch)
treec347a6d90a05480d6b691016ce5cb51833a2df04
parente431599d0882d04e8e85e6f72649987e8f2bc4a1 (diff)
downloadopenrc-400b45d590b883050e171a34daec3fe40b58b76e.tar.gz
openrc-400b45d590b883050e171a34daec3fe40b58b76e.tar.bz2
openrc-400b45d590b883050e171a34daec3fe40b58b76e.tar.xz
Final documentation cleanup for updated bridge code.
Specifically document how to handle the case of explicitly starting a bridge and then dynamically adding interfaces to it. brctl_br0='' bridge_add_eth0='br0'
-rw-r--r--doc/net.example.Linux.in14
-rw-r--r--net/bridge.sh9
2 files changed, 14 insertions, 9 deletions
diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index 7955fe3..42e5477 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -787,11 +787,18 @@
#bridge_add_eth0="br0"
#bridge_add_eth1="br0"
+# NOTE: If you want to manually start an empty bridge, and then dynamically add
+# ports to it you must set at least one of the following variables based on the
+# interface name, so that we can pick it up from your configuration. Even an
+# empty value variable is fine, but at least one of them must be set:
+# brctl_IFVAR
+
# You need to configure the ports to null values so dhcp does not get started
#config_eth0="null"
#config_eth1="null"
-# Finally give the bridge an address - dhcp or a static IP
+# Finally give the bridge an address - dhcp or a static IP, this is assigned to
+# the bridge when the bridge is explicitly started.
#config_br0="dhcp" # may not work when adding ports dynamically
#config_br0="192.168.0.1/24"
@@ -812,11 +819,6 @@
#forward_delay_br0="10"
#hairpin_mode_eth0="1"
-# If you want to start an empty bridge, and then dynmically add ports to it you
-# MUST set the following variables (with the correct interface name).
-# If you get the error "Misconfigured static bridge detected", this means you.
-#bridge_br0=''
-
#-----------------------------------------------------------------------------
# RFC 2684 Bridge Support
# For RFC 2684 bridge support emerge net-misc/br2684ctl
diff --git a/net/bridge.sh b/net/bridge.sh
index 2f6711e..c0172ed 100644
--- a/net/bridge.sh
+++ b/net/bridge.sh
@@ -32,16 +32,19 @@ _bridge_ports()
bridge_pre_start()
{
local brif= oiface="${IFACE}" e= x=
+ # ports is for static add
local ports="$(_get_array "bridge_${IFVAR}")"
+ # old config options
local opts="$(_get_array "brctl_${IFVAR}")"
-
# brif is used for dynamic add
eval brif=\$bridge_add_${IFVAR}
- # ports is for static add
+
+ # we need a way to if the bridge exists in a variable name, not just the
+ # contents of a variable. Eg if somebody has only bridge_add_eth0='br0',
+ # with no other lines mentioning br0.
eval bridge_unset=\${bridge_${IFVAR}-y\}
eval brctl_unset=\${brctl_${IFVAR}-y\}
- # If we are not doing dynamic add on $IFACE, check for static ports.
if [ -z "${brif}" -a "${brctl_unset}" == 'y' ]; then
if [ -z "${ports}" -a "${bridge_unset}" == "y" ]; then
#eerror "Misconfigured static bridge detected (see net.example)"