mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2026-03-05 17:00:54 +01:00
Ticket refs #13917: Device.Ethernet.Interface.x.Status show always Up even LAN port is not up
This commit is contained in:
parent
a65572af53
commit
ee3096d50c
1 changed files with 6 additions and 2 deletions
|
|
@ -112,7 +112,7 @@ int set_eth_port_alias(char *refparam, struct dmctx *ctx, void *data, char *inst
|
|||
int get_eth_port_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
json_object *res;
|
||||
char *ifname;
|
||||
char *ifname, *speed;
|
||||
|
||||
if (strstr(((struct eth_port_args *)data)->ifname, wan_ifname)) {
|
||||
ifname = dmstrdup(wan_ifname);
|
||||
|
|
@ -121,7 +121,11 @@ int get_eth_port_enable(char *refparam, struct dmctx *ctx, void *data, char *ins
|
|||
|
||||
dmubus_call("network.device", "status", UBUS_ARGS{{"name", ifname, String}}, 1, &res);
|
||||
DM_ASSERT(res, *value = "");
|
||||
*value = dmjson_get_value(res, 1, "up");
|
||||
speed = dmjson_get_value(res, 1, "speed");
|
||||
if(*speed != '\0')
|
||||
*value = "true";
|
||||
else
|
||||
*value = "false";
|
||||
dmfree(ifname);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue