Loading include/linux/ipv6_route.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ fallback, no routers on link */ fallback, no routers on link */ #define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */ #define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */ #define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */ #define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */ #define RTF_ANYCAST 0x00100000 /* Anycast */ #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ #define RTF_EXPIRES 0x00400000 #define RTF_EXPIRES 0x00400000 Loading include/net/if_inet6.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ #define IF_RA_MANAGED 0x40 #define IF_RA_MANAGED 0x40 #define IF_RA_RCVD 0x20 #define IF_RA_RCVD 0x20 #define IF_RS_SENT 0x10 #define IF_RS_SENT 0x10 #define IF_READY 0x80000000 /* prefix flags */ /* prefix flags */ #define IF_PREFIX_ONLINK 0x01 #define IF_PREFIX_ONLINK 0x01 Loading net/8021q/vlan.c +5 −1 Original line number Original line Diff line number Diff line Loading @@ -753,6 +753,8 @@ static int vlan_ioctl_handler(void __user *arg) break; break; case GET_VLAN_REALDEV_NAME_CMD: case GET_VLAN_REALDEV_NAME_CMD: err = vlan_dev_get_realdev_name(args.device1, args.u.device2); err = vlan_dev_get_realdev_name(args.device1, args.u.device2); if (err) goto out; if (copy_to_user(arg, &args, if (copy_to_user(arg, &args, sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) { err = -EFAULT; err = -EFAULT; Loading @@ -761,6 +763,8 @@ static int vlan_ioctl_handler(void __user *arg) case GET_VLAN_VID_CMD: case GET_VLAN_VID_CMD: err = vlan_dev_get_vid(args.device1, &vid); err = vlan_dev_get_vid(args.device1, &vid); if (err) goto out; args.u.VID = vid; args.u.VID = vid; if (copy_to_user(arg, &args, if (copy_to_user(arg, &args, sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) { Loading @@ -774,7 +778,7 @@ static int vlan_ioctl_handler(void __user *arg) __FUNCTION__, args.cmd); __FUNCTION__, args.cmd); return -EINVAL; return -EINVAL; }; }; out: return err; return err; } } Loading net/dccp/ipv4.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1251,7 +1251,7 @@ static int dccp_v4_destroy_sock(struct sock *sk) struct dccp_sock *dp = dccp_sk(sk); struct dccp_sock *dp = dccp_sk(sk); /* /* * DCCP doesn't use sk_qrite_queue, just sk_send_head * DCCP doesn't use sk_write_queue, just sk_send_head * for retransmissions * for retransmissions */ */ if (sk->sk_send_head != NULL) { if (sk->sk_send_head != NULL) { Loading net/ipv6/addrconf.c +98 −13 Original line number Original line Diff line number Diff line Loading @@ -137,6 +137,7 @@ static int addrconf_ifdown(struct net_device *dev, int how); static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); static void addrconf_dad_timer(unsigned long data); static void addrconf_dad_timer(unsigned long data); static void addrconf_dad_completed(struct inet6_ifaddr *ifp); static void addrconf_dad_completed(struct inet6_ifaddr *ifp); static void addrconf_dad_run(struct inet6_dev *idev); static void addrconf_rs_timer(unsigned long data); static void addrconf_rs_timer(unsigned long data); static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); Loading Loading @@ -388,6 +389,9 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) } } #endif #endif if (netif_carrier_ok(dev)) ndev->if_flags |= IF_READY; write_lock_bh(&addrconf_lock); write_lock_bh(&addrconf_lock); dev->ip6_ptr = ndev; dev->ip6_ptr = ndev; write_unlock_bh(&addrconf_lock); write_unlock_bh(&addrconf_lock); Loading Loading @@ -415,6 +419,7 @@ static struct inet6_dev * ipv6_find_idev(struct net_device *dev) if ((idev = ipv6_add_dev(dev)) == NULL) if ((idev = ipv6_add_dev(dev)) == NULL) return NULL; return NULL; } } if (dev->flags&IFF_UP) if (dev->flags&IFF_UP) ipv6_mc_up(idev); ipv6_mc_up(idev); return idev; return idev; Loading Loading @@ -634,8 +639,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) } } #endif #endif for (ifap = &idev->addr_list; (ifa=*ifap) != NULL; for (ifap = &idev->addr_list; (ifa=*ifap) != NULL;) { ifap = &ifa->if_next) { if (ifa == ifp) { if (ifa == ifp) { *ifap = ifa->if_next; *ifap = ifa->if_next; __in6_ifa_put(ifp); __in6_ifa_put(ifp); Loading @@ -643,6 +647,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) if (!(ifp->flags & IFA_F_PERMANENT) || onlink > 0) if (!(ifp->flags & IFA_F_PERMANENT) || onlink > 0) break; break; deleted = 1; deleted = 1; continue; } else if (ifp->flags & IFA_F_PERMANENT) { } else if (ifp->flags & IFA_F_PERMANENT) { if (ipv6_prefix_equal(&ifa->addr, &ifp->addr, if (ipv6_prefix_equal(&ifa->addr, &ifp->addr, ifp->prefix_len)) { ifp->prefix_len)) { Loading @@ -666,6 +671,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) } } } } } } ifap = &ifa->if_next; } } write_unlock_bh(&idev->lock); write_unlock_bh(&idev->lock); Loading Loading @@ -903,11 +909,18 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev, score.addr_type = __ipv6_addr_type(&ifa->addr); score.addr_type = __ipv6_addr_type(&ifa->addr); /* Rule 0: Candidate Source Address (section 4) /* Rule 0: * - Tentative Address (RFC2462 section 5.4) * - A tentative address is not considered * "assigned to an interface" in the traditional * sense. * - Candidate Source Address (section 4) * - In any case, anycast addresses, multicast * - In any case, anycast addresses, multicast * addresses, and the unspecified address MUST * addresses, and the unspecified address MUST * NOT be included in a candidate set. * NOT be included in a candidate set. */ */ if (ifa->flags & IFA_F_TENTATIVE) continue; if (unlikely(score.addr_type == IPV6_ADDR_ANY || if (unlikely(score.addr_type == IPV6_ADDR_ANY || score.addr_type & IPV6_ADDR_MULTICAST)) { score.addr_type & IPV6_ADDR_MULTICAST)) { LIMIT_NETDEBUG(KERN_DEBUG LIMIT_NETDEBUG(KERN_DEBUG Loading Loading @@ -1215,10 +1228,8 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) /* Gets referenced address, destroys ifaddr */ /* Gets referenced address, destroys ifaddr */ void addrconf_dad_failure(struct inet6_ifaddr *ifp) void addrconf_dad_stop(struct inet6_ifaddr *ifp) { { if (net_ratelimit()) printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name); if (ifp->flags&IFA_F_PERMANENT) { if (ifp->flags&IFA_F_PERMANENT) { spin_lock_bh(&ifp->lock); spin_lock_bh(&ifp->lock); addrconf_del_timer(ifp); addrconf_del_timer(ifp); Loading @@ -1244,6 +1255,12 @@ void addrconf_dad_failure(struct inet6_ifaddr *ifp) ipv6_del_addr(ifp); ipv6_del_addr(ifp); } } void addrconf_dad_failure(struct inet6_ifaddr *ifp) { if (net_ratelimit()) printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name); addrconf_dad_stop(ifp); } /* Join to solicited addr multicast group. */ /* Join to solicited addr multicast group. */ Loading Loading @@ -2133,9 +2150,42 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, { { struct net_device *dev = (struct net_device *) data; struct net_device *dev = (struct net_device *) data; struct inet6_dev *idev = __in6_dev_get(dev); struct inet6_dev *idev = __in6_dev_get(dev); int run_pending = 0; switch(event) { switch(event) { case NETDEV_UP: case NETDEV_UP: case NETDEV_CHANGE: if (event == NETDEV_UP) { if (!netif_carrier_ok(dev)) { /* device is not ready yet. */ printk(KERN_INFO "ADDRCONF(NETDEV_UP): %s: " "link is not ready\n", dev->name); break; } } else { if (!netif_carrier_ok(dev)) { /* device is still not ready. */ break; } if (idev) { if (idev->if_flags & IF_READY) { /* device is already configured. */ break; } idev->if_flags |= IF_READY; } printk(KERN_INFO "ADDRCONF(NETDEV_CHANGE): %s: " "link becomes ready\n", dev->name); run_pending = 1; } switch(dev->type) { switch(dev->type) { case ARPHRD_SIT: case ARPHRD_SIT: addrconf_sit_config(dev); addrconf_sit_config(dev); Loading @@ -2152,6 +2202,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, break; break; }; }; if (idev) { if (idev) { if (run_pending) addrconf_dad_run(idev); /* If the MTU changed during the interface down, when the /* If the MTU changed during the interface down, when the interface up, the changed MTU must be reflected in the interface up, the changed MTU must be reflected in the idev as well as routers. idev as well as routers. Loading Loading @@ -2186,8 +2239,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, */ */ addrconf_ifdown(dev, event != NETDEV_DOWN); addrconf_ifdown(dev, event != NETDEV_DOWN); break; break; case NETDEV_CHANGE: break; case NETDEV_CHANGENAME: case NETDEV_CHANGENAME: #ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL if (idev) { if (idev) { Loading Loading @@ -2268,7 +2320,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) /* Step 3: clear flags for stateless addrconf */ /* Step 3: clear flags for stateless addrconf */ if (how != 1) if (how != 1) idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD); idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); /* Step 4: clear address list */ /* Step 4: clear address list */ #ifdef CONFIG_IPV6_PRIVACY #ifdef CONFIG_IPV6_PRIVACY Loading Loading @@ -2377,11 +2429,20 @@ static void addrconf_rs_timer(unsigned long data) /* /* * Duplicate Address Detection * Duplicate Address Detection */ */ static void addrconf_dad_kick(struct inet6_ifaddr *ifp) { unsigned long rand_num; struct inet6_dev *idev = ifp->idev; rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); ifp->probes = idev->cnf.dad_transmits; addrconf_mod_timer(ifp, AC_DAD, rand_num); } static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) { { struct inet6_dev *idev = ifp->idev; struct inet6_dev *idev = ifp->idev; struct net_device *dev = idev->dev; struct net_device *dev = idev->dev; unsigned long rand_num; addrconf_join_solict(dev, &ifp->addr); addrconf_join_solict(dev, &ifp->addr); Loading @@ -2390,7 +2451,6 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) flags); flags); net_srandom(ifp->addr.s6_addr32[3]); net_srandom(ifp->addr.s6_addr32[3]); rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); read_lock_bh(&idev->lock); read_lock_bh(&idev->lock); if (ifp->dead) if (ifp->dead) Loading @@ -2407,8 +2467,17 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) return; return; } } ifp->probes = idev->cnf.dad_transmits; if (idev->if_flags & IF_READY) addrconf_mod_timer(ifp, AC_DAD, rand_num); addrconf_dad_kick(ifp); else { /* * If the defice is not ready: * - keep it tentative if it is a permanent address. * - otherwise, kill it. */ in6_ifa_hold(ifp); addrconf_dad_stop(ifp); } spin_unlock_bh(&ifp->lock); spin_unlock_bh(&ifp->lock); out: out: Loading Loading @@ -2492,6 +2561,22 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp) } } } } static void addrconf_dad_run(struct inet6_dev *idev) { struct inet6_ifaddr *ifp; read_lock_bh(&idev->lock); for (ifp = idev->addr_list; ifp; ifp = ifp->if_next) { spin_lock_bh(&ifp->lock); if (!(ifp->flags & IFA_F_TENTATIVE)) { spin_unlock_bh(&ifp->lock); continue; } spin_unlock_bh(&ifp->lock); addrconf_dad_kick(ifp); } read_unlock_bh(&idev->lock); } #ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS struct if6_iter_state { struct if6_iter_state { int bucket; int bucket; Loading Loading
include/linux/ipv6_route.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ fallback, no routers on link */ fallback, no routers on link */ #define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */ #define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */ #define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */ #define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */ #define RTF_ANYCAST 0x00100000 /* Anycast */ #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ #define RTF_EXPIRES 0x00400000 #define RTF_EXPIRES 0x00400000 Loading
include/net/if_inet6.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ #define IF_RA_MANAGED 0x40 #define IF_RA_MANAGED 0x40 #define IF_RA_RCVD 0x20 #define IF_RA_RCVD 0x20 #define IF_RS_SENT 0x10 #define IF_RS_SENT 0x10 #define IF_READY 0x80000000 /* prefix flags */ /* prefix flags */ #define IF_PREFIX_ONLINK 0x01 #define IF_PREFIX_ONLINK 0x01 Loading
net/8021q/vlan.c +5 −1 Original line number Original line Diff line number Diff line Loading @@ -753,6 +753,8 @@ static int vlan_ioctl_handler(void __user *arg) break; break; case GET_VLAN_REALDEV_NAME_CMD: case GET_VLAN_REALDEV_NAME_CMD: err = vlan_dev_get_realdev_name(args.device1, args.u.device2); err = vlan_dev_get_realdev_name(args.device1, args.u.device2); if (err) goto out; if (copy_to_user(arg, &args, if (copy_to_user(arg, &args, sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) { err = -EFAULT; err = -EFAULT; Loading @@ -761,6 +763,8 @@ static int vlan_ioctl_handler(void __user *arg) case GET_VLAN_VID_CMD: case GET_VLAN_VID_CMD: err = vlan_dev_get_vid(args.device1, &vid); err = vlan_dev_get_vid(args.device1, &vid); if (err) goto out; args.u.VID = vid; args.u.VID = vid; if (copy_to_user(arg, &args, if (copy_to_user(arg, &args, sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) { Loading @@ -774,7 +778,7 @@ static int vlan_ioctl_handler(void __user *arg) __FUNCTION__, args.cmd); __FUNCTION__, args.cmd); return -EINVAL; return -EINVAL; }; }; out: return err; return err; } } Loading
net/dccp/ipv4.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1251,7 +1251,7 @@ static int dccp_v4_destroy_sock(struct sock *sk) struct dccp_sock *dp = dccp_sk(sk); struct dccp_sock *dp = dccp_sk(sk); /* /* * DCCP doesn't use sk_qrite_queue, just sk_send_head * DCCP doesn't use sk_write_queue, just sk_send_head * for retransmissions * for retransmissions */ */ if (sk->sk_send_head != NULL) { if (sk->sk_send_head != NULL) { Loading
net/ipv6/addrconf.c +98 −13 Original line number Original line Diff line number Diff line Loading @@ -137,6 +137,7 @@ static int addrconf_ifdown(struct net_device *dev, int how); static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); static void addrconf_dad_timer(unsigned long data); static void addrconf_dad_timer(unsigned long data); static void addrconf_dad_completed(struct inet6_ifaddr *ifp); static void addrconf_dad_completed(struct inet6_ifaddr *ifp); static void addrconf_dad_run(struct inet6_dev *idev); static void addrconf_rs_timer(unsigned long data); static void addrconf_rs_timer(unsigned long data); static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); Loading Loading @@ -388,6 +389,9 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) } } #endif #endif if (netif_carrier_ok(dev)) ndev->if_flags |= IF_READY; write_lock_bh(&addrconf_lock); write_lock_bh(&addrconf_lock); dev->ip6_ptr = ndev; dev->ip6_ptr = ndev; write_unlock_bh(&addrconf_lock); write_unlock_bh(&addrconf_lock); Loading Loading @@ -415,6 +419,7 @@ static struct inet6_dev * ipv6_find_idev(struct net_device *dev) if ((idev = ipv6_add_dev(dev)) == NULL) if ((idev = ipv6_add_dev(dev)) == NULL) return NULL; return NULL; } } if (dev->flags&IFF_UP) if (dev->flags&IFF_UP) ipv6_mc_up(idev); ipv6_mc_up(idev); return idev; return idev; Loading Loading @@ -634,8 +639,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) } } #endif #endif for (ifap = &idev->addr_list; (ifa=*ifap) != NULL; for (ifap = &idev->addr_list; (ifa=*ifap) != NULL;) { ifap = &ifa->if_next) { if (ifa == ifp) { if (ifa == ifp) { *ifap = ifa->if_next; *ifap = ifa->if_next; __in6_ifa_put(ifp); __in6_ifa_put(ifp); Loading @@ -643,6 +647,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) if (!(ifp->flags & IFA_F_PERMANENT) || onlink > 0) if (!(ifp->flags & IFA_F_PERMANENT) || onlink > 0) break; break; deleted = 1; deleted = 1; continue; } else if (ifp->flags & IFA_F_PERMANENT) { } else if (ifp->flags & IFA_F_PERMANENT) { if (ipv6_prefix_equal(&ifa->addr, &ifp->addr, if (ipv6_prefix_equal(&ifa->addr, &ifp->addr, ifp->prefix_len)) { ifp->prefix_len)) { Loading @@ -666,6 +671,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) } } } } } } ifap = &ifa->if_next; } } write_unlock_bh(&idev->lock); write_unlock_bh(&idev->lock); Loading Loading @@ -903,11 +909,18 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev, score.addr_type = __ipv6_addr_type(&ifa->addr); score.addr_type = __ipv6_addr_type(&ifa->addr); /* Rule 0: Candidate Source Address (section 4) /* Rule 0: * - Tentative Address (RFC2462 section 5.4) * - A tentative address is not considered * "assigned to an interface" in the traditional * sense. * - Candidate Source Address (section 4) * - In any case, anycast addresses, multicast * - In any case, anycast addresses, multicast * addresses, and the unspecified address MUST * addresses, and the unspecified address MUST * NOT be included in a candidate set. * NOT be included in a candidate set. */ */ if (ifa->flags & IFA_F_TENTATIVE) continue; if (unlikely(score.addr_type == IPV6_ADDR_ANY || if (unlikely(score.addr_type == IPV6_ADDR_ANY || score.addr_type & IPV6_ADDR_MULTICAST)) { score.addr_type & IPV6_ADDR_MULTICAST)) { LIMIT_NETDEBUG(KERN_DEBUG LIMIT_NETDEBUG(KERN_DEBUG Loading Loading @@ -1215,10 +1228,8 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) /* Gets referenced address, destroys ifaddr */ /* Gets referenced address, destroys ifaddr */ void addrconf_dad_failure(struct inet6_ifaddr *ifp) void addrconf_dad_stop(struct inet6_ifaddr *ifp) { { if (net_ratelimit()) printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name); if (ifp->flags&IFA_F_PERMANENT) { if (ifp->flags&IFA_F_PERMANENT) { spin_lock_bh(&ifp->lock); spin_lock_bh(&ifp->lock); addrconf_del_timer(ifp); addrconf_del_timer(ifp); Loading @@ -1244,6 +1255,12 @@ void addrconf_dad_failure(struct inet6_ifaddr *ifp) ipv6_del_addr(ifp); ipv6_del_addr(ifp); } } void addrconf_dad_failure(struct inet6_ifaddr *ifp) { if (net_ratelimit()) printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name); addrconf_dad_stop(ifp); } /* Join to solicited addr multicast group. */ /* Join to solicited addr multicast group. */ Loading Loading @@ -2133,9 +2150,42 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, { { struct net_device *dev = (struct net_device *) data; struct net_device *dev = (struct net_device *) data; struct inet6_dev *idev = __in6_dev_get(dev); struct inet6_dev *idev = __in6_dev_get(dev); int run_pending = 0; switch(event) { switch(event) { case NETDEV_UP: case NETDEV_UP: case NETDEV_CHANGE: if (event == NETDEV_UP) { if (!netif_carrier_ok(dev)) { /* device is not ready yet. */ printk(KERN_INFO "ADDRCONF(NETDEV_UP): %s: " "link is not ready\n", dev->name); break; } } else { if (!netif_carrier_ok(dev)) { /* device is still not ready. */ break; } if (idev) { if (idev->if_flags & IF_READY) { /* device is already configured. */ break; } idev->if_flags |= IF_READY; } printk(KERN_INFO "ADDRCONF(NETDEV_CHANGE): %s: " "link becomes ready\n", dev->name); run_pending = 1; } switch(dev->type) { switch(dev->type) { case ARPHRD_SIT: case ARPHRD_SIT: addrconf_sit_config(dev); addrconf_sit_config(dev); Loading @@ -2152,6 +2202,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, break; break; }; }; if (idev) { if (idev) { if (run_pending) addrconf_dad_run(idev); /* If the MTU changed during the interface down, when the /* If the MTU changed during the interface down, when the interface up, the changed MTU must be reflected in the interface up, the changed MTU must be reflected in the idev as well as routers. idev as well as routers. Loading Loading @@ -2186,8 +2239,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, */ */ addrconf_ifdown(dev, event != NETDEV_DOWN); addrconf_ifdown(dev, event != NETDEV_DOWN); break; break; case NETDEV_CHANGE: break; case NETDEV_CHANGENAME: case NETDEV_CHANGENAME: #ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL if (idev) { if (idev) { Loading Loading @@ -2268,7 +2320,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) /* Step 3: clear flags for stateless addrconf */ /* Step 3: clear flags for stateless addrconf */ if (how != 1) if (how != 1) idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD); idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); /* Step 4: clear address list */ /* Step 4: clear address list */ #ifdef CONFIG_IPV6_PRIVACY #ifdef CONFIG_IPV6_PRIVACY Loading Loading @@ -2377,11 +2429,20 @@ static void addrconf_rs_timer(unsigned long data) /* /* * Duplicate Address Detection * Duplicate Address Detection */ */ static void addrconf_dad_kick(struct inet6_ifaddr *ifp) { unsigned long rand_num; struct inet6_dev *idev = ifp->idev; rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); ifp->probes = idev->cnf.dad_transmits; addrconf_mod_timer(ifp, AC_DAD, rand_num); } static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) { { struct inet6_dev *idev = ifp->idev; struct inet6_dev *idev = ifp->idev; struct net_device *dev = idev->dev; struct net_device *dev = idev->dev; unsigned long rand_num; addrconf_join_solict(dev, &ifp->addr); addrconf_join_solict(dev, &ifp->addr); Loading @@ -2390,7 +2451,6 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) flags); flags); net_srandom(ifp->addr.s6_addr32[3]); net_srandom(ifp->addr.s6_addr32[3]); rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); read_lock_bh(&idev->lock); read_lock_bh(&idev->lock); if (ifp->dead) if (ifp->dead) Loading @@ -2407,8 +2467,17 @@ static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) return; return; } } ifp->probes = idev->cnf.dad_transmits; if (idev->if_flags & IF_READY) addrconf_mod_timer(ifp, AC_DAD, rand_num); addrconf_dad_kick(ifp); else { /* * If the defice is not ready: * - keep it tentative if it is a permanent address. * - otherwise, kill it. */ in6_ifa_hold(ifp); addrconf_dad_stop(ifp); } spin_unlock_bh(&ifp->lock); spin_unlock_bh(&ifp->lock); out: out: Loading Loading @@ -2492,6 +2561,22 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp) } } } } static void addrconf_dad_run(struct inet6_dev *idev) { struct inet6_ifaddr *ifp; read_lock_bh(&idev->lock); for (ifp = idev->addr_list; ifp; ifp = ifp->if_next) { spin_lock_bh(&ifp->lock); if (!(ifp->flags & IFA_F_TENTATIVE)) { spin_unlock_bh(&ifp->lock); continue; } spin_unlock_bh(&ifp->lock); addrconf_dad_kick(ifp); } read_unlock_bh(&idev->lock); } #ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS struct if6_iter_state { struct if6_iter_state { int bucket; int bucket; Loading