On 2016/03/31 12:40, Peter Hessler wrote:
> We see occasional bgpd deaths during boot. This is apparently caused by
> a race with ospfd starting up.
>
> The underlying problem is we are reciving a CHANGE route message for an
> MPATH path, where the gateway doesn't match the route message. In our
> case, the prefix is assigned to a Connected (and Backup/Down) carp
> device, and we are reciving routes for it from several of our ospf
> neighbors.
>
> ospfd simply treats those as an "add" instead of a "change". I would
> like to do the same thing in bgpd.
>
> OK?
I've run into this a few times in the past. Working for me so far,
unless anyone has concerns I think this should go in as it's quite a
nasty failure mode for people with multipath configured.
> Index: usr.sbin/bgpd/kroute.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/kroute.c,v
> retrieving revision 1.207.2.1
> diff -u -p -u -p -r1.207.2.1 kroute.c
> --- usr.sbin/bgpd/kroute.c 23 Mar 2016 13:41:37 -0000 1.207.2.1
> +++ usr.sbin/bgpd/kroute.c 31 Mar 2016 10:37:05 -0000
> @@ -3251,7 +3251,7 @@ dispatch_rtmsg_addr(struct rt_msghdr *rt
> (kr = kroute_matchgw(kr, sa_in)) == NULL) {
> log_warnx("dispatch_rtmsg_addr[change] "
> "mpath route not found");
> - return (-1);
> + goto add4;
> } else if (mpath && rtm->rtm_type == RTM_ADD)
> goto add4;
>
> @@ -3323,7 +3323,7 @@ add4:
> NULL) {
> log_warnx("dispatch_rtmsg[change] "
> "IPv6 mpath route not found");
> - return (-1);
> + goto add6;
> } else if (mpath && rtm->rtm_type == RTM_ADD)
> goto add6;
>
>
> --
> If A equals success, then the formula is _A = _X + _Y + _Z. _X is work.
> _Y
> is play. _Z is keep your mouth shut.
> -- Albert Einstein
>