summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2015-07-17 20:06:47 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2015-07-17 20:06:47 +0000
commita08dc62b80aff1806e3e4ef4758c437085f59d1b (patch)
treef36f7630b4d57af4d63ff28b8d2c5b5cff76fa5d /usr.sbin/ospfd
parent5f48db19e9500960c09423e27ae3dafd892d0068 (diff)
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.
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r--usr.sbin/ospfd/kroute.c14
1 files changed, 12 insertions, 2 deletions
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 <norby@openbsd.org>
@@ -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;
}