diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-07-10 18:25:36 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-07-10 18:25:36 +0200 |
commit | 1aec7112f7314c3e9a4d8b9440dd85a782295310 (patch) | |
tree | 0a48e1eeb5a43c8905fbb1b779e2f487fc2b5aad /proto/ospf/hello.c | |
parent | 422a9334294dd9a5b13abd8563a3dc7233e64b13 (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/hello.c')
-rw-r--r-- | proto/ospf/hello.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/proto/ospf/hello.c b/proto/ospf/hello.c index 9e427c4f..d094f934 100644 --- a/proto/ospf/hello.c +++ b/proto/ospf/hello.c @@ -81,7 +81,7 @@ ospf_send_hello(struct ospf_iface *ifa, int kind, struct ospf_neighbor *dirn) ps->netmask = htonl(u32_mkmask(ifa->addr->prefix.pxlen)); ps->helloint = ntohs(ifa->helloint); - ps->options = ifa->oa->options; + ps->options = ifa->oa->options & HELLO2_OPT_MASK; ps->priority = ifa->priority; ps->deadint = htonl(ifa->deadint); ps->dr = htonl(ipa_to_u32(ifa->drip)); @@ -96,7 +96,7 @@ ospf_send_hello(struct ospf_iface *ifa, int kind, struct ospf_neighbor *dirn) u32 options = ifa->oa->options | (ifa->autype == OSPF_AUTH_CRYPT ? OPT_AT : 0); ps->iface_id = htonl(ifa->iface_id); - ps->options = ntohl(options | (ifa->priority << 24)); + ps->options = ntohl((options & HELLO3_OPT_MASK) | (ifa->priority << 24)); ps->helloint = ntohs(ifa->helloint); ps->deadint = htons(ifa->deadint); ps->dr = htonl(ifa->drid); |