[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <58ed787f-a3b1-58d3-74a5-3a6e8c4c970a@linux.dev>
Date: Fri, 13 Oct 2023 09:54:35 -0700
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Stephen Rothwell <sfr@...b.auug.org.au>,
Daan De Meyer <daan.j.demeyer@...il.com>
Cc: bpf <bpf@...r.kernel.org>, Networking <netdev@...r.kernel.org>,
Martin KaFai Lau <martin.lau@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Next Mailing List <linux-next@...r.kernel.org>,
Daniel Borkmann <daniel@...earbox.net>, Alexei Starovoitov <ast@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>
Subject: Re: linux-next: build warning after merge of the bpf-next tree
On 10/12/23 10:30 PM, Stephen Rothwell wrote:
> Hi all,
>
> On Fri, 13 Oct 2023 11:40:07 +1100 Stephen Rothwell <sfr@...b.auug.org.au> wrote:
>>
>> After merging the bpf-next tree, today's linux-next build (arm
>> multi_v7_defconfig) produced this warning:
>>
>> net/ipv4/af_inet.c: In function 'inet_getname':
>> net/ipv4/af_inet.c:791:13: warning: unused variable 'sin_addr_len' [-Wunused-variable]
>> 791 | int sin_addr_len = sizeof(*sin);
>> | ^~~~~~~~~~~~
>>
>> Introduced by commit
>>
>> fefba7d1ae19 ("bpf: Propagate modified uaddrlen from cgroup sockaddr programs")
>
> This became a build failure for the i386 defconfig build, so I applied
> the following patch:
>
> From: Stephen Rothwell <sfr@...b.auug.org.au>
> Date: Fri, 13 Oct 2023 16:25:08 +1100
> Subject: [PATCH] fix up for "bpf: Propagate modified uaddrlen from cgroup sockaddr programs"
>
> Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
> ---
> net/ipv4/af_inet.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
> index 7e27ad37b939..0fcab6b6cb04 100644
> --- a/net/ipv4/af_inet.c
> +++ b/net/ipv4/af_inet.c
> @@ -788,7 +788,9 @@ int inet_getname(struct socket *sock, struct sockaddr *uaddr,
> struct sock *sk = sock->sk;
> struct inet_sock *inet = inet_sk(sk);
> DECLARE_SOCKADDR(struct sockaddr_in *, sin, uaddr);
> +#ifdef CONFIG_CGROUP_BPF
> int sin_addr_len = sizeof(*sin);
> +#endif
Thanks for the report and taking care of it.
Daan, something that was missed in ipv4 getname. It should be done similar to
inet6_getname() in af_inet6.c such that it "return sin_addr_len;" in this
function to avoid the compiler warning here in ipv4.
Powered by blists - more mailing lists