wireless: add support for replacing data blobs at runtime
authorFelix Fietkau <nbd@nbd.name>
Mon, 17 Jul 2023 09:03:30 +0000 (11:03 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 17 Jul 2023 09:03:32 +0000 (11:03 +0200)
Needed for dynamic reconfiguration

Signed-off-by: Felix Fietkau <nbd@nbd.name>
wireless.c

index 42eb18734105c46b096c7f032d53c289f24fcbc0..645b2bc9ae1c84278937582b5021a9c196a1ccf4 100644 (file)
@@ -1523,9 +1523,7 @@ wireless_device_notify(struct wireless_device *wdev, struct blob_attr *data,
                else
                        pdata = &wdev->data;
 
-               if (*pdata)
-                       return UBUS_STATUS_INVALID_ARGUMENT;
-
+               free(*pdata);
                *pdata = blob_memdup(cur);
                if (vif)
                        wireless_interface_set_data(vif);