summaryrefslogtreecommitdiff
path: root/proto/ospf/dbdes.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-07-10 18:25:36 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-07-10 18:25:36 +0200
commit1aec7112f7314c3e9a4d8b9440dd85a782295310 (patch)
tree0a48e1eeb5a43c8905fbb1b779e2f487fc2b5aad /proto/ospf/dbdes.c
parent422a9334294dd9a5b13abd8563a3dc7233e64b13 (diff)
OSPF: Fix handling of NSSA option flags
Per RFC 3101, N-bit signalling NSSA support should be used only in Hello packets, not in DBDES packets. BIRD since 2.0.4 verifies N-bit in neighbor structure, which is learned from DBDES packets, therefore NSSA-LSAs are not propagated to proper implementations of RFC 3101. This patch fixes that. Both removing the check and removing N-bit from DBDES packet. This will fix compatibility issues with proper implementations, but causes compatibility issues with BIRD 2.0.4.
Diffstat (limited to 'proto/ospf/dbdes.c')
-rw-r--r--proto/ospf/dbdes.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/proto/ospf/dbdes.c b/proto/ospf/dbdes.c
index b39595d9..5a5f76f8 100644
--- a/proto/ospf/dbdes.c
+++ b/proto/ospf/dbdes.c
@@ -127,7 +127,7 @@ ospf_prepare_dbdes(struct ospf_proto *p, struct ospf_neighbor *n)
{
struct ospf_dbdes2_packet *ps = (void *) pkt;
ps->iface_mtu = htons(iface_mtu);
- ps->options = ifa->oa->options | OPT_O;
+ ps->options = ifa->oa->options & DBDES2_OPT_MASK;
ps->imms = 0; /* Will be set later */
ps->ddseq = htonl(n->dds);
length = sizeof(struct ospf_dbdes2_packet);
@@ -135,7 +135,8 @@ ospf_prepare_dbdes(struct ospf_proto *p, struct ospf_neighbor *n)
else /* OSPFv3 */
{
struct ospf_dbdes3_packet *ps = (void *) pkt;
- ps->options = htonl(ifa->oa->options | (ifa->autype == OSPF_AUTH_CRYPT ? OPT_AT : 0));
+ u32 options = ifa->oa->options | (ifa->autype == OSPF_AUTH_CRYPT ? OPT_AT : 0);
+ ps->options = htonl(options & DBDES3_OPT_MASK);
ps->iface_mtu = htons(iface_mtu);
ps->padding = 0;
ps->imms = 0; /* Will be set later */