diff mbox series

[RFC,net-next,01/20] net: export partial symbols in inet/inet6 proto_ops

Message ID 1708412505-34470-2-git-send-email-alibuda@linux.alibaba.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series Introduce IPPROTO_SMC | expand

Checks

Context Check Description
netdev/series_format fail Series longer than 15 patches (and no cover letter)
netdev/tree_selection success Clearly marked for net-next, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1028 this patch: 1028
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 1 maintainers not CCed: dsahern@kernel.org
netdev/build_clang success Errors and warnings before: 958 this patch: 958
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1045 this patch: 1045
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 38 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

D. Wythe Feb. 20, 2024, 7:01 a.m. UTC
From: "D. Wythe" <alibuda@linux.alibaba.com>

The following symbols have been exported here

1. inet_compat_ioctl
2. inet6_sendmsg
3. inet6_recvmsg

Exporting these symbols mainly provides the ability for other modules
to directly access these symbols. Currently, all symbols except those
above symbols are exported. So, there mighe be no obvious risk in
exporting these symbols.

Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
---
 include/net/inet_common.h | 3 +++
 net/ipv4/af_inet.c        | 3 ++-
 net/ipv6/af_inet6.c       | 2 ++
 3 files changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index f50a644..1c2fcca 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -57,6 +57,9 @@  int __inet_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len,
 int inet_getname(struct socket *sock, struct sockaddr *uaddr,
 		 int peer);
 int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
+#ifdef CONFIG_COMPAT
+int inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
+#endif
 int inet_ctl_sock_create(struct sock **sk, unsigned short family,
 			 unsigned short type, unsigned char protocol,
 			 struct net *net);
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index ad27800..049d135 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1031,7 +1031,7 @@  static int inet_compat_routing_ioctl(struct sock *sk, unsigned int cmd,
 	return ip_rt_ioctl(sock_net(sk), cmd, &rt);
 }
 
-static int inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
+int inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
 	void __user *argp = compat_ptr(arg);
 	struct sock *sk = sock->sk;
@@ -1046,6 +1046,7 @@  static int inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned lon
 		return sk->sk_prot->compat_ioctl(sk, cmd, arg);
 	}
 }
+EXPORT_SYMBOL_GPL(inet_compat_ioctl);
 #endif /* CONFIG_COMPAT */
 
 const struct proto_ops inet_stream_ops = {
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 959bfd9..5a81f8b 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -660,6 +660,7 @@  int inet6_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
 	return INDIRECT_CALL_2(prot->sendmsg, tcp_sendmsg, udpv6_sendmsg,
 			       sk, msg, size);
 }
+EXPORT_SYMBOL_GPL(inet6_sendmsg);
 
 INDIRECT_CALLABLE_DECLARE(int udpv6_recvmsg(struct sock *, struct msghdr *,
 					    size_t, int, int *));
@@ -682,6 +683,7 @@  int inet6_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
 		msg->msg_namelen = addr_len;
 	return err;
 }
+EXPORT_SYMBOL_GPL(inet6_recvmsg);
 
 const struct proto_ops inet6_stream_ops = {
 	.family		   = PF_INET6,