From 268f301391a836deae836d73d86b81cb7c757554 Mon Sep 17 00:00:00 2001 From: Luis Tomas Bolivar Date: Wed, 31 Aug 2022 09:46:39 +0200 Subject: [PATCH] Ensure IP family is used to obtain the existing routes Change-Id: I9d0dcbf21c256ab6e164701d6557566ab4444eec --- ovn_bgp_agent/utils/linux_net.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ovn_bgp_agent/utils/linux_net.py b/ovn_bgp_agent/utils/linux_net.py index 4f44b7ea..06018dc9 100644 --- a/ovn_bgp_agent/utils/linux_net.py +++ b/ovn_bgp_agent/utils/linux_net.py @@ -186,10 +186,18 @@ def ensure_routing_table_for_bridge(ovn_routing_tables, bridge): except KeyError: pass # no ipv6 default rule else: - extra_routes.append( - ndb.routes[{'table': ovn_routing_tables[bridge], - 'dst': dst}] - ) + if get_ip_version(dst) == constants.IP_VERSION_6: + extra_routes.append( + ndb.routes[{'table': ovn_routing_tables[bridge], + 'dst': dst, + 'family': AF_INET6}] + ) + else: + extra_routes.append( + ndb.routes[{'table': ovn_routing_tables[bridge], + 'dst': dst, + 'family': AF_INET}] + ) if route_missing: r = {'dst': 'default', 'oif': ndb.interfaces[bridge]['index'],