* [Patch net-next v2] ping: always initialize ->sin6_scope_id and ->sin6_flowinfo
@ 2013-06-03 8:43 Cong Wang
2013-06-03 9:25 ` Lorenzo Colitti
0 siblings, 1 reply; 3+ messages in thread
From: Cong Wang @ 2013-06-03 8:43 UTC (permalink / raw)
To: netdev; +Cc: Lorenzo Colitti, David S. Miller, Cong Wang
From: Cong Wang <amwang@redhat.com>
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>
---
net/ipv4/ping.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 71f6ad0..0f419a2 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,
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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Patch net-next v2] ping: always initialize ->sin6_scope_id and ->sin6_flowinfo
2013-06-03 8:43 [Patch net-next v2] ping: always initialize ->sin6_scope_id and ->sin6_flowinfo Cong Wang
@ 2013-06-03 9:25 ` Lorenzo Colitti
2013-06-04 23:59 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Lorenzo Colitti @ 2013-06-03 9:25 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev@vger.kernel.org, David S. Miller
On Mon, Jun 3, 2013 at 5:43 PM, Cong Wang <amwang@redhat.com> wrote:
> From: Cong Wang <amwang@redhat.com>
>
> 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>
> ---
> net/ipv4/ping.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
> index 71f6ad0..0f419a2 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,
> 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);
Acked-by: Lorenzo Colitti <lorenzo@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch net-next v2] ping: always initialize ->sin6_scope_id and ->sin6_flowinfo
2013-06-03 9:25 ` Lorenzo Colitti
@ 2013-06-04 23:59 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-06-04 23:59 UTC (permalink / raw)
To: lorenzo; +Cc: amwang, netdev
From: Lorenzo Colitti <lorenzo@google.com>
Date: Mon, 3 Jun 2013 18:25:39 +0900
> On Mon, Jun 3, 2013 at 5:43 PM, Cong Wang <amwang@redhat.com> wrote:
>> From: Cong Wang <amwang@redhat.com>
>>
>> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-04 23:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03 8:43 [Patch net-next v2] ping: always initialize ->sin6_scope_id and ->sin6_flowinfo Cong Wang
2013-06-03 9:25 ` Lorenzo Colitti
2013-06-04 23:59 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).