From 31ce99e0d3d518572b930d392baffb2d5afa7d7a Mon Sep 17 00:00:00 2001 From: "Anand H. Krishnan" Date: Thu, 31 Mar 2016 11:07:14 +0530 Subject: [PATCH] Set skb network header for non-tunneled packets When somebody does a tcpdump or an equivalent operation of listening on an interface for all protocol packets, linux kernel prints protocol xyz is buggy if the network header is positioned at an offset that is not sane, for e.g.: network header offset is lesser than the data offset (which is where the data starts). vRouter is not setting network header offsets for packets that don't undergo GRO or for non-tunnel packets. If such packets egress an interface and if a tcpdump like application is running on that interface, then we will see this issue. Set skb network header to packet network header for such packets Change-Id: I82f7550722798e53c94092788b5135603f6045c8 Closes-BUG: #1564242 --- linux/vr_host_interface.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux/vr_host_interface.c b/linux/vr_host_interface.c index 16f77f2c1..e618ae983 100644 --- a/linux/vr_host_interface.c +++ b/linux/vr_host_interface.c @@ -846,6 +846,12 @@ linux_if_tx(struct vr_interface *vif, struct vr_packet *pkt) } } } + } else { + network_off = pkt_get_network_header_off(pkt); + if (network_off) { + skb_set_network_header(skb, (network_off - skb_headroom(skb))); + skb_reset_mac_len(skb); + } } linux_xmit_segment(vif, skb, pkt->vp_type);