addrconf.c (65b53e4cc90e59936733b3b95b9451d2ca47528d) addrconf.c (2b5ead46442d80928cce987ae6acf3fe99968ad8)
1/*
2 * IPv6 Address [auto]configuration
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 *

--- 217 unchanged lines hidden (view full) ---

226const struct in6_addr in6addr_linklocal_allrouters = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT;
227
228/* Check if a valid qdisc is available */
229static inline int addrconf_qdisc_ok(struct net_device *dev)
230{
231 return (dev->qdisc != &noop_qdisc);
232}
233
1/*
2 * IPv6 Address [auto]configuration
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 *

--- 217 unchanged lines hidden (view full) ---

226const struct in6_addr in6addr_linklocal_allrouters = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT;
227
228/* Check if a valid qdisc is available */
229static inline int addrconf_qdisc_ok(struct net_device *dev)
230{
231 return (dev->qdisc != &noop_qdisc);
232}
233
234/* Check if a route is valid prefix route */
235static inline int addrconf_is_prefix_route(const struct rt6_info *rt)
236{
237 return ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0);
238}
239
234static void addrconf_del_timer(struct inet6_ifaddr *ifp)
235{
236 if (del_timer(&ifp->timer))
237 __in6_ifa_put(ifp);
238}
239
240enum addrconf_timer_t
241{

--- 530 unchanged lines hidden (view full) ---

772 */
773 if ((ifp->flags & IFA_F_PERMANENT) && onlink < 1) {
774 struct in6_addr prefix;
775 struct rt6_info *rt;
776 struct net *net = dev_net(ifp->idev->dev);
777 ipv6_addr_prefix(&prefix, &ifp->addr, ifp->prefix_len);
778 rt = rt6_lookup(net, &prefix, NULL, ifp->idev->dev->ifindex, 1);
779
240static void addrconf_del_timer(struct inet6_ifaddr *ifp)
241{
242 if (del_timer(&ifp->timer))
243 __in6_ifa_put(ifp);
244}
245
246enum addrconf_timer_t
247{

--- 530 unchanged lines hidden (view full) ---

778 */
779 if ((ifp->flags & IFA_F_PERMANENT) && onlink < 1) {
780 struct in6_addr prefix;
781 struct rt6_info *rt;
782 struct net *net = dev_net(ifp->idev->dev);
783 ipv6_addr_prefix(&prefix, &ifp->addr, ifp->prefix_len);
784 rt = rt6_lookup(net, &prefix, NULL, ifp->idev->dev->ifindex, 1);
785
780 if (rt && ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0)) {
786 if (rt && addrconf_is_prefix_route(rt)) {
781 if (onlink == 0) {
782 ip6_del_rt(rt);
783 rt = NULL;
784 } else if (!(rt->rt6i_flags & RTF_EXPIRES)) {
785 rt->rt6i_expires = expires;
786 rt->rt6i_flags |= RTF_EXPIRES;
787 }
788 }

--- 994 unchanged lines hidden (view full) ---

1783 rt_expires = addrconf_timeout_fixup(valid_lft, USER_HZ);
1784
1785 if (addrconf_finite_timeout(rt_expires))
1786 rt_expires *= HZ;
1787
1788 rt = rt6_lookup(dev_net(dev), &pinfo->prefix, NULL,
1789 dev->ifindex, 1);
1790
787 if (onlink == 0) {
788 ip6_del_rt(rt);
789 rt = NULL;
790 } else if (!(rt->rt6i_flags & RTF_EXPIRES)) {
791 rt->rt6i_expires = expires;
792 rt->rt6i_flags |= RTF_EXPIRES;
793 }
794 }

--- 994 unchanged lines hidden (view full) ---

1789 rt_expires = addrconf_timeout_fixup(valid_lft, USER_HZ);
1790
1791 if (addrconf_finite_timeout(rt_expires))
1792 rt_expires *= HZ;
1793
1794 rt = rt6_lookup(dev_net(dev), &pinfo->prefix, NULL,
1795 dev->ifindex, 1);
1796
1791 if (rt && ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0)) {
1797 if (rt && addrconf_is_prefix_route(rt)) {
1792 /* Autoconf prefix route */
1793 if (valid_lft == 0) {
1794 ip6_del_rt(rt);
1795 rt = NULL;
1796 } else if (addrconf_finite_timeout(rt_expires)) {
1797 /* not infinity */
1798 rt->rt6i_expires = jiffies + rt_expires;
1799 rt->rt6i_flags |= RTF_EXPIRES;

--- 2700 unchanged lines hidden ---
1798 /* Autoconf prefix route */
1799 if (valid_lft == 0) {
1800 ip6_del_rt(rt);
1801 rt = NULL;
1802 } else if (addrconf_finite_timeout(rt_expires)) {
1803 /* not infinity */
1804 rt->rt6i_expires = jiffies + rt_expires;
1805 rt->rt6i_flags |= RTF_EXPIRES;

--- 2700 unchanged lines hidden ---