From 4d158e13b6a17561fc0306fdbf3c8ca71613da78 Mon Sep 17 00:00:00 2001 From: Dominic Lake Date: Thu, 12 May 2022 14:35:43 +0100 Subject: [PATCH] fix-wan-interface: fix CWMP bind interface A ubus call is made for: ``` ubus call network.status '{"interface": "wan"}' ``` Where interface is retrieved from: `cwmp.cpe.default_wan_interface` However, currently "device" is being used as the interface to bind to but this is the raw device which only works if a L3 device hasn't been created over the top - i.e for PPP. Therefore pull L3 device instead, i.e: ``` "l3_device": "pppoe-wan", # <-- this is the one to use "device": "eth0.1", ``` this also works when the WAN type is DHCP: ``` "l3_device": "eth0.1", "device": "eth0.1", "proto": "dhcp", ``` --- common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.c b/common.c index 4da1d1b..bac0459 100755 --- a/common.c +++ b/common.c @@ -697,7 +697,7 @@ int copy_file(char *source_file, char *target_file) void ubus_network_interface_callback(struct ubus_request *req __attribute__((unused)), int type __attribute__((unused)), struct blob_attr *msg) { - const struct blobmsg_policy p[1] = { { "device", BLOBMSG_TYPE_STRING } }; + const struct blobmsg_policy p[1] = { { "l3_device", BLOBMSG_TYPE_STRING } }; struct blob_attr *tb[1] = { NULL }; blobmsg_parse(p, 1, tb, blobmsg_data(msg), blobmsg_len(msg)); if (!tb[0]) {