Skip to contentSkip to conversation

ipv6: avoid indirect calls for SOL_IP socket options

PATCH Applied Eric Dumazet 2 participants 2 messages Aug 23, 2024 – Aug 26, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: avoid indirect calls for SOL_IP socket options

ipv6_setsockopt() can directly call ip_setsockopt() instead of going through udp_prot.setsockopt()

ipv6_getsockopt() can directly call ip_getsockopt() instead of going through udp_prot.getsockopt()

These indirections predate git history, not sure why they were there.

---
 net/ipv6/ipv6_sockglue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/ipv6_sockglue.c +2 -2
index cd342d5015c6fb36bd03d4f3fcae4a3995ff6097..1e225e6489ea150c641ed0757083591def08dfc1 100644
@@ -985,7 +985,7 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval,
 	int err;
 
 	if (level == SOL_IP && sk->sk_type != SOCK_RAW)
-		return udp_prot.setsockopt(sk, level, optname, optval, optlen);
+		return ip_setsockopt(sk, level, optname, optval, optlen);
 
 	if (level != SOL_IPV6)
 		return -ENOPROTOOPT;
@@ -1475,7 +1475,7 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname,
 	int err;
 
 	if (level == SOL_IP && sk->sk_type != SOCK_RAW)
-		return udp_prot.getsockopt(sk, level, optname, optval, optlen);
+		return ip_getsockopt(sk, level, optname, optval, optlen);
 
 	if (level != SOL_IPV6)
 		return -ENOPROTOOPT;
Signature · 1 line
2.46.0.295.g3b9ea8a38a-goog
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Fri, 23 Aug 2024 14:00:19 +0000 you wrote:

ipv6_setsockopt() can directly call ip_setsockopt() instead of going through udp_prot.setsockopt()

ipv6_getsockopt() can directly call ip_getsockopt() instead of going through udp_prot.getsockopt()

These indirections predate git history, not sure why they were there.

[...]

Here is the summary with links:
- [net] ipv6: avoid indirect calls for SOL_IP socket options

    https://git.kernel.org/netdev/net-next/c/89683b45f15c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html