projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
186f6ea
)
wireless: process and close script file descriptor when rerunning setup
author
Felix Fietkau
<nbd@nbd.name>
Wed, 29 Sep 2021 12:03:55 +0000
(14:03 +0200)
committer
Felix Fietkau
<nbd@nbd.name>
Wed, 29 Sep 2021 13:07:16 +0000
(15:07 +0200)
On reloading, setup is called without a teardown, so the previous fd might
still be open. Clear it to avoid a leak.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
wireless.c
patch
|
blob
|
history
diff --git
a/wireless.c
b/wireless.c
index 9c49da0e2b99a407ac2a69b88a966770f22f6f04..dafd49aa693b18416ef371e0490ccda45e24d872 100644
(file)
--- a/
wireless.c
+++ b/
wireless.c
@@
-431,6
+431,9
@@
wireless_device_run_handler(struct wireless_device *wdev, bool up)
argv[i] = NULL;
if (up && pipe(fds) == 0) {
+ if (wdev->script_proc_fd.fd >= 0)
+ wireless_close_script_proc_fd(wdev);
+
wdev->script_proc_fd.fd = fds[0];
uloop_fd_add(&wdev->script_proc_fd,
ULOOP_READ | ULOOP_EDGE_TRIGGER);