diff --git a/package/lean/fast-classifier/Makefile b/package/lean/fast-classifier/Makefile index 2b02f1b64bb494..1ffced0a976245 100644 --- a/package/lean/fast-classifier/Makefile +++ b/package/lean/fast-classifier/Makefile @@ -49,7 +49,7 @@ Example user space program that communicates with fast classifier kernel module endef -SFE_MAKE_OPTS:=SFE_SUPPORT_IPV6=y +SFE_MAKE_OPTS:=SFE_SUPPORT_IPV6=n define Build/Compile/kmod +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" $(strip $(SFE_MAKE_OPTS)) \ diff --git a/package/lean/fast-classifier/src/fast-classifier.c b/package/lean/fast-classifier/src/fast-classifier.c index 19e2e6fadd8f34..cf3d7ae963f6af 100644 --- a/package/lean/fast-classifier/src/fast-classifier.c +++ b/package/lean/fast-classifier/src/fast-classifier.c @@ -346,11 +346,13 @@ static bool fast_classifier_find_dev_and_mac_addr(struct sk_buff *skb, sfe_ip_ad dst = (struct dst_entry *)rt; } else { +#ifdef SFE_SUPPORT_IPV6 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)) rt6 = rt6_lookup(&init_net, (struct in6_addr *)addr->ip6, 0, 0, NULL, 0); #else rt6 = rt6_lookup(&init_net, (struct in6_addr *)addr->ip6, 0, 0, 0); #endif /*KERNEL_VERSION(4, 17, 0)*/ +#endif if (!rt6) { goto ret_fail; } diff --git a/package/lean/shortcut-fe/Makefile b/package/lean/shortcut-fe/Makefile index 99017f3f591c56..19b7f333674411 100644 --- a/package/lean/shortcut-fe/Makefile +++ b/package/lean/shortcut-fe/Makefile @@ -19,13 +19,18 @@ PKG_RELEASE:=2 include $(INCLUDE_DIR)/package.mk +SFE_SUPPORT_IPV6=n define KernelPackage/shortcut-fe SECTION:=kernel CATEGORY:=Kernel modules SUBMENU:=Network Support DEPENDS:= TITLE:=Kernel driver for SFE +ifeq (${SFE_SUPPORT_IPV6},y) FILES:=$(PKG_BUILD_DIR)/shortcut-fe.ko $(PKG_BUILD_DIR)/shortcut-fe-ipv6.ko +else + FILES:=$(PKG_BUILD_DIR)/shortcut-fe.ko +endif KCONFIG:=CONFIG_NF_CONNTRACK_EVENTS=y \ CONFIG_NF_CONNTRACK_TIMEOUT=y \ CONFIG_SHORTCUT_FE=y \ @@ -58,7 +63,15 @@ define KernelPackage/shortcut-fe-cm/Description Simple connection manager for the Shortcut forwarding engine. endef -EXTRA_CFLAGS+=-DSFE_SUPPORT_IPV6 + +ifeq (${SFE_SUPPORT_IPV6},y) + EXTRA_CFLAGS+=-DSFE_SUPPORT_IPV6 + ISV6=SFE_SUPPORT_IPV6=1 +else + ISV6=SFE_SUPPORT_IPV6="" +endif + + define Build/Compile +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ @@ -66,7 +79,7 @@ define Build/Compile $(PKG_MAKE_FLAGS) \ M="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ - SFE_SUPPORT_IPV6=1 \ + ${ISV6} \ modules endef