diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2019-04-04 12:01:46 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-04-04 15:36:15 +0200 |
commit | e7b1d4bf3a2297192638b9c84208b3dcb306ecd8 (patch) | |
tree | a371584b78e0a0c1dd8b6e4339393aa9b2a20652 /src/dhcpv6.c | |
parent | 7798d502f4c2e89a2493c0ea7a800a9359ee0bbc (diff) |
treewide: initialize properly file descriptors
Initialzie properly the dhcpv6, dhcpv4 and ndp ffile descriptors
when creating an interface.
As such the check for a valid descriptor can be done correct now
in the different modules
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/dhcpv6.c')
-rw-r--r-- | src/dhcpv6.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 2d5861c..f71418d 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -47,7 +47,7 @@ int dhcpv6_setup_interface(struct interface *iface, bool enable) { int ret = 0; - if (iface->dhcpv6_event.uloop.fd > 0) { + if (iface->dhcpv6_event.uloop.fd >= 0) { uloop_fd_delete(&iface->dhcpv6_event.uloop); close(iface->dhcpv6_event.uloop.fd); iface->dhcpv6_event.uloop.fd = -1; @@ -150,7 +150,7 @@ int dhcpv6_setup_interface(struct interface *iface, bool enable) ret = dhcpv6_ia_setup_interface(iface, enable); out: - if (ret < 0 && iface->dhcpv6_event.uloop.fd > 0) { + if (ret < 0 && iface->dhcpv6_event.uloop.fd >= 0) { close(iface->dhcpv6_event.uloop.fd); iface->dhcpv6_event.uloop.fd = -1; } |