From 799a5fbcf09462d7bf3cf6d599649fa6bc9b830a Mon Sep 17 00:00:00 2001 From: Pavel Kulyov Date: Sun, 24 Dec 2023 20:07:55 +0300 Subject: [PATCH 1/2] ndb: make non-unique FDB index more unique There can be multicast FDBs with single ifindex and no NDA_VLAN at all (that means NDA_VLAN = 0), but NDA_DST will be different. --- pyroute2/ndb/objects/neighbour.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyroute2/ndb/objects/neighbour.py b/pyroute2/ndb/objects/neighbour.py index 2144102aa..f8f55390b 100644 --- a/pyroute2/ndb/objects/neighbour.py +++ b/pyroute2/ndb/objects/neighbour.py @@ -48,8 +48,9 @@ def load_ndmsg(schema, target, event): brmsg_schema = ( ndmsg.sql_schema() - .unique_index('ifindex', 'NDA_LLADDR', 'NDA_VLAN') + .unique_index('ifindex', 'NDA_LLADDR', 'NDA_DST', 'NDA_VLAN') .constraint('NDA_LLADDR', "NOT NULL DEFAULT ''") + .constraint('NDA_DST', "NOT NULL DEFAULT ''") .constraint('NDA_VLAN', "NOT NULL DEFAULT 0") .foreign_key( 'interfaces', From 07636095000eadd971fa38e238ac7ae09da1dfe5 Mon Sep 17 00:00:00 2001 From: Peter Saveliev Date: Wed, 10 Jan 2024 13:32:08 +0000 Subject: [PATCH 2/2] requests: ignore empty DST for neigh requests Bug-Url: https://github.com/svinota/pyroute2/pull/1158 --- pyroute2/requests/neighbour.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyroute2/requests/neighbour.py b/pyroute2/requests/neighbour.py index af2dab37f..e0326a627 100644 --- a/pyroute2/requests/neighbour.py +++ b/pyroute2/requests/neighbour.py @@ -28,6 +28,12 @@ def set_nud(self, context, value): def set_state(self, context, value): return self._state(value) + def set_dst(self, context, value): + if value: + return {'dst': value} + else: + return {} + class NeighbourIPRouteFilter(IPRouteFilter): def set_dst(self, context, value):