diff mbox series

[ovs-dev,v1,6/6] route-table: Store ifindex for received routes.

Message ID 70e6a78ce7bd152ccac6db99d49a532ed342f69f.1729784574.git.felix.huettner@stackit.cloud
State New
Delegated to: Eelco Chaudron
Headers show
Series OVS Patches for OVN Fabric Integration | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Felix Huettner Oct. 24, 2024, 3:46 p.m. UTC
Sometimes it is not easily possible to convert the interface index to a
name. Especially if we run in network namespaces.
To still be able to act on existing information we also return the
ifindex now.

Signed-off-by: Felix Huettner <felix.huettner@stackit.cloud>
---
 lib/route-table.c | 1 +
 lib/route-table.h | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/lib/route-table.c b/lib/route-table.c
index 80325f6f9..ce70382a4 100644
--- a/lib/route-table.c
+++ b/lib/route-table.c
@@ -228,6 +228,7 @@  route_table_add_nexthop(struct route_table_msg *change,
         }
     }
 
+    nh->ifindex = ifindex;
     if (ifindex && !if_indextoname(ifindex, nh->ifname)) {
         int error = errno;
 
diff --git a/lib/route-table.h b/lib/route-table.h
index f96dbebb3..bcc3205e8 100644
--- a/lib/route-table.h
+++ b/lib/route-table.h
@@ -30,6 +30,7 @@ 
 
 struct route_data_nexthop {
     struct in6_addr rta_gw;
+    uint32_t ifindex;
     char ifname[IFNAMSIZ]; /* Interface name. */
 };