ping: always initialize ->sin6_scope_id and ->sin6_flowinfo
Subsystems (2)
PATCH v2 1/1 ping: always initialize ->sin6_scope_id and ->sin6_flowinfo
From: Cong Wang <[email protected]>
If we don't need scope id, we should initialize it to zero. Same for ->sin6_flowinfo.
Cc Lorenzo Colitti <[email protected]>
Cc David S. Miller <[email protected]>
Signed-off-by Cong Wang <[email protected]>
--- net/ipv4/ping.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
net/ipv4/ping.c +3 -3
@@ -892,12 +892,12 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, sin6->sin6_port =0 ; sin6->sin6_addr = ip6->saddr; + sin6->sin6_flowinfo =0 ;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);
Quoted 22 lines · Cong Wang
From: Cong Wang <[email protected]>
If we don't need scope id, we should initialize it to zero. Same for ->sin6_flowinfo.
Cc Lorenzo Colitti <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Cong Wang <[email protected]>--- net/ipv4/ping.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)net/ipv4/ping.c +1
-0@@ -892,12 +892,12 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, sin6->sin6_port =0 ; sin6->sin6_addr = ip6->saddr; + sin6->sin6_flowinfo =0 ;if (np->sndflow)
net/ipv4/ping.c int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, · line 903
Quoted 10 lines
net/ipv4/ping.c +2
-3sin6->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);
Acked-by Lorenzo Colitti <[email protected]>
From: Lorenzo Colitti <[email protected]>
Date: Mon, 3 Jun 2013 18:25:39 +0900
Quoted 9 lines · Cong Wang
Quoted 8 lines
From: Cong Wang <[email protected]>
If we don't need scope id, we should initialize it to zero. Same for ->sin6_flowinfo.
Cc Lorenzo Colitti <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Cong Wang <[email protected]>
...
Quoted 1 line
Acked-by Lorenzo Colitti <[email protected]>
Applied, thanks.