summaryrefslogtreecommitdiff
path: root/target/linux/generic/patches-4.1/103-packet_allow_empty_payload.patch
blob: 052f457342e409ac351da729527acb227d9e7ca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Fix a regression in the af_packet code that was breaking PPPoE

pppd sends packets with only a header and no payload.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2106,7 +2106,7 @@ static void tpacket_destruct_skb(struct
 static bool ll_header_truncated(const struct net_device *dev, int len)
 {
 	/* net device doesn't like empty head */
-	if (unlikely(len <= dev->hard_header_len)) {
+	if (unlikely(len < dev->hard_header_len)) {
 		net_warn_ratelimited("%s: packet size is too short (%d <= %d)\n",
 				     current->comm, len, dev->hard_header_len);
 		return true;