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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKWsCTYPzB4wuEWbU5sjABThsTBPtpoEcE4h=AfPQm40w@mail.gmail.com>
Date: Mon, 26 Aug 2024 10:30:50 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: jiping huang <huangjiping95@...com>
Cc: davem@...emloft.net, dsahern@...nel.org, kuba@...nel.org, 
	pabeni@...hat.com, netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: Remove a local variable with the same name as the parameter.

On Mon, Aug 26, 2024 at 9:42 AM jiping huang <huangjiping95@...com> wrote:
>
> There is no need to use an additional local avariable to get rtmsg.flags,
> and this variable has the same name as the function argument.
>
> Signed-off-by: jiping huang <huangjiping95@...com>
>
> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
> index f669da98d11d..0d69267c9971 100644
> --- a/net/ipv4/fib_semantics.c
> +++ b/net/ipv4/fib_semantics.c
> @@ -1830,12 +1830,10 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,
>
>         if (nhs == 1) {
>                 const struct fib_nh_common *nhc = fib_info_nhc(fi, 0);
> -               unsigned char flags = 0;
>
> -               if (fib_nexthop_info(skb, nhc, AF_INET, &flags, false) < 0)
> +               if (fib_nexthop_info(skb, nhc, AF_INET, &rtm->rtm_flags, false) < 0)
>                         goto nla_put_failure;
>
> -               rtm->rtm_flags = flags;
>  #ifdef CONFIG_IP_ROUTE_CLASSID
>                 if (nhc->nhc_family == AF_INET) {
>                         struct fib_nh *nh;

Wrong patch, please read fib_nexthop_info(), it does not clear *flags at entry.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ