aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ping.c
diff options
context:
space:
mode:
authorCong Wang <amwang@redhat.com>2013-06-02 18:43:52 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-04 19:58:42 -0400
commitc26d6b46da3ee86fa8a864347331e5513ca84c2b (patch)
tree0fe0308fbe1fc52dd8b870b464338a831ace6785 /net/ipv4/ping.c
parent430f03cde2fb9596d8b562824471e298a8080df9 (diff)
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: Cong Wang <amwang@redhat.com> Acked-by: Lorenzo Colitti <lorenzo@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ping.c')
-rw-r--r--net/ipv4/ping.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 3552a45a6f86..1f1b2dd90277 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -892,12 +892,12 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
892 sin6->sin6_port = 0; 892 sin6->sin6_port = 0;
893 sin6->sin6_addr = ip6->saddr; 893 sin6->sin6_addr = ip6->saddr;
894 894
895 sin6->sin6_flowinfo = 0;
895 if (np->sndflow) 896 if (np->sndflow)
896 sin6->sin6_flowinfo = ip6_flowinfo(ip6); 897 sin6->sin6_flowinfo = ip6_flowinfo(ip6);
897 898
898 if (__ipv6_addr_needs_scope_id( 899 sin6->sin6_scope_id = ipv6_iface_scope_id(&sin6->sin6_addr,
899 ipv6_addr_type(&sin6->sin6_addr))) 900 IP6CB(skb)->iif);
900 sin6->sin6_scope_id = IP6CB(skb)->iif;
901 901
902 if (inet6_sk(sk)->rxopt.all) 902 if (inet6_sk(sk)->rxopt.all)
903 pingv6_ops.ip6_datagram_recv_ctl(sk, msg, skb); 903 pingv6_ops.ip6_datagram_recv_ctl(sk, msg, skb);