umbim: inherit "peerdns" option from parent interface
authorLech Perczak <lech.perczak@gmail.com>
Mon, 19 Jul 2021 17:15:53 +0000 (19:15 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 29 Apr 2023 19:33:04 +0000 (21:33 +0200)
MBIM protocol handler should intherit "peerdns" options from parent
interface on sub-interfaces, otherwise upstream DNS servers are applied
regardless of configuration.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
package/network/utils/umbim/files/lib/netifd/proto/mbim.sh

index 3867411818a0f7acd8e9801195f5b39925724dac..133c6ef5e6a169710351406c60decc33244b0443 100755 (executable)
@@ -187,7 +187,7 @@ _proto_mbim_setup() {
                        json_close_array
                        json_add_string gateway "$ipv4gateway"
                        json_add_array dns
-                       json_add_string "" "$ipv4dnsserver"
+                       [ "$peerdns" = 0 ] || json_add_string "" "$ipv4dnsserver"
                        json_close_array
                        proto_add_dynamic_defaults
                        json_close_object
@@ -204,7 +204,7 @@ _proto_mbim_setup() {
                        json_close_array
                        json_add_string ip6gw "$ipv6gateway"
                        json_add_array dns
-                       json_add_string "" "$ipv6dnsserver"
+                       [ "$peerdns" = 0 ] || json_add_string "" "$ipv6dnsserver"
                        json_close_array
                        proto_add_dynamic_defaults
                        json_close_object