Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134317
b: refs/heads/master
c: b5f348e
h: refs/heads/master
i:
  134315: 9bbe34e
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Feb 7, 2009
1 parent 65b9d85 commit 63991dd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d73f08011bc30c03a2bcb1ccd880e4be84aea269
refs/heads/master: b5f348e5a41b39543c1c5efd661d7fd296dd5281
45 changes: 18 additions & 27 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2224,10 +2224,24 @@ int addrconf_del_ifaddr(struct net *net, void __user *arg)
return err;
}

static void add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
int plen, int scope)
{
struct inet6_ifaddr *ifp;

ifp = ipv6_add_addr(idev, addr, plen, scope, IFA_F_PERMANENT);
if (!IS_ERR(ifp)) {
spin_lock_bh(&ifp->lock);
ifp->flags &= ~IFA_F_TENTATIVE;
spin_unlock_bh(&ifp->lock);
ipv6_ifa_notify(RTM_NEWADDR, ifp);
in6_ifa_put(ifp);
}
}

#if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE)
static void sit_add_v4_addrs(struct inet6_dev *idev)
{
struct inet6_ifaddr * ifp;
struct in6_addr addr;
struct net_device *dev;
struct net *net = dev_net(idev->dev);
Expand All @@ -2246,14 +2260,7 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)
}

if (addr.s6_addr32[3]) {
ifp = ipv6_add_addr(idev, &addr, 128, scope, IFA_F_PERMANENT);
if (!IS_ERR(ifp)) {
spin_lock_bh(&ifp->lock);
ifp->flags &= ~IFA_F_TENTATIVE;
spin_unlock_bh(&ifp->lock);
ipv6_ifa_notify(RTM_NEWADDR, ifp);
in6_ifa_put(ifp);
}
add_addr(idev, &addr, 128, scope);
return;
}

Expand Down Expand Up @@ -2281,15 +2288,7 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)
else
plen = 96;

ifp = ipv6_add_addr(idev, &addr, plen, flag,
IFA_F_PERMANENT);
if (!IS_ERR(ifp)) {
spin_lock_bh(&ifp->lock);
ifp->flags &= ~IFA_F_TENTATIVE;
spin_unlock_bh(&ifp->lock);
ipv6_ifa_notify(RTM_NEWADDR, ifp);
in6_ifa_put(ifp);
}
add_addr(idev, &addr, plen, flag);
}
}
}
Expand All @@ -2299,7 +2298,6 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)
static void init_loopback(struct net_device *dev)
{
struct inet6_dev *idev;
struct inet6_ifaddr * ifp;

/* ::1 */

Expand All @@ -2310,14 +2308,7 @@ static void init_loopback(struct net_device *dev)
return;
}

ifp = ipv6_add_addr(idev, &in6addr_loopback, 128, IFA_HOST, IFA_F_PERMANENT);
if (!IS_ERR(ifp)) {
spin_lock_bh(&ifp->lock);
ifp->flags &= ~IFA_F_TENTATIVE;
spin_unlock_bh(&ifp->lock);
ipv6_ifa_notify(RTM_NEWADDR, ifp);
in6_ifa_put(ifp);
}
add_addr(idev, &in6addr_loopback, 128, IFA_HOST);
}

static void addrconf_add_linklocal(struct inet6_dev *idev, struct in6_addr *addr)
Expand Down

0 comments on commit 63991dd

Please sign in to comment.