summaryrefslogtreecommitdiff
path: root/drivers/ipoe/ipoe.c
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2026-07-06 13:05:57 +0300
committerGitHub <noreply@github.com>2026-07-06 13:05:57 +0300
commit6db993d970dff69fe73672d2ad64df9f39b498fc (patch)
tree380a24504011936bce2a769072b8a977c7687939 /drivers/ipoe/ipoe.c
parent5787a45a952c021f697b31abe0063013912d7c8b (diff)
parent6930d048efe7be06cd36e7413914be0bec4a45b5 (diff)
downloadaccel-ppp-6db993d970dff69fe73672d2ad64df9f39b498fc.tar.gz
accel-ppp-6db993d970dff69fe73672d2ad64df9f39b498fc.zip
Merge pull request #326 from nuclearcat/ipv6-disable-fix
ipoe: Fix OOPS if ipv6.disable=1
Diffstat (limited to 'drivers/ipoe/ipoe.c')
-rw-r--r--drivers/ipoe/ipoe.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index 4050011f..2829e6ac 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -15,6 +15,7 @@
#include <linux/init.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
+#include <linux/ipv6.h>
#include <linux/semaphore.h>
#include <linux/netfilter_ipv4.h>
#include <linux/u64_stats_sync.h>
@@ -61,6 +62,14 @@
#define RHEL_MAJOR 0
#endif
+/* ipv6.disable=1 leaves the IPv6 FIB uninitialized, so ip6_route_output()
+ * oopses; ipv6_mod_enabled() detects that (and CONFIG_IPV6=n) since 4.8 */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
+#define ipoe_ipv6_enabled() ipv6_mod_enabled()
+#else
+#define ipoe_ipv6_enabled() 1
+#endif
+
static inline void ipoe_flowi4_set_tos(struct flowi4 *fl4, __u8 dsfield)
{
#ifdef flowi4_dscp
@@ -890,6 +899,9 @@ static rx_handler_result_t ipoe_recv(struct sk_buff **pskb)
return RX_HANDLER_CONSUMED;
}
} else if (skb->protocol == htons(ETH_P_IPV6)) {
+ if (!ipoe_ipv6_enabled())
+ return RX_HANDLER_PASS;
+
if (!pskb_may_pull(skb, sizeof(*ip6h) + noff))
return RX_HANDLER_PASS;