summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2018-10-10 06:21:47 +0000
committerderaadt <deraadt@openbsd.org>2018-10-10 06:21:47 +0000
commit57f29f0aa55001b3bd08327ebf3d98347aed5bdd (patch)
treebe92ac6317ff9997993011c608249b531f24eb91
parentUser land time accounting has changed when kernel spinning time was (diff)
downloadwireguard-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.c5
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;