mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
B#7328 extra object added under device after almac change
This commit is contained in:
parent
aa25738c8e
commit
e6ff70f5d5
2 changed files with 6 additions and 2 deletions
|
|
@ -678,7 +678,7 @@ static json_object *dump_find_device_object(const char *unique_key)
|
|||
dmjson_foreach_obj_in_array(data_obj, dev_arr, dev_obj, j, 2, "wfa-dataelements:Network", "DeviceList") {
|
||||
|
||||
char *id = dmjson_get_value(dev_obj, 1, "ID");
|
||||
if (DM_STRCMP(unique_key, id) == 0)
|
||||
if (DM_STRCASECMP(unique_key, id) == 0)
|
||||
return dev_obj;
|
||||
}
|
||||
}
|
||||
|
|
@ -697,7 +697,7 @@ static json_object *dump2_find_device_object(const char *unique_key)
|
|||
dmjson_foreach_obj_in_array(res, device_arr, device_obj, i, 1, "APDeviceList") {
|
||||
|
||||
char *macaddr = dmjson_get_value(device_obj, 1, "macaddr");
|
||||
if (DM_STRCMP(unique_key, macaddr) == 0)
|
||||
if (DM_STRCASECMP(unique_key, macaddr) == 0)
|
||||
return device_obj;
|
||||
}
|
||||
|
||||
|
|
@ -758,6 +758,9 @@ static int browseWiFiDataElementsNetworkDeviceInst(struct dmctx *dmctx, DMNODE *
|
|||
wifi_da_device_args.dump_obj = dump_find_device_object(key);
|
||||
wifi_da_device_args.dump2_obj = dump2_find_device_object(key);
|
||||
|
||||
if (wifi_da_device_args.dump_obj == NULL && wifi_da_device_args.dump2_obj == NULL)
|
||||
continue;
|
||||
|
||||
inst = handle_instance(dmctx, parent_node, p->dmmap_section, "wifi_da_device_instance", "wifi_da_device_alias");
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&wifi_da_device_args, inst) == DM_STOP)
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ do { \
|
|||
#define DM_STRTOL(SRC) ((SRC != NULL) ? strtol(SRC, NULL, 10) : 0)
|
||||
#define DM_STRCMP(S1, S2) ((S1 != NULL && S2 != NULL) ? strcmp(S1, S2) : -1)
|
||||
#define DM_STRNCMP(S1, S2, LEN) ((S1 != NULL && S2 != NULL && LEN > 0) ? strncmp(S1, S2, LEN) : -1)
|
||||
#define DM_STRCASECMP(S1, S2) ((S1 != NULL && S2 != NULL) ? strcasecmp(S1, S2) : -1)
|
||||
|
||||
#define UBUS_ARGS (struct ubus_arg[])
|
||||
#define RANGE_ARGS (struct range_args[])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue