Skip to content

Commit

Permalink
Set skb network header for non-tunneled packets
Browse files Browse the repository at this point in the history
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
  • Loading branch information
anandhk-juniper committed Apr 7, 2016
1 parent ff52886 commit 02f49b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions linux/vr_host_interface.c
Expand Up @@ -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);
Expand Down

0 comments on commit 02f49b2

Please sign in to comment.