From 957b425300940d0db4153d461a47c4887b2e0804 Mon Sep 17 00:00:00 2001 From: Christophe Fontaine Date: Fri, 20 Dec 2024 10:53:57 +0000 Subject: [PATCH] ip6: fix iface output for multicast destination The returned nexthop for a multicast route lookup doesn't have a defined iface. Yet, this nexthop is valid, and we can rely on the iface defined by the parent node to select the output iface. Signed-off-by: Christophe Fontaine --- modules/ip6/datapath/ip6_output.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ip6/datapath/ip6_output.c b/modules/ip6/datapath/ip6_output.c index 9362c50a..3ab0f404 100644 --- a/modules/ip6/datapath/ip6_output.c +++ b/modules/ip6/datapath/ip6_output.c @@ -57,7 +57,12 @@ ip6_output_process(struct rte_graph *graph, struct rte_node *node, void **objs, edge = DEST_UNREACH; goto next; } - iface = iface_from_id(nh->iface_id); + + // For multicast destination, nh->iface will be NULL + if (rte_ipv6_addr_is_mcast(&ip->dst_addr)) + iface = mbuf_data(mbuf)->iface; + else + iface = iface_from_id(nh->iface_id); if (iface == NULL) { edge = ERROR; goto next;