summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2018-07-13 09:16:50 +0000
committerflorian <florian@openbsd.org>2018-07-13 09:16:50 +0000
commit2ccdd6f1907daf69a90ba8df09183e600dc7cd90 (patch)
tree213c56cdc9e6a8aaee4ed7e74e6f751ab0e98242
parentadd missing IMSG_STARTUP; unclear why this ever worked (diff)
downloadwireguard-openbsd-2ccdd6f1907daf69a90ba8df09183e600dc7cd90.tar.xz
wireguard-openbsd-2ccdd6f1907daf69a90ba8df09183e600dc7cd90.zip
Monitor the route socket and regenerate the list of interfaces and
messages to send when an interface shows up or disappears or and address shows up or disappears.
-rw-r--r--usr.sbin/rad/frontend.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.sbin/rad/frontend.c b/usr.sbin/rad/frontend.c
index 937761069cb..37d1ffea622 100644
--- a/usr.sbin/rad/frontend.c
+++ b/usr.sbin/rad/frontend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: frontend.c,v 1.7 2018/07/13 08:32:10 florian Exp $ */
+/* $OpenBSD: frontend.c,v 1.8 2018/07/13 09:16:50 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -1045,4 +1045,18 @@ route_receive(int fd, short events, void *arg)
void
handle_route_message(struct rt_msghdr *rtm, struct sockaddr **rti_info)
{
+ switch (rtm->rtm_type) {
+ case RTM_IFINFO:
+ case RTM_NEWADDR:
+ case RTM_DELADDR:
+ /*
+ * do the same thing as after a config reload when interfaces
+ * change or IPv6 addresses show up / disappear
+ */
+ merge_ra_interfaces();
+ break;
+ default:
+ log_debug("unexpected RTM: %d", rtm->rtm_type);
+ break;
+ }
}