When there is invalid table_id being set for vrf the ovn-controller
would be woken up immediately to retry. However, this is not
a recoverable error that could be fixed by retry. Make sure we
don't loop and retry again once the table_id has changed.

Fixes: faf4df563f1d ("controller: Announce routes via route-exchange.")
Reported-at: https://issues.redhat.com/browse/FDP-1879
Signed-off-by: Ales Musil <[email protected]>
---
 controller/route-exchange-netlink.c | 6 ------
 controller/route-exchange-netlink.h | 7 +++++++
 controller/route-exchange.c         | 6 ++++++
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/controller/route-exchange-netlink.c 
b/controller/route-exchange-netlink.c
index 91f059492..4ea29dc35 100644
--- a/controller/route-exchange-netlink.c
+++ b/controller/route-exchange-netlink.c
@@ -38,12 +38,6 @@
 VLOG_DEFINE_THIS_MODULE(route_exchange_netlink);
 
 #define NETNL_REQ_BUFFER_SIZE 128
-#define TABLE_ID_VALID(table_id) (table_id != RT_TABLE_UNSPEC &&              \
-                                  table_id != RT_TABLE_COMPAT &&              \
-                                  table_id != RT_TABLE_DEFAULT &&             \
-                                  table_id != RT_TABLE_MAIN &&                \
-                                  table_id != RT_TABLE_LOCAL &&               \
-                                  table_id != RT_TABLE_MAX)
 
 int
 re_nl_create_vrf(const char *ifname, uint32_t table_id)
diff --git a/controller/route-exchange-netlink.h 
b/controller/route-exchange-netlink.h
index c9fce692b..f04393eee 100644
--- a/controller/route-exchange-netlink.h
+++ b/controller/route-exchange-netlink.h
@@ -28,6 +28,13 @@
 #define RTPROT_OVN 84
 #endif
 
+#define TABLE_ID_VALID(table_id) (table_id != RT_TABLE_UNSPEC &&              \
+                                  table_id != RT_TABLE_COMPAT &&              \
+                                  table_id != RT_TABLE_DEFAULT &&             \
+                                  table_id != RT_TABLE_MAIN &&                \
+                                  table_id != RT_TABLE_LOCAL &&               \
+                                  table_id != RT_TABLE_MAX)
+
 struct in6_addr;
 struct hmap;
 struct vector;
diff --git a/controller/route-exchange.c b/controller/route-exchange.c
index 7eb9c8c31..6e793fd13 100644
--- a/controller/route-exchange.c
+++ b/controller/route-exchange.c
@@ -244,6 +244,12 @@ route_exchange_run(const struct route_exchange_ctx_in 
*r_ctx_in,
     const struct advertise_datapath_entry *ad;
     HMAP_FOR_EACH (ad, node, r_ctx_in->announce_routes) {
         uint32_t table_id = route_get_table_id(ad->db);
+        if (!TABLE_ID_VALID(table_id)) {
+            VLOG_WARN_RL(&rl, "Unable to sync routes for datapath "UUID_FMT": "
+                              "invalid table id: %"PRIu32,
+                              UUID_ARGS(&ad->db->header_.uuid), table_id);
+            continue;
+        }
 
         if (ad->maintain_vrf) {
             if (!sset_contains(&old_maintained_vrfs, ad->vrf_name)) {
-- 
2.51.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to