summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorckishimo <carles.kishimoto@gmail.com>2021-11-09 00:25:06 +0100
committerckishimo <carles.kishimoto@gmail.com>2021-11-25 12:59:09 +0100
commita581473fbde8e790e74ce64ec2c39d37190113c8 (patch)
tree4589d13ac940613e824b19c517b9599347fe98c3
parentMerge pull request #10115 from donaldsharp/bgp_route_server_convergence (diff)
downloadfrr-a581473fbde8e790e74ce64ec2c39d37190113c8.tar.xz
frr-a581473fbde8e790e74ce64ec2c39d37190113c8.zip
ospf6d: check N-bit set in Hello packet
RFC 3101 states both E-bit and N-bit need to be checked when receiving a Hello packet. "To support the NSSA option an additional check must be made in the function that handles the receiving of the Hello packet to verify that both the N-bit and the E-bit found in the Hello packet's option field match the area type and ExternalRoutingCapability of the area of the receiving interface." This PR adds the check for the N-bit Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
-rw-r--r--ospf6d/ospf6_message.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index 9238b81c5..352cb137e 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -431,6 +431,14 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst,
return;
}
+ /* N-bit check */
+ if (OSPF6_OPT_ISSET(hello->options, OSPF6_OPT_N)
+ != OSPF6_OPT_ISSET(oi->area->options, OSPF6_OPT_N)) {
+ zlog_warn("VRF %s: IF %s N-bit mismatch",
+ oi->interface->vrf->name, oi->interface->name);
+ return;
+ }
+
/* Find neighbor, create if not exist */
on = ospf6_neighbor_lookup(oh->router_id, oi);
if (on == NULL) {