Skip to contentSkip to conversation

package/tailscale: enable missing kernel options

PATCH In review James Hilliard 2 participants 3 messages Oct 22

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/tailscale: enable missing kernel options

Enable NF_CONNTRACK_MARK and its NETFILTER_ADVANCED dependency for the nftables connection mark save/restore rules. Enable NFT_COUNTER for older kernels where counter support is separately configurable.

Enable the networking and TUN prerequisites, IPv4 policy routing and Unix domain sockets. Also enable procfs and its sysctl interface for IPv6 detection and network configuration.

Enable packet sockets for the TS_ENABLE_RAW_DISCO receiver.

Drop NF_TABLES_INET, since Tailscale uses separate IPv4 and IPv6 tables. NF_TABLES and NFT_NAT already select NETFILTER_NETLINK and NF_NAT, so remove those redundant fixups.

---
 package/tailscale/tailscale.mk | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
package/tailscale/tailscale.mk +13 -3
index ff4c68f0fd..950f9786ca 100644
@@ -30,20 +30,30 @@ TAILSCALE_POST_INSTALL_TARGET_HOOKS += TAILSCALE_INSTALL_SYMLINK
 endif
 
 define TAILSCALE_LINUX_CONFIG_FIXUPS
+	$(call KCONFIG_ENABLE_OPT,CONFIG_INET)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_IPV6)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_IPV6_MULTIPLE_TABLES)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_IP_ADVANCED_ROUTER)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_IP_MULTIPLE_TABLES)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_NET)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_NETDEVICES)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER)
-	$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_NETLINK)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_ADVANCED)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_NET_CORE)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_COUNTER)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_CT)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_MASQ)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_NAT)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_NF_CONNTRACK)
-	$(call KCONFIG_ENABLE_OPT,CONFIG_NF_NAT)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_NF_CONNTRACK_MARK)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_NF_TABLES)
-	$(call KCONFIG_ENABLE_OPT,CONFIG_NF_TABLES_INET)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_NF_TABLES_IPV4)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_NF_TABLES_IPV6)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_PACKET)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_PROC_FS)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_PROC_SYSCTL)
 	$(call KCONFIG_ENABLE_OPT,CONFIG_TUN)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_UNIX)
 endef
 
 $(eval $(golang-package))
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 package/tailscale: build with nftables only

The kernel configuration fixups enable nftables support, but do not enable the additional kernel options needed by legacy iptables. The package also does not select the iptables userspace tools.

Build with ts_omit_iptables so tailscaled uses its native nftables backend instead of potentially selecting iptables based on which tools happen to be installed. The nftables backend communicates directly with the kernel through Netlink and needs no external firewall tools.

---
 package/tailscale/tailscale.mk | 1 +
 1 file changed, 1 insertion(+)
package/tailscale/tailscale.mk +1 -0
index 950f9786ca..8ac2ae41da 100644
@@ -11,6 +11,7 @@ TAILSCALE_LICENSE_FILES = LICENSE
 TAILSCALE_GOMOD = tailscale.com
 TAILSCALE_CPE_ID_VENDOR = tailscale
 TAILSCALE_BUILD_TARGETS = cmd/tailscale cmd/tailscaled
+TAILSCALE_TAGS = ts_omit_iptables
 TAILSCALE_LDFLAGS = \
 	-X tailscale.com/version.longStamp=$(TAILSCALE_VERSION) \
 	-X tailscale.com/version.shortStamp=$(TAILSCALE_VERSION)
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to James Hilliard
Quoted 8 lines · James Hilliard

Enable NF_CONNTRACK_MARK and its NETFILTER_ADVANCED dependency for the nftables connection mark save/restore rules. Enable NFT_COUNTER for older kernels where counter support is separately configurable.

Enable the networking and TUN prerequisites, IPv4 policy routing and Unix domain sockets. Also enable procfs and its sysctl interface for IPv6 detection and network configuration.

Quoted 7 lines

Enable packet sockets for the TS_ENABLE_RAW_DISCO receiver.

Drop NF_TABLES_INET, since Tailscale uses separate IPv4 and IPv6 tables. NF_TABLES and NFT_NAT already select NETFILTER_NETLINK and NF_NAT, so remove those redundant fixups.

Both applied to master, thanks!

Best regards,

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot