All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch net-next] ipv6: use ipv6_addr_any() helper
@ 2013-05-22 15:41 Cong Wang
  2013-05-22 16:06 ` Nicolas Dichtel
  0 siblings, 1 reply; 3+ messages in thread
From: Cong Wang @ 2013-05-22 15:41 UTC (permalink / raw)
  To: netdev; +Cc: Nicolas Dichtel, Hideaki YOSHIFUJI, David S. Miller, Cong Wang

From: Cong Wang <xiyou.wangcong@gmail.com>

ipv6_addr_any() is a faster way to determine if an addr
is ipv6 any addr, no need to compute the addr type.

Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

---
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d684d23..e052696 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3846,7 +3846,7 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
 		valid = INFINITY_LIFE_TIME;
 	}
 
-	if (ipv6_addr_type(&ifa->peer_addr) != IPV6_ADDR_ANY) {
+	if (!ipv6_addr_any(&ifa->peer_addr)) {
 		if (nla_put(skb, IFA_LOCAL, 16, &ifa->addr) < 0 ||
 		    nla_put(skb, IFA_ADDRESS, 16, &ifa->peer_addr) < 0)
 			goto error;
@@ -4579,7 +4579,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
 			ip6_ins_rt(ifp->rt);
 		if (ifp->idev->cnf.forwarding)
 			addrconf_join_anycast(ifp);
-		if (ipv6_addr_type(&ifp->peer_addr) != IPV6_ADDR_ANY)
+		if (!ipv6_addr_any(&ifp->peer_addr))
 			addrconf_prefix_route(&ifp->peer_addr, 128,
 					      ifp->idev->dev, 0, 0);
 		break;
@@ -4587,7 +4587,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
 		if (ifp->idev->cnf.forwarding)
 			addrconf_leave_anycast(ifp);
 		addrconf_leave_solict(ifp->idev, &ifp->addr);
-		if (ipv6_addr_type(&ifp->peer_addr) != IPV6_ADDR_ANY) {
+		if (!ipv6_addr_any(&ifp->peer_addr)) {
 			struct rt6_info *rt;
 			struct net_device *dev = ifp->idev->dev;
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch net-next] ipv6: use ipv6_addr_any() helper
  2013-05-22 15:41 [Patch net-next] ipv6: use ipv6_addr_any() helper Cong Wang
@ 2013-05-22 16:06 ` Nicolas Dichtel
  2013-05-23  8:18   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Dichtel @ 2013-05-22 16:06 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, Hideaki YOSHIFUJI, David S. Miller

Le 22/05/2013 17:41, Cong Wang a écrit :
> From: Cong Wang <xiyou.wangcong@gmail.com>
>
> ipv6_addr_any() is a faster way to determine if an addr
> is ipv6 any addr, no need to compute the addr type.
>
> Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch net-next] ipv6: use ipv6_addr_any() helper
  2013-05-22 16:06 ` Nicolas Dichtel
@ 2013-05-23  8:18   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-05-23  8:18 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: xiyou.wangcong, netdev, yoshfuji

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 22 May 2013 18:06:38 +0200

> Le 22/05/2013 17:41, Cong Wang a écrit :
>> From: Cong Wang <xiyou.wangcong@gmail.com>
>>
>> ipv6_addr_any() is a faster way to determine if an addr
>> is ipv6 any addr, no need to compute the addr type.
>>
>> Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
>> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
>> Cc: David S. Miller <davem@davemloft.net>
>> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>>
> Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-23  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 15:41 [Patch net-next] ipv6: use ipv6_addr_any() helper Cong Wang
2013-05-22 16:06 ` Nicolas Dichtel
2013-05-23  8:18   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.