Subject: [PATCH] nethost: ipv6 restrict (for now) address autoconfiguration to the init_host From: Eric W. Biederman Date: 1134519670 -0700 --- net/ipv6/addrconf.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) 99bccc354e5a174e61b2358ebfab80cb90da2679 diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 3e7c7fb..3a44096 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -1219,13 +1219,15 @@ static int ipv6_generate_eui64(u8 *eui, return -1; } -static int ipv6_inherit_eui64(u8 *eui, struct inet6_dev *idev) +static int ipv6_inherit_eui64(u8 *eui, struct inet6_dev *idev, struct nethost *host) { int err = -1; struct inet6_ifaddr *ifp; read_lock_bh(&idev->lock); for (ifp=idev->addr_list; ifp; ifp=ifp->if_next) { + if (ifp->host != host) + continue; if (ifp->scope == IFA_LINK && !(ifp->flags&IFA_F_TENTATIVE)) { memcpy(eui, ifp->addr.s6_addr+8, 8); err = 0; @@ -1517,7 +1519,7 @@ void addrconf_prefix_rcv(struct net_devi if (pinfo->prefix_len == 64) { memcpy(&addr, &pinfo->prefix, 8); if (ipv6_generate_eui64(addr.s6_addr + 8, dev) && - ipv6_inherit_eui64(addr.s6_addr + 8, in6_dev)) { + ipv6_inherit_eui64(addr.s6_addr + 8, in6_dev, &init_host)) { in6_dev_put(in6_dev); return; } -- 1.0.GIT