ipv6: use ipv6_addr_any() helper
Subsystems (3)
PATCH 1/1 ipv6: use ipv6_addr_any() helper
From: Cong Wang <[email protected]>
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 <[email protected]>
Cc Hideaki YOSHIFUJI <[email protected]>
Cc David S. Miller <[email protected]>
Signed-off-by Cong Wang <[email protected]>
---
net/ipv6/addrconf.c +3 -3
@@ -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;
Quoted 10 lines · Cong Wang
From: Cong Wang <[email protected]>
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 <[email protected]>Cc Hideaki YOSHIFUJI <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Cong Wang <[email protected]>
Acked-by Nicolas Dichtel <[email protected]>
From: Nicolas Dichtel <[email protected]>
Date: Wed, 22 May 2013 18:06:38 +0200
Quoted 6 lines · Cong Wang
Quoted 5 lines
From: Cong Wang <[email protected]>
ipv6_addr_any()is a faster way to determine if an addr is ipv6 any addr, no need to compute the addr type.
Quoted 6 lines
Quoted 5 lines
Cc Nicolas Dichtel <[email protected]>Cc Hideaki YOSHIFUJI <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Cong Wang <[email protected]>Acked-by Nicolas Dichtel <[email protected]>
Applied.