summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2018-08-27 09:49:01 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2018-08-27 09:49:01 +0000
commitc82fbada3ce8792a9a42f213194654cd94c698c4 (patch)
tree7a8c110957794a3865aa7021449d18d1a7d544cd
parented712632241f41424222f310063f597b059742ff (diff)
merge_filterset() needs to produce a stable sorted filterset to make sure
the RDE can compare the sets on reload and skip those that did not change. For large communities the check is wrong and incomplete, replace it with a simple memcmp() of the structs which will result in a stable order. OK phessler@
-rw-r--r--usr.sbin/bgpd/parse.y11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 6546d849ff3..7019d4502e9 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.329 2018/08/08 13:52:30 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.330 2018/08/27 09:49:00 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -3999,12 +3999,9 @@ merge_filterset(struct filter_set_head *sh, struct filter_set *s)
break;
case ACTION_SET_LARGE_COMMUNITY:
case ACTION_DEL_LARGE_COMMUNITY:
- if (s->action.large_community.as <
- t->action.large_community.as ||
- (s->action.large_community.as ==
- t->action.large_community.as &&
- s->action.large_community.ld1 <
- t->action.large_community.ld2 )) {
+ if (memcmp(&s->action.large_community,
+ &t->action.large_community,
+ sizeof(s->action.large_community)) < 0) {
TAILQ_INSERT_BEFORE(t, s, entry);
return (0);
}