From a08dc62b80aff1806e3e4ef4758c437085f59d1b Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Fri, 17 Jul 2015 20:06:47 +0000 Subject: Do similar handling of connected routes and filtering of llinfo and broadcast. With this the ospfd fib and the kernel routing table are better in sync. --- usr.sbin/ospfd/kroute.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'usr.sbin/ospfd') diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c index 68edb1953ca..1eb23cfadd6 100644 --- a/usr.sbin/ospfd/kroute.c +++ b/usr.sbin/ospfd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.98 2015/02/11 05:57:44 claudio Exp $ */ +/* $OpenBSD: kroute.c,v 1.99 2015/07/17 20:06:46 claudio Exp $ */ /* * Copyright (c) 2004 Esben Norby @@ -1373,7 +1373,8 @@ rtmsg_process(char *buf, size_t len) if ((sa = rti_info[RTAX_DST]) == NULL) continue; - if (rtm->rtm_flags & RTF_LLINFO) /* arp cache */ + /* Skip ARP/ND cache and broadcast routes. */ + if (rtm->rtm_flags & (RTF_LLINFO|RTF_BROADCAST)) continue; if (rtm->rtm_flags & RTF_MPATH) @@ -1414,10 +1415,19 @@ rtmsg_process(char *buf, size_t len) if ((sa = rti_info[RTAX_GATEWAY]) != NULL) { switch (sa->sa_family) { case AF_INET: + if (rtm->rtm_flags & RTF_CONNECTED) { + flags |= F_CONNECTED; + break; + } + nexthop.s_addr = ((struct sockaddr_in *)sa)->sin_addr.s_addr; break; case AF_LINK: + /* + * Traditional BSD connected routes have + * a gateway of type AF_LINK. + */ flags |= F_CONNECTED; break; } -- cgit v1.2.3