Skip to content

Commit 89683b4

Browse files
edumazetkuba-moo
authored andcommitted
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. Signed-off-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9ceebd7 commit 89683b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ipv6/ipv6_sockglue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval,
985985
int err;
986986

987987
if (level == SOL_IP && sk->sk_type != SOCK_RAW)
988-
return udp_prot.setsockopt(sk, level, optname, optval, optlen);
988+
return ip_setsockopt(sk, level, optname, optval, optlen);
989989

990990
if (level != SOL_IPV6)
991991
return -ENOPROTOOPT;
@@ -1475,7 +1475,7 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname,
14751475
int err;
14761476

14771477
if (level == SOL_IP && sk->sk_type != SOCK_RAW)
1478-
return udp_prot.getsockopt(sk, level, optname, optval, optlen);
1478+
return ip_getsockopt(sk, level, optname, optval, optlen);
14791479

14801480
if (level != SOL_IPV6)
14811481
return -ENOPROTOOPT;

0 commit comments

Comments
 (0)