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: <CAKD1Yr1gSjGq-G-G_YLgpUNTy5P8H-OD+rnqLCyW18mVB_bGDg@mail.gmail.com>
Date:	Mon, 3 Jun 2013 16:59:58 +0900
From:	Lorenzo Colitti <lorenzo@...gle.com>
To:	Cong Wang <amwang@...hat.com>
Cc:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: [Patch net-next 2/2] ping: use ipv6_iface_scope_id() to get scope id

On Mon, Jun 3, 2013 at 2:55 PM, Cong Wang <amwang@...hat.com> wrote:
> From: Cong Wang <amwang@...hat.com>
>
> If we don't need scope id, we should initialize it to zero.
>
> Cc: Lorenzo Colitti <lorenzo@...gle.com>
> Cc: David S. Miller <davem@...emloft.net>
> Signed-off-by: Cong Wang <amwang@...hat.com>
> ---
>  net/ipv4/ping.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
> index 8c92781..b1993b3 100644
> --- a/net/ipv4/ping.c
> +++ b/net/ipv4/ping.c
> @@ -905,9 +905,8 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
>                 if (np->sndflow)
>                         sin6->sin6_flowinfo = ip6_flowinfo(ip6);
>
> -               if (__ipv6_addr_needs_scope_id(
> -                   ipv6_addr_type(&sin6->sin6_addr)))
> -                       sin6->sin6_scope_id = IP6CB(skb)->iif;
> +               sin6->sin6_scope_id = ipv6_iface_scope_id(&sin6->sin6_addr,
> +                                                         IP6CB(skb)->iif);
>
>                 if (inet6_sk(sk)->rxopt.all)
>                         pingv6_ops.ip6_datagram_recv_ctl(sk, msg, skb);
> --
> 1.7.7.6
>

Good catch, thanks. While you're at it - if np->sndflow is false,
sin6_flowinfo is not being initialized either. Care to fix that too?
The other functions do this like this:

sin->sin6_flowinfo = 0;
if (np->sndflow)
        sin6->sin6_flowinfo = ip6_flowinfo(ip6);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ