Skip to content
Snippets Groups Projects
Commit 0f01253b authored by Mathias Kresin's avatar Mathias Kresin
Browse files

base-files: always set proto passed to _ucidef_set_interface()


Overwrite an already set proto if a new one is passed to
_ucidef_set_interface() similar to what is done for the interface.

It is required when using ""ucidef_set_interface_wan 'ptm0' 'pppoe'"
after some initial wan interface configuration is already done by
ucidef_add_switch.

The "json_is_a protocol string" guard is meant to not reset an earlier
set interface proto in case something like
"ucidef_set_interface_lan 'eth0'" is used afterwards.

Signed-off-by: default avatarMathias Kresin <dev@kresin.me>
parent 715b0664
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ _ucidef_set_interface() {
json_select_object "$name"
json_add_string ifname "$iface"
if ! json_is_a protocol string; then
if ! json_is_a protocol string || [ -n "$proto" ]; then
case "$proto" in
static|dhcp|none|pppoe) : ;;
*)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment