]> 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)
committermergify-bot <noreply@mergify.io>
Mon, 28 Jun 2021 11:45:07 +0000 (11:45 +0000)
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>
(cherry picked from commit 709bd204214c9d31592e4c2ccbb78b6b3f79a99b)

ospf6d/ospf6_message.c

index e52b929743af242c8b3927f1f3355c8276a234de..b42e7f6a08e0fd6896d322aac3521710f55121d5 100644 (file)
@@ -1620,6 +1620,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;