summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-09-27 18:56:21 +0200
committerFelix Fietkau <nbd@nbd.name>2021-09-27 18:58:01 +0200
commit5a4ac30c7a15712d01110befec1acfe86c2cbed0 (patch)
treead52b0310a781078efb9b016fbe80d89ca50001d /config.c
parent08e954e137ffcf7770200bbd6476dc36bbd326f5 (diff)
downloadnetifd-5a4ac30c7a15712d01110befec1acfe86c2cbed0.tar.gz
netifd: rework/fix device free handling
Instead of explicitly preventing free in specific code sections using device_lock/device_unlock, defer all device free handling via uloop timeout This avoids an entire class of lurking use-after-free bugs triggered by device event processing and simplifies the code Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'config.c')
-rw-r--r--config.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/config.c b/config.c
index d83ea9c..9bbda39 100644
--- a/config.c
+++ b/config.c
@@ -762,7 +762,6 @@ config_init_all(void)
vlist_update(&interfaces);
config_init = true;
- device_lock();
device_reset_config();
config_init_devices(true);
@@ -775,12 +774,10 @@ config_init_all(void)
config_init_wireless();
config_init = false;
- device_unlock();
device_reset_old();
device_init_pending();
vlist_flush(&interfaces);
- device_free_unused(NULL);
interface_refresh_assignments(false);
interface_start_pending();
wireless_start_pending();