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",
```
This commit is contained in:
Dominic Lake 2022-05-12 14:35:43 +01:00
parent 00d037ce85
commit 4d158e13b6

View file

@ -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]) {