From d9800efe48c13390d93557c4b5c3577fc6541418 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 11 Nov 2015 14:12:51 +0000 Subject: kernel: fix an af_packet regression that was breaking PPPoE on 4.1+ (#20707) Signed-off-by: Felix Fietkau git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47459 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../patches-4.1/103-packet_allow_empty_payload.patch | 17 +++++++++++++++++ .../patches-4.3/103-packet_allow_empty_payload.patch | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 target/linux/generic/patches-4.1/103-packet_allow_empty_payload.patch create mode 100644 target/linux/generic/patches-4.3/103-packet_allow_empty_payload.patch diff --git a/target/linux/generic/patches-4.1/103-packet_allow_empty_payload.patch b/target/linux/generic/patches-4.1/103-packet_allow_empty_payload.patch new file mode 100644 index 0000000000..052f457342 --- /dev/null +++ b/target/linux/generic/patches-4.1/103-packet_allow_empty_payload.patch @@ -0,0 +1,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 + +--- 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; diff --git a/target/linux/generic/patches-4.3/103-packet_allow_empty_payload.patch b/target/linux/generic/patches-4.3/103-packet_allow_empty_payload.patch new file mode 100644 index 0000000000..3e38bdfee2 --- /dev/null +++ b/target/linux/generic/patches-4.3/103-packet_allow_empty_payload.patch @@ -0,0 +1,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 + +--- a/net/packet/af_packet.c ++++ b/net/packet/af_packet.c +@@ -2323,7 +2323,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; -- cgit v1.2.3