summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}