]> git.baikalelectronics.ru Git - kernel.git/commit
ip_gre: check packet length and mtu correctly in erspan_xmit
authorXin Long <lucien.xin@gmail.com>
Sun, 1 Oct 2017 14:00:54 +0000 (22:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Oct 2017 05:30:32 +0000 (22:30 -0700)
commit78f95724688403f56d7b30aab8efdcff7abd742c
tree45892f8a4f18640551475f209b5d4aaad7c02966
parent1b63099afb1e9f65797563d8cb5e8883570ef5c9
ip_gre: check packet length and mtu correctly in erspan_xmit

As a ARPHRD_ETHER device, skb->len in erspan_xmit is the length
of the whole ether packet. So before checking if a packet size
exceeds the mtu, skb->len should subtract dev->hard_header_len.

Otherwise, all packets with max size according to mtu would be
trimmed to be truncated packet.

Fixes: 468dae257e70 ("gre: introduce native tunnel support for ERSPAN")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_gre.c