From 8055b534d69063131f94cec6644f30dcaa9bc4e4 Mon Sep 17 00:00:00 2001 From: Vipin Varghese Date: Fri, 13 Apr 2018 11:28:47 +0530 Subject: [PATCH] net/tap: fix protocol field for non-IP When non IP packets are sent on TUN interface, the logic put Ipv6 as protocol field in header. With the current patch, the check is modified for ipv4, ipv6 and non ip. Fixes: 204d026a3922 ("net/tap: support tun") Suggested-by: Ophir Munk Signed-off-by: Vipin Varghese Reviewed-by: Ferruh Yigit --- drivers/net/tap/rte_eth_tap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index cca5852cc3..8bea2662ce 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -526,8 +526,8 @@ pmd_tx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) */ char *buff_data = rte_pktmbuf_mtod(seg, void *); j = (*buff_data & 0xf0); - if (j & (0x40 | 0x60)) - pi.proto = (j == 0x40) ? 0x0008 : 0xdd86; + pi.proto = (j == 0x40) ? 0x0008 : + (j == 0x60) ? 0xdd86 : 0x00; iovecs[0].iov_base = π iovecs[0].iov_len = sizeof(pi); -- 2.20.1