babeld: Support default interface configuration
When a "section interface" does not have a "option ifname", all its options are used as default interface options.
This commit is contained in:
parent
539de92a4c
commit
9bb7b1b03b
1 changed files with 4 additions and 2 deletions
|
@ -110,10 +110,12 @@ babel_config_cb() {
|
||||||
option_cb() {
|
option_cb() {
|
||||||
local option="$1"
|
local option="$1"
|
||||||
local value="$2"
|
local value="$2"
|
||||||
|
local _interface
|
||||||
# "option ifname" is a special option, don't actually
|
# "option ifname" is a special option, don't actually
|
||||||
# generate configuration for it.
|
# generate configuration for it.
|
||||||
[ "$option" = "ifname" ] && return
|
[ "$option" = "ifname" ] && return
|
||||||
cfg_append "interface $interface ${option//_/-} $value"
|
[ -n "$interface" ] && _interface="interface $interface" || _interface="default"
|
||||||
|
cfg_append "$_interface ${option//_/-} $value"
|
||||||
}
|
}
|
||||||
# Handle ignore options.
|
# Handle ignore options.
|
||||||
local _ignored
|
local _ignored
|
||||||
|
@ -126,7 +128,7 @@ babel_config_cb() {
|
||||||
else
|
else
|
||||||
# Also include an empty "interface $interface" statement,
|
# Also include an empty "interface $interface" statement,
|
||||||
# so that babeld operates on this interface.
|
# so that babeld operates on this interface.
|
||||||
cfg_append "interface $interface"
|
[ -n "$interface" ] && cfg_append "interface $interface"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
Loading…
Reference in a new issue