From: dlg Date: Wed, 14 Jul 2010 01:00:32 +0000 (+0000) Subject: handle RTM_DESYNC. if the kernel says we're out of sync with the kernel X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=fa19e37c4a1926cf0426af2d2b1bef86d4675197;p=openbsd 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. --- 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 @@ -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;