kernel: fix an af_packet regression that was breaking PPPoE on 4.1+ (#20707)
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-4.1 / 103-packet_allow_empty_payload.patch
1 Fix a regression in the af_packet code that was breaking PPPoE
2
3 pppd sends packets with only a header and no payload.
4
5 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
6
7 --- a/net/packet/af_packet.c
8 +++ b/net/packet/af_packet.c
9 @@ -2106,7 +2106,7 @@ static void tpacket_destruct_skb(struct
10 static bool ll_header_truncated(const struct net_device *dev, int len)
11 {
12 /* net device doesn't like empty head */
13 - if (unlikely(len <= dev->hard_header_len)) {
14 + if (unlikely(len < dev->hard_header_len)) {
15 net_warn_ratelimited("%s: packet size is too short (%d <= %d)\n",
16 current->comm, len, dev->hard_header_len);
17 return true;