Commit 013b4d90 authored by WANG Cong's avatar WANG Cong Committed by David S. Miller

ipv6: clean up ipv6_dev_ac_inc()

Make it accept inet6_dev, and rename it to __ipv6_dev_ac_inc()
to reflect this change.
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b03a9c04
...@@ -202,7 +202,7 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex, ...@@ -202,7 +202,7 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex,
const struct in6_addr *addr); const struct in6_addr *addr);
void ipv6_sock_ac_close(struct sock *sk); void ipv6_sock_ac_close(struct sock *sk);
int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); int __ipv6_dev_ac_inc(struct inet6_dev *idev, const struct in6_addr *addr);
int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
const struct in6_addr *addr); const struct in6_addr *addr);
......
...@@ -1725,7 +1725,7 @@ static void addrconf_join_anycast(struct inet6_ifaddr *ifp) ...@@ -1725,7 +1725,7 @@ static void addrconf_join_anycast(struct inet6_ifaddr *ifp)
ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len); ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
if (ipv6_addr_any(&addr)) if (ipv6_addr_any(&addr))
return; return;
ipv6_dev_ac_inc(ifp->idev->dev, &addr); __ipv6_dev_ac_inc(ifp->idev, &addr);
} }
/* caller must hold RTNL */ /* caller must hold RTNL */
......
...@@ -122,7 +122,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr) ...@@ -122,7 +122,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
goto error; goto error;
} }
err = ipv6_dev_ac_inc(dev, addr); err = __ipv6_dev_ac_inc(idev, addr);
if (!err) { if (!err) {
pac->acl_next = np->ipv6_ac_list; pac->acl_next = np->ipv6_ac_list;
np->ipv6_ac_list = pac; np->ipv6_ac_list = pac;
...@@ -215,20 +215,15 @@ static void aca_put(struct ifacaddr6 *ac) ...@@ -215,20 +215,15 @@ static void aca_put(struct ifacaddr6 *ac)
/* /*
* device anycast group inc (add if not found) * device anycast group inc (add if not found)
*/ */
int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr) int __ipv6_dev_ac_inc(struct inet6_dev *idev, const struct in6_addr *addr)
{ {
struct ifacaddr6 *aca; struct ifacaddr6 *aca;
struct inet6_dev *idev;
struct rt6_info *rt; struct rt6_info *rt;
int err; int err;
ASSERT_RTNL(); ASSERT_RTNL();
idev = in6_dev_get(dev); in6_dev_hold(idev);
if (idev == NULL)
return -EINVAL;
write_lock_bh(&idev->lock); write_lock_bh(&idev->lock);
if (idev->dead) { if (idev->dead) {
err = -ENODEV; err = -ENODEV;
...@@ -276,7 +271,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr) ...@@ -276,7 +271,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr)
ip6_ins_rt(rt); ip6_ins_rt(rt);
addrconf_join_solict(dev, &aca->aca_addr); addrconf_join_solict(idev->dev, &aca->aca_addr);
aca_put(aca); aca_put(aca);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment