summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2018-11-08 09:50:30 +0000
committerclaudio <claudio@openbsd.org>2018-11-08 09:50:30 +0000
commitad0be2170d20bc32011f20357755b9008669a7c2 (patch)
tree9a6503ddec6ded91fecc5c9edc25a2f0f86f475f
parenttcpdrop(8) needs to access only two files, in this case /etc/hosts and (diff)
downloadwireguard-openbsd-ad0be2170d20bc32011f20357755b9008669a7c2.tar.xz
wireguard-openbsd-ad0be2170d20bc32011f20357755b9008669a7c2.zip
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@
-rw-r--r--usr.sbin/bgpd/rde.c11
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;