Re: [PATCH] bpf: Fix bpf_get/setsockopt to tos not take effect when TCP over IPv4 via INET6 API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2024-08-14, 16:45:04 +0800, Feng zhou wrote:
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 78a6f746ea0b..9798537044be 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -5399,7 +5399,7 @@ static int sol_ip_sockopt(struct sock *sk, int optname,
>  			  char *optval, int *optlen,
>  			  bool getopt)
>  {
> -	if (sk->sk_family != AF_INET)
> +	if (sk->sk_family != AF_INET && !is_tcp_sock_ipv6_mapped(sk))
>  		return -EINVAL;

I don't think this works when CONFIG_IPV6=m, because then
is_tcp_sock_ipv6_mapped will be part of the module and not usable in
net/core/filter.c. Stuff like this is usually done through ipv6_stub.

-- 
Sabrina





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux