diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 3695a1802ea6939e6495963ab188468296dac279..d4d611064a76f587217ac5b51b91d5df7814758e 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h @@ -82,9 +82,6 @@ struct inet_bind_bucket { kuid_t fastuid; #if IS_ENABLED(CONFIG_IPV6) struct in6_addr fast_v6_rcv_saddr; -#endif -#if IS_ENABLED(CONFIG_NEWIP) - struct nip_addr fast_nip_rcv_saddr; #endif __be32 fast_rcv_saddr; unsigned short fast_sk_family; diff --git a/net/Kconfig b/net/Kconfig index d6567162c1cfcf3d36ae4a32c57026a81ecfd4f0..c0638ea8a56033b7bb49785a1da6155e678a7f8e 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -459,6 +459,14 @@ config ETHTOOL_NETLINK netlink. It provides better extensibility and some new features, e.g. notification messages. +# The Kconfig file is inserted when the "linux-5.10\net\" directory +# adds a separate warehouse module. The content of the Kconfig file +# of the new module is added to this file to avoid downloading the +# kernel repository separately. When the kernel repository is not downloaded, +# an error message is displayed indicating that the Kconfig file of the new +# module cannot be found. +source "net/net_hooks/Kconfig" + endif # if NET # Used by archs to tell that they support BPF JIT compiler plus which flavour. diff --git a/net/Makefile b/net/Makefile index b02730775923eae5b8d87e7bbf96dd3bba13d7b5..37513c69bcfb90971c3a7627f3349561cadd74fd 100644 --- a/net/Makefile +++ b/net/Makefile @@ -20,9 +20,6 @@ obj-$(CONFIG_TLS) += tls/ obj-$(CONFIG_XFRM) += xfrm/ obj-$(CONFIG_UNIX_SCM) += unix/ obj-$(CONFIG_NET) += ipv6/ -ifeq ($(CONFIG_NEWIP),y) -obj-$(CONFIG_NET) += newip/ -endif obj-$(CONFIG_BPFILTER) += bpfilter/ obj-$(CONFIG_PACKET) += packet/ obj-$(CONFIG_NET_KEY) += key/ @@ -91,3 +88,11 @@ obj-$(CONFIG_QRTR) += qrtr/ obj-$(CONFIG_NET_NCSI) += ncsi/ obj-$(CONFIG_XDP_SOCKETS) += xdp/ obj-$(CONFIG_MPTCP) += mptcp/ + +# The Makefile file is inserted when the "linux-5.10\net\" directory +# adds a separate warehouse module. The content of the Makefile file +# of the new module is added to this file to avoid downloading the +# kernel repository separately. When the kernel repository is not downloaded, +# an error message is displayed indicating that the Makefile file of the new +# module cannot be found. +obj-$(CONFIG_NET) += net_hooks/ diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index f359192a4632b69f5a4a4ef714212b6fea6f04ae..dbf0725d910f4f37c7cdea37ce0f7a835915fa08 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c @@ -22,9 +22,6 @@ #include #include #include -#if IS_ENABLED(CONFIG_NEWIP) -#include -#endif #if IS_ENABLED(CONFIG_IPV6) /* match_sk*_wildcard == true: IPV6_ADDR_ANY equals to any IPv6 addresses @@ -106,15 +103,6 @@ bool inet_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2, match_wildcard); #endif -#if IS_ENABLED(CONFIG_NEWIP) - if (sk->sk_family == AF_NINET) - return nip_rcv_saddr_equal(&sk->sk_nip_rcv_saddr, - &sk2->sk_nip_rcv_saddr, - sk2->sk_family == AF_NINET, - match_wildcard, - match_wildcard); -#endif - return ipv4_rcv_saddr_equal(sk->sk_rcv_saddr, sk2->sk_rcv_saddr, ipv6_only_sock(sk2), match_wildcard, match_wildcard); @@ -304,13 +292,6 @@ static inline int sk_reuseport_match(struct inet_bind_bucket *tb, sk->sk_rcv_saddr, tb->fast_ipv6_only, ipv6_only_sock(sk), true, false); -#endif -#if IS_ENABLED(CONFIG_NEWIP) - if (tb->fast_sk_family == AF_NINET) - return nip_rcv_saddr_equal(&tb->fast_nip_rcv_saddr, - &sk->sk_nip_rcv_saddr, - sk->sk_family == AF_NINET, - true, false); #endif return ipv4_rcv_saddr_equal(tb->fast_rcv_saddr, sk->sk_rcv_saddr, ipv6_only_sock(sk), true, false); @@ -332,9 +313,6 @@ void inet_csk_update_fastreuse(struct inet_bind_bucket *tb, tb->fast_sk_family = sk->sk_family; #if IS_ENABLED(CONFIG_IPV6) tb->fast_v6_rcv_saddr = sk->sk_v6_rcv_saddr; -#endif -#if IS_ENABLED(CONFIG_NEWIP) - tb->fast_nip_rcv_saddr = sk->sk_nip_rcv_saddr; #endif } else { tb->fastreuseport = 0; @@ -362,9 +340,6 @@ void inet_csk_update_fastreuse(struct inet_bind_bucket *tb, tb->fast_sk_family = sk->sk_family; #if IS_ENABLED(CONFIG_IPV6) tb->fast_v6_rcv_saddr = sk->sk_v6_rcv_saddr; -#endif -#if IS_ENABLED(CONFIG_NEWIP) - tb->fast_nip_rcv_saddr = sk->sk_nip_rcv_saddr; #endif } } else { diff --git a/net/net_hooks/Kconfig b/net/net_hooks/Kconfig new file mode 100644 index 0000000000000000000000000000000000000000..dd37b6bca6a064701566fa1d13d99b4830e109ee --- /dev/null +++ b/net/net_hooks/Kconfig @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (c) 2022 Huawei Device Co., Ltd. +# +# The Kconfig file is inserted when the "linux-5.10\net\" directory +# adds a separate warehouse module. The content of the Kconfig file +# of the new module is added to this file to avoid downloading the +# kernel repository separately. When the kernel repository is not downloaded, +# an error message is displayed indicating that the Kconfig file of the new +# module cannot be found. +# + +# NewIP as module will cause a CRASH if you try to unload it +# net/newip +menuconfig NEWIP + bool "The NewIP protocol" + depends on INET + default n + help + Support for NewIP. + +if NEWIP +config NEWIP_HOOKS + bool "NewIP Hooks" + depends on VENDOR_HOOKS && NEWIP + default n + help + Enable NewIP hooks implemented as tracepoints + Allow NewIP modules to attach to tracepoint "hooks" defined via + DECLARE_TRACE or DECLARE_HOOK + +config NEWIP_FAST_KEEPALIVE + bool "NewIP fast keepalive" + default n + help + Support for NewIP fast keepalive. + +endif # NEWIP + diff --git a/net/net_hooks/Makefile b/net/net_hooks/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..f74fc2d253839758b34de9d62bef5d0ed9326033 --- /dev/null +++ b/net/net_hooks/Makefile @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# The Makefile file is inserted when the "linux-5.10\net\" directory +# adds a separate warehouse module. The content of the Makefile file +# of the new module is added to this file to avoid downloading the +# kernel repository separately. When the kernel repository is not downloaded, +# an error message is displayed indicating that the Makefile file of the new +# module cannot be found. + +# net/newip/hooks/Makefile +ifeq ($(CONFIG_NEWIP_HOOKS),y) +obj-$(CONFIG_NET) += ../newip/hooks/ +endif + +# net/newip/Makefile +ifeq ($(CONFIG_NEWIP),y) +obj-$(CONFIG_NET) += ../newip/ +endif