summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2018-10-10 06:21:48 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2018-10-10 06:21:48 +0000
commit6a3005e690de49bee6e3e3f6f15abfaa9c49e553 (patch)
tree4b1c08caf6b5b3a6dc3dbc8c2bc83428c0a0071a /usr.sbin
parentdb316721f1e671c55b0a87d5a64203fbd6bf9cfd (diff)
Large community setting, when checking for pre-existing community, was
comparing with byte-order swapped, therefore it could add duplicates. ok claudio
Diffstat (limited to 'usr.sbin')
-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;