summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphessler <phessler@openbsd.org>2016-09-23 12:50:17 +0000
committerphessler <phessler@openbsd.org>2016-09-23 12:50:17 +0000
commit55c81b90b27c1d36f194aea7d24a6e5a236d670a (patch)
tree930a764e37aeb1fb93aff00e8cdbc39912025024
parentuse sizeof instead of constant 16 in function calls (diff)
downloadwireguard-openbsd-55c81b90b27c1d36f194aea7d24a6e5a236d670a.tar.xz
wireguard-openbsd-55c81b90b27c1d36f194aea7d24a6e5a236d670a.zip
based on a more careful reading of the spec, we're not allowed to make
decisions on what the "my discriminator" value is from our neighbor. we should only copy it and send it back.
-rw-r--r--sys/net/bfd.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/net/bfd.c b/sys/net/bfd.c
index 32af7684cdd..4f1086b513f 100644
--- a/sys/net/bfd.c
+++ b/sys/net/bfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bfd.c,v 1.38 2016/09/23 10:20:20 phessler Exp $ */
+/* $OpenBSD: bfd.c,v 1.39 2016/09/23 12:50:17 phessler Exp $ */
/*
* Copyright (c) 2016 Peter Hessler <phessler@openbsd.org>
@@ -724,15 +724,8 @@ bfd_input(struct bfd_config *bfd, struct mbuf *m)
#endif
}
- if ((bfd->bc_neighbor->bn_rdiscr == 0) &&
- (ntohl(peer->bfd_my_discriminator) != 0))
- bfd->bc_neighbor->bn_rdiscr = ntohl(peer->bfd_my_discriminator);
-
- if (bfd->bc_neighbor->bn_rdiscr != ntohl(peer->bfd_my_discriminator))
- goto discard;
-
+ bfd->bc_neighbor->bn_rdiscr = ntohl(peer->bfd_my_discriminator);
bfd->bc_neighbor->bn_rstate = state;
-
bfd->bc_neighbor->bn_rdemand = (flags & BFD_FLAG_D);
bfd->bc_poll = (flags & BFD_FLAG_F);