]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: fix duplicated packet read
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 25 Jun 2021 11:59:28 +0000 (14:59 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Sat, 26 Jun 2021 09:57:26 +0000 (12:57 +0300)
When OSPFv3 router is configured in both default and non-default VRFs,
every packet destined to a non-default VRF is read twice. This makes it
impossible to establish neighborship because every DbDesc packet is
treated as duplicated and we end up infinitely exchanging DbDescs.

We should drop packets received in the default VRF if an interface we
received it on is bound to another VRF.

Same thing was done for OSPFv2 in 555691e.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
ospf6d/ospf6_message.c

index 5f23aab80af7ecbdec80664dc1d9db0f584be2eb..817e5372ead14c1850f654d16cecb2babff2b4ac 100644 (file)
@@ -1709,6 +1709,13 @@ static int ospf6_read_helper(int sockfd, struct ospf6 *ospf6)
                return OSPF6_READ_CONTINUE;
        }
 
+       /*
+        * Drop packet destined to another VRF.
+        * This happens when raw_l3mdev_accept is set to 1.
+        */
+       if (ospf6->vrf_id != oi->interface->vrf_id)
+               return OSPF6_READ_CONTINUE;
+
        oh = (struct ospf6_header *)recvbuf;
        if (ospf6_rxpacket_examin(oi, oh, len) != MSG_OK)
                return OSPF6_READ_CONTINUE;