Commit c26d6b46 authored by Cong Wang's avatar Cong Wang Committed by David S. Miller

ping: always initialize ->sin6_scope_id and ->sin6_flowinfo

If we don't need scope id, we should initialize it to zero.
Same for ->sin6_flowinfo.

Cc: Lorenzo Colitti <lorenzo@google.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: default avatarCong Wang <amwang@redhat.com>
Acked-by: default avatarLorenzo Colitti <lorenzo@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 430f03cd
...@@ -892,12 +892,12 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -892,12 +892,12 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
sin6->sin6_port = 0; sin6->sin6_port = 0;
sin6->sin6_addr = ip6->saddr; sin6->sin6_addr = ip6->saddr;
sin6->sin6_flowinfo = 0;
if (np->sndflow) if (np->sndflow)
sin6->sin6_flowinfo = ip6_flowinfo(ip6); sin6->sin6_flowinfo = ip6_flowinfo(ip6);
if (__ipv6_addr_needs_scope_id( sin6->sin6_scope_id = ipv6_iface_scope_id(&sin6->sin6_addr,
ipv6_addr_type(&sin6->sin6_addr))) IP6CB(skb)->iif);
sin6->sin6_scope_id = IP6CB(skb)->iif;
if (inet6_sk(sk)->rxopt.all) if (inet6_sk(sk)->rxopt.all)
pingv6_ops.ip6_datagram_recv_ctl(sk, msg, skb); pingv6_ops.ip6_datagram_recv_ctl(sk, msg, skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment