diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2015-07-17 20:12:39 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2015-07-17 20:12:39 +0000 |
commit | 11c4a350023d744f5b50bf3bbfb93c7f64550c88 (patch) | |
tree | 0682e481c7d61934719df740239e144b431fb64f /usr.sbin/ospf6d/kroute.c | |
parent | a08dc62b80aff1806e3e4ef4758c437085f59d1b (diff) |
Similar to bgpd and ospfd skip broadcast (should not happen) and llinfo
routes also adjust the tracking of connected routes to the new way.
Diffstat (limited to 'usr.sbin/ospf6d/kroute.c')
-rw-r--r-- | usr.sbin/ospf6d/kroute.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/usr.sbin/ospf6d/kroute.c b/usr.sbin/ospf6d/kroute.c index 84c06edb206..fcb5cae5bfc 100644 --- a/usr.sbin/ospf6d/kroute.c +++ b/usr.sbin/ospf6d/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.47 2015/02/11 05:58:57 claudio Exp $ */ +/* $OpenBSD: kroute.c,v 1.48 2015/07/17 20:12:38 claudio Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -1092,7 +1092,8 @@ fetchtable(void) 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 ((kr = calloc(1, sizeof(struct kroute_node))) == NULL) { @@ -1137,6 +1138,11 @@ fetchtable(void) if ((sa = rti_info[RTAX_GATEWAY]) != NULL) switch (sa->sa_family) { case AF_INET6: + if (rtm->rtm_flags & RTF_CONNECTED) { + kr->r.flags |= F_CONNECTED; + break; + } + sa_in6 = (struct sockaddr_in6 *)sa; /* * XXX The kernel provides the scope via the @@ -1147,6 +1153,10 @@ fetchtable(void) kr->r.scope = sa_in6->sin6_scope_id; break; case AF_LINK: + /* + * Traditional BSD connected routes have + * a gateway of type AF_LINK. + */ kr->r.flags |= F_CONNECTED; break; } @@ -1298,7 +1308,8 @@ dispatch_rtmsg(void) if (rtm->rtm_errno) /* failed attempts... */ 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; #ifdef RTF_MPATH |