diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2016-03-22 15:53:01 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2016-03-22 15:53:01 +0000 |
commit | e83440a78163d09d2f7c7659ee4fa40c75865c3f (patch) | |
tree | d8d592e78236593e546614b1972e530982f244dc /usr.sbin/bgpd/kroute.c | |
parent | cea8f2d2402d31ad230a2ebeee4e47a00a1f4d9e (diff) |
Connected routes are no longer identified by a AF_LINK gateway so adjust
dispatch_rtmsg_addr() similar to the way fetchtable() was fixed long ago.
This should fix various issues with bad gateways being picked up by bgpd.
Problem identified and initial fix provided by phessler@ but commiting
my version which is more conservative. OK phessler@
Diffstat (limited to 'usr.sbin/bgpd/kroute.c')
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index d6fba800c51..3dd1605604f 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.207 2015/12/05 18:28:04 benno Exp $ */ +/* $OpenBSD: kroute.c,v 1.208 2016/03/22 15:53:00 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -3178,6 +3178,15 @@ dispatch_rtmsg_addr(struct rt_msghdr *rtm, struct sockaddr *rti_info[RTAX_MAX], sa = NULL; mpath = 0; /* link local stuff can't be mpath */ break; + case AF_INET: + case AF_INET6: + if (rtm->rtm_flags & RTF_CONNECTED) { + flags |= F_CONNECTED; + ifindex = rtm->rtm_index; + sa = NULL; + mpath = 0; /* link local stuff can't be mpath */ + } + break; } if (rtm->rtm_type == RTM_DELETE) { |