diff options
author | 2015-07-18 00:27:32 +0000 | |
---|---|---|
committer | 2015-07-18 00:27:32 +0000 | |
commit | 69208ac5e91b258a6005fec8cb1cf3866b79a2ed (patch) | |
tree | f54c21bc8be817ed08dcb0348d523f27c9213c13 | |
parent | Packets that make it to ether_input that have M_VLANTAG set must be dropped. (diff) | |
download | wireguard-openbsd-69208ac5e91b258a6005fec8cb1cf3866b79a2ed.tar.xz wireguard-openbsd-69208ac5e91b258a6005fec8cb1cf3866b79a2ed.zip |
Better track connected routes similar to bgpd/ospfd.
According to sthen@ this makes snmpd report routes more correct
-rw-r--r-- | usr.sbin/snmpd/kroute.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/snmpd/kroute.c b/usr.sbin/snmpd/kroute.c index c73be5027a7..fdc4dfdbe44 100644 --- a/usr.sbin/snmpd/kroute.c +++ b/usr.sbin/snmpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.30 2015/01/16 00:05:13 deraadt Exp $ */ +/* $OpenBSD: kroute.c,v 1.31 2015/07/18 00:27:32 claudio Exp $ */ /* * Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org> @@ -1458,7 +1458,19 @@ dispatch_rtmsg_addr(struct ktable *kt, struct rt_msghdr *rtm, if ((sa = rti_info[RTAX_GATEWAY]) != NULL) switch (sa->sa_family) { + case AF_INET: + case AF_INET6: + if (rtm->rtm_flags & RTF_CONNECTED) { + flags |= F_CONNECTED; + ifindex = rtm->rtm_index; + } + mpath = 0; /* link local stuff can't be mpath */ + break; case AF_LINK: + /* + * Traditional BSD connected routes have + * a gateway of type AF_LINK. + */ flags |= F_CONNECTED; ifindex = rtm->rtm_index; mpath = 0; /* link local stuff can't be mpath */ |