summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2010-07-14 01:00:32 +0000
committerdlg <dlg@openbsd.org>2010-07-14 01:00:32 +0000
commitfa19e37c4a1926cf0426af2d2b1bef86d4675197 (patch)
treef39f22aa462fa6f3c479888cba6add5db4f0bb6e
parentif we produce a lot of rtsock messages it is possible we will hit a (diff)
downloadwireguard-openbsd-fa19e37c4a1926cf0426af2d2b1bef86d4675197.tar.xz
wireguard-openbsd-fa19e37c4a1926cf0426af2d2b1bef86d4675197.zip
handle RTM_DESYNC. if the kernel says we're out of sync with the kernel
routing table and interface list, do a reload of the kernel state. ive been running this in production for 2 or 3 weeks. tested by sthen@ ok sthen@ claudio@ deraadt@ code written by andrew sallaway at the univeristy of queensland.
-rw-r--r--usr.sbin/ospfd/kroute.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c
index a799353e46c..373c43f0f57 100644
--- a/usr.sbin/ospfd/kroute.c
+++ b/usr.sbin/ospfd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.86 2010/07/12 14:35:13 bluhm Exp $ */
+/* $OpenBSD: kroute.c,v 1.87 2010/07/14 01:00:32 dlg Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -361,6 +361,8 @@ kr_fib_reload(void)
{
struct kroute_node *krn, *kr, *kn;
+ log_info("reloading interface list and routing table");
+
kr_state.fib_serial++;
if (fetchifs(0) == -1 || fetchtable() == -1)
@@ -1525,6 +1527,13 @@ add:
case RTM_IFANNOUNCE:
if_announce(next);
break;
+ case RTM_DESYNC:
+ /*
+ * We lost some routing packets. Force a reload of
+ * the kernel route/interface information.
+ */
+ kr_fib_reload();
+ break;
default:
/* ignore for now */
break;