From 91a44713bf414610246df57478b406a5561b725f Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Sat, 11 Jul 2020 15:51:47 +0200 Subject: Added support for VLAN in IPv6 Change-Id: Ib1b3d54f9cb8e4284eee7ed0998e96370762a17e Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/rx_pkt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'VNFs/DPPD-PROX/rx_pkt.c') diff --git a/VNFs/DPPD-PROX/rx_pkt.c b/VNFs/DPPD-PROX/rx_pkt.c index 1fd5ca85..e1756cb3 100644 --- a/VNFs/DPPD-PROX/rx_pkt.c +++ b/VNFs/DPPD-PROX/rx_pkt.c @@ -180,9 +180,11 @@ static inline int handle_l3(struct task_base *tbase, uint16_t nb_rx, struct rte_ static inline int handle_ndp(struct task_base *tbase, uint16_t nb_rx, struct rte_mbuf ***mbufs_ptr) { struct rte_mbuf **mbufs = *mbufs_ptr; + prox_rte_ipv6_hdr *ipv6_hdr; int i; prox_rte_ether_hdr *hdr[MAX_PKT_BURST]; int skip = 0; + uint16_t vlan = 0; for (i = 0; i < nb_rx; i++) { PREFETCH0(mbufs[i]); @@ -192,8 +194,8 @@ static inline int handle_ndp(struct task_base *tbase, uint16_t nb_rx, struct rte PREFETCH0(hdr[i]); } for (i = 0; i < nb_rx; i++) { - prox_rte_ipv6_hdr *ipv6_hdr = (prox_rte_ipv6_hdr *)(hdr[i] + 1); - if (unlikely((hdr[i]->ether_type == ETYPE_IPv6) && (ipv6_hdr->proto == ICMPv6))) { + ipv6_hdr = prox_get_ipv6_hdr(hdr[i], rte_pktmbuf_pkt_len(mbufs[i]), &vlan); + if (unlikely((ipv6_hdr) && (ipv6_hdr->proto == ICMPv6))) { dump_l3(tbase, mbufs[i]); tx_ring(tbase, tbase->l3.ctrl_plane_ring, NDP_PKT_FROM_NET_TO_MASTER, mbufs[i]); skip++; -- cgit 1.2.3-korg