lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CANn89i+-T0iPKASSrHZvn4Cj4+UMYCpQWq5mg+Mc1hXsv_9BcQ@mail.gmail.com>
Date:   Tue, 21 Jun 2022 15:02:29 +0200
From:   Eric Dumazet <edumazet@...gle.com>
To:     kernel test robot <lkp@...el.com>
Cc:     netdev <netdev@...r.kernel.org>
Subject: Re: [linux-next:master 3790/4834] net/ipv6/raw.c:338:33: warning:
 variable 'daddr' set but not used

On Tue, Jun 21, 2022 at 2:42 PM kernel test robot <lkp@...el.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   34d1d36073ea4d4c532e8c8345627a9702be799e
> commit: ba44f8182ec299c5d1c8a72fc0fde4ec127b5a6d [3790/4834] raw: use more conventional iterators
> config: i386-randconfig-a012-20220620 (https://download.01.org/0day-ci/archive/20220621/202206212033.3lgl72Fw-lkp@intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project af6d2a0b6825e71965f3e2701a63c239fa0ad70f)
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ba44f8182ec299c5d1c8a72fc0fde4ec127b5a6d
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout ba44f8182ec299c5d1c8a72fc0fde4ec127b5a6d
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash net/ipv6/
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@...el.com>
>
> All warnings (new ones prefixed by >>):
>
> >> net/ipv6/raw.c:338:33: warning: variable 'daddr' set but not used [-Wunused-but-set-variable]
>            const struct in6_addr *saddr, *daddr;
>                                           ^
> >> net/ipv6/raw.c:338:25: warning: variable 'saddr' set but not used [-Wunused-but-set-variable]
>            const struct in6_addr *saddr, *daddr;
>                                   ^
>    2 warnings generated.
>

Yep, a cleanup is possible.

I will submit this when my workstation is up again.

diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 46b560aacc11352ee9f2043c277709c28f85e610..722de9dd0ff78fbb2535165935c92fe7d7e6a8c2
100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -332,7 +332,6 @@ static void rawv6_err(struct sock *sk, struct sk_buff *skb,
 void raw6_icmp_error(struct sk_buff *skb, int nexthdr,
                u8 type, u8 code, int inner_offset, __be32 info)
 {
-       const struct in6_addr *saddr, *daddr;
        struct net *net = dev_net(skb->dev);
        struct hlist_nulls_head *hlist;
        struct hlist_nulls_node *hnode;
@@ -345,8 +344,6 @@ void raw6_icmp_error(struct sk_buff *skb, int nexthdr,
        sk_nulls_for_each(sk, hnode, hlist) {
                /* Note: ipv6_hdr(skb) != skb->data */
                const struct ipv6hdr *ip6h = (const struct ipv6hdr *)skb->data;
-               saddr = &ip6h->saddr;
-               daddr = &ip6h->daddr;

                if (!raw_v6_match(net, sk, nexthdr, &ip6h->saddr, &ip6h->daddr,
                                  inet6_iif(skb), inet6_iif(skb)))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ