diff options
author | 2018-10-10 06:21:47 +0000 | |
---|---|---|
committer | 2018-10-10 06:21:47 +0000 | |
commit | 57f29f0aa55001b3bd08327ebf3d98347aed5bdd (patch) | |
tree | be92ac6317ff9997993011c608249b531f24eb91 | |
parent | User land time accounting has changed when kernel spinning time was (diff) | |
download | wireguard-openbsd-57f29f0aa55001b3bd08327ebf3d98347aed5bdd.tar.xz wireguard-openbsd-57f29f0aa55001b3bd08327ebf3d98347aed5bdd.zip |
Large community setting, when checking for pre-existing community, was
comparing with byte-order swapped, therefore it could add duplicates.
ok claudio
-rw-r--r-- | usr.sbin/bgpd/rde_attr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index 9e12e8de042..21b4fbf5f61 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.111 2018/09/29 08:11:11 claudio Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.112 2018/10/10 06:21:47 deraadt Exp $ */ /* * Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> @@ -1431,7 +1431,8 @@ community_large_set(struct rde_aspath *asp, int64_t as, int64_t ld1, /* first check if the community is not already set */ for (i = 0; i < ncommunities; i++) { bar = (struct wire_largecommunity *)p; - if (bar->as == as && bar->ld1 == ld1 && bar->ld2 == ld2) + if (bar->as == htobe32(as) && bar->ld1 == htobe32(ld1) && + bar->ld2 == htobe32(ld2)) /* already present, nothing todo */ return (1); p += 12; |