summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorKoen Aerts <aertskoen5@gmail.com>2019-08-13 15:02:19 +0200
committerHans Dedecker <dedeckeh@gmail.com>2019-08-14 22:59:34 +0200
commit6034b5c703cdb6f55d2847661fd1415184942ee2 (patch)
tree54cc40867e43a87c59221815a8ff0048ba0d5bc5 /src
parent000182fe4f94a5a6ec139456a2b74f0cdea13b9c (diff)
router: close socket upon NETEV_IFINDEX_CHANGE
Make sure the socket is closed in a case where the bridge goes down as a result of NO-CARRIER on the bridge. If not present Router Discovery and Router Advertisement will break permanently after the bridge went down. Related to https://github.com/openwrt/odhcpd/issues/135 Signed-off-by: Koen Aerts <aertskoen5@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/router.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/router.c b/src/router.c
index c68d0d5..85940f8 100644
--- a/src/router.c
+++ b/src/router.c
@@ -229,6 +229,11 @@ static void router_netevent_cb(unsigned long event, struct netevent_handler_info
struct interface *iface;
switch (event) {
+ case NETEV_IFINDEX_CHANGE:
+ iface = info->iface;
+ if (iface && iface->router_event.uloop.fd >= 0)
+ close(iface->router_event.uloop.fd);
+ break;
case NETEV_ROUTE6_ADD:
case NETEV_ROUTE6_DEL:
if (info->rt.dst_len)