Skip to content

Commit

Permalink
ip6: consider the last nh field for choosing the next node
Browse files Browse the repository at this point in the history
When there are extension headers, the IPv6 header nh field does not
point to the L4 protocol number but the extension header protocol
number.

Defer the selection of the next node after skipping over the extension
headers.

Fixes: 315e4e5 ("ip6: add basic icmp6 echo and reply support")
Signed-off-by: Robin Jarry <[email protected]>
Acked-by: Christophe Fontaine <[email protected]>
  • Loading branch information
rjarry committed Dec 17, 2024
1 parent f8e1424 commit 7135627
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/ip6/datapath/ip6_local.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ static uint16_t ip6_input_local_process(
m = objs[i];
ip = rte_pktmbuf_mtod(m, struct rte_ipv6_hdr *);

edge = edges[ip->proto];
if (edge == UNKNOWN_PROTO)
goto next;

// prepare ip local data
iface = ip6_output_mbuf_data(m)->iface;
d = ip6_local_mbuf_data(m);
Expand All @@ -71,6 +67,10 @@ static uint16_t ip6_input_local_process(
d->proto = next_proto;
};

edge = edges[d->proto];
if (edge == UNKNOWN_PROTO)
goto next;

// verify checksum if not already checked by hardware
switch (m->ol_flags & RTE_MBUF_F_RX_L4_CKSUM_MASK) {
case RTE_MBUF_F_RX_L4_CKSUM_NONE:
Expand Down

0 comments on commit 7135627

Please sign in to comment.