diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-11-08 09:50:31 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-11-08 09:50:31 +0000 |
commit | ea03474ae89e1a616cc01064b3ca1161584a8266 (patch) | |
tree | b4c5ca22ef9dc2dfa9f0c1a338cb94f0b7df4811 /usr.sbin | |
parent | 822ac0edf5381ca1881279d252bbc4f28356f2bd (diff) |
Only whack the RIB and recreate it if the the FIB distribution flags changed
or the rtableid changed and there is a FIB. In the NOFIB case changing the
rtableid has no effect. Fixes a problem introduced with keeping the default
ribs alive and Adj-RIB-In/Out.
Probelm found, tested and OK denis@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/rde.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 5504f36b518..28e0740fb19 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.445 2018/11/04 12:34:54 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.446 2018/11/08 09:50:30 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -789,16 +789,17 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf) rib = rib_byid(rib_find(rn.name)); if (rib == NULL) rib = rib_new(rn.name, rn.rtableid, rn.flags); - else if (rib->rtableid != rn.rtableid || - (rib->flags & F_RIB_HASNOFIB) != - (rn.flags & F_RIB_HASNOFIB)) { + else if ((rib->flags & F_RIB_HASNOFIB) != + (rn.flags & F_RIB_HASNOFIB) || (rib->rtableid != + rn.rtableid && !(rib->flags & F_RIB_HASNOFIB))) { struct filter_head *in_rules; struct rib_desc *ribd = rib_desc(rib); /* * Big hammer in the F_RIB_HASNOFIB case but * not often enough used to optimise it more. * Need to save the filters so that they're not - * lost. + * lost. If the rtableid changes but there is + * no FIB no action is needed. */ in_rules = ribd->in_rules; ribd->in_rules = NULL; |