Lines 7-13
bridge_depend()
Link Here
|
7 |
program brctl ip |
7 |
program brctl ip |
8 |
} |
8 |
} |
9 |
|
9 |
|
10 |
_config_vars="$_config_vars bridge bridge_add brctl" |
10 |
_config_vars="$_config_vars bridge bridge_add brctl mtu" |
11 |
|
11 |
|
12 |
_is_bridge() |
12 |
_is_bridge() |
13 |
{ |
13 |
{ |
Lines 31-47
_bridge_ports()
Link Here
|
31 |
|
31 |
|
32 |
bridge_pre_start() |
32 |
bridge_pre_start() |
33 |
{ |
33 |
{ |
34 |
local brif= oiface="${IFACE}" e= x= |
34 |
local brif= oiface="${IFACE}" e= x= mtu= |
35 |
# ports is for static add |
35 |
# ports is for static add |
36 |
local ports="$(_get_array "bridge_${IFVAR}")" |
36 |
local ports="$(_get_array "bridge_${IFVAR}")" |
37 |
# old config options |
37 |
# old config options |
38 |
local brctl_opts="$(_get_array "brctl_${IFVAR}")" |
38 |
local brctl_opts="$(_get_array "brctl_${IFVAR}")" |
39 |
# brif is used for dynamic add |
39 |
# brif is used for dynamic add |
40 |
eval brif=\$bridge_add_${IFVAR} |
40 |
eval brif=\$bridge_add_${IFVAR} |
|
|
41 |
eval mtu=\$mtu_${IFVAR} |
41 |
|
42 |
|
42 |
local do_iproute2=false do_brctl=false |
43 |
local do_iproute2=false do_brctl=false |
43 |
if [ -n "${brctl_opts}" ] && type brctl >/dev/null 2>&1; then |
44 |
if [ -n "${brctl_opts}" ] && type brctl >/dev/null 2>&1; then |
44 |
do_brctl=true |
45 |
do_brctl=true |
|
|
46 |
[ -n "$mtu" ] && type ip >/dev/null 2>&1 && do_iproute2=true |
45 |
elif type ip >/dev/null 2>&1; then |
47 |
elif type ip >/dev/null 2>&1; then |
46 |
do_iproute2=true |
48 |
do_iproute2=true |
47 |
elif type brctl >/dev/null 2>&1; then |
49 |
elif type brctl >/dev/null 2>&1; then |
Lines 81-87
bridge_pre_start()
Link Here
|
81 |
if ! _is_bridge ; then |
83 |
if ! _is_bridge ; then |
82 |
ebegin "Creating bridge ${IFACE}" |
84 |
ebegin "Creating bridge ${IFACE}" |
83 |
if ${do_iproute2}; then |
85 |
if ${do_iproute2}; then |
84 |
ip link add "${IFACE}" type bridge |
86 |
ip link add "${IFACE}" ${mtu:+mtu "${mtu}"} type bridge |
85 |
rc=$? |
87 |
rc=$? |
86 |
elif ${do_brctl}; then |
88 |
elif ${do_brctl}; then |
87 |
brctl addbr "${IFACE}" |
89 |
brctl addbr "${IFACE}" |