From: Vipin Varghese <vipin.varghese@intel.com>
To: dev@dpdk.org, ophirmu@mellanox.com
Cc: pascal.mazon@6wind.com, ferruh.yigit@intel.com,
Vipin Varghese <vipin.varghese@intel.com>
Subject: [dpdk-dev] [PATCH] net/tap: fix the protocol field for non ip
Date: Fri, 13 Apr 2018 11:28:47 +0530 [thread overview]
Message-ID: <1523599127-19424-1-git-send-email-vipin.varghese@intel.com> (raw)
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: 5a3efcfffd06 ("net/tap: add tun support")
Cc: vipin.varghese@intel.com
Suggested-by: Ophir Munk <ophirmu@mellanox.com>
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
---
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 915d937..66e026f 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -526,8 +526,8 @@ enum ioctl_mode {
*/
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);
--
1.9.1
next reply other threads:[~2018-04-13 5:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 5:58 Vipin Varghese [this message]
2018-04-17 17:45 ` Ferruh Yigit
2018-04-17 17:48 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1523599127-19424-1-git-send-email-vipin.varghese@intel.com \
--to=vipin.varghese@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=ophirmu@mellanox.com \
--cc=pascal.mazon@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).