diff options
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 19c906f6efa1..fc8448cc5d21 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * FIB front-end. | 3 | * FIB front-end. |
4 | * | 4 | * |
5 | * Authors: | 5 | * Authors: |
6 | * Pedro Roque <roque@di.fc.ul.pt> | 6 | * Pedro Roque <roque@di.fc.ul.pt> |
7 | * | 7 | * |
8 | * $Id: route.c,v 1.56 2001/10/31 21:55:55 davem Exp $ | 8 | * $Id: route.c,v 1.56 2001/10/31 21:55:55 davem Exp $ |
9 | * | 9 | * |
@@ -201,7 +201,7 @@ static void ip6_dst_destroy(struct dst_entry *dst) | |||
201 | if (idev != NULL) { | 201 | if (idev != NULL) { |
202 | rt->rt6i_idev = NULL; | 202 | rt->rt6i_idev = NULL; |
203 | in6_dev_put(idev); | 203 | in6_dev_put(idev); |
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
207 | static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev, | 207 | static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev, |
@@ -252,7 +252,7 @@ static __inline__ struct rt6_info *rt6_device_match(struct rt6_info *rt, | |||
252 | sprt->rt6i_idev->dev->ifindex != oif) { | 252 | sprt->rt6i_idev->dev->ifindex != oif) { |
253 | if (strict && oif) | 253 | if (strict && oif) |
254 | continue; | 254 | continue; |
255 | if (local && (!oif || | 255 | if (local && (!oif || |
256 | local->rt6i_idev->dev->ifindex == oif)) | 256 | local->rt6i_idev->dev->ifindex == oif)) |
257 | continue; | 257 | continue; |
258 | } | 258 | } |
@@ -350,7 +350,7 @@ static int rt6_score_route(struct rt6_info *rt, int oif, | |||
350 | int strict) | 350 | int strict) |
351 | { | 351 | { |
352 | int m, n; | 352 | int m, n; |
353 | 353 | ||
354 | m = rt6_check_dev(rt, oif); | 354 | m = rt6_check_dev(rt, oif); |
355 | if (!m && (strict & RT6_LOOKUP_F_IFACE)) | 355 | if (!m && (strict & RT6_LOOKUP_F_IFACE)) |
356 | return -1; | 356 | return -1; |
@@ -723,7 +723,7 @@ void ip6_route_input(struct sk_buff *skb) | |||
723 | .flowlabel = (* (__be32 *) iph)&IPV6_FLOWINFO_MASK, | 723 | .flowlabel = (* (__be32 *) iph)&IPV6_FLOWINFO_MASK, |
724 | }, | 724 | }, |
725 | }, | 725 | }, |
726 | .mark = skb->mark, | 726 | .mark = skb->mark, |
727 | .proto = iph->nexthdr, | 727 | .proto = iph->nexthdr, |
728 | }; | 728 | }; |
729 | 729 | ||
@@ -888,9 +888,9 @@ static inline unsigned int ipv6_advmss(unsigned int mtu) | |||
888 | mtu = ip6_rt_min_advmss; | 888 | mtu = ip6_rt_min_advmss; |
889 | 889 | ||
890 | /* | 890 | /* |
891 | * Maximal non-jumbo IPv6 payload is IPV6_MAXPLEN and | 891 | * Maximal non-jumbo IPv6 payload is IPV6_MAXPLEN and |
892 | * corresponding MSS is IPV6_MAXPLEN - tcp_header_size. | 892 | * corresponding MSS is IPV6_MAXPLEN - tcp_header_size. |
893 | * IPV6_MAXPLEN is also valid and means: "any MSS, | 893 | * IPV6_MAXPLEN is also valid and means: "any MSS, |
894 | * rely only on pmtu discovery" | 894 | * rely only on pmtu discovery" |
895 | */ | 895 | */ |
896 | if (mtu > IPV6_MAXPLEN - sizeof(struct tcphdr)) | 896 | if (mtu > IPV6_MAXPLEN - sizeof(struct tcphdr)) |
@@ -901,7 +901,7 @@ static inline unsigned int ipv6_advmss(unsigned int mtu) | |||
901 | static struct dst_entry *ndisc_dst_gc_list; | 901 | static struct dst_entry *ndisc_dst_gc_list; |
902 | static DEFINE_SPINLOCK(ndisc_lock); | 902 | static DEFINE_SPINLOCK(ndisc_lock); |
903 | 903 | ||
904 | struct dst_entry *ndisc_dst_alloc(struct net_device *dev, | 904 | struct dst_entry *ndisc_dst_alloc(struct net_device *dev, |
905 | struct neighbour *neigh, | 905 | struct neighbour *neigh, |
906 | struct in6_addr *addr, | 906 | struct in6_addr *addr, |
907 | int (*output)(struct sk_buff *)) | 907 | int (*output)(struct sk_buff *)) |
@@ -934,8 +934,8 @@ struct dst_entry *ndisc_dst_alloc(struct net_device *dev, | |||
934 | rt->u.dst.output = output; | 934 | rt->u.dst.output = output; |
935 | 935 | ||
936 | #if 0 /* there's no chance to use these for ndisc */ | 936 | #if 0 /* there's no chance to use these for ndisc */ |
937 | rt->u.dst.flags = ipv6_addr_type(addr) & IPV6_ADDR_UNICAST | 937 | rt->u.dst.flags = ipv6_addr_type(addr) & IPV6_ADDR_UNICAST |
938 | ? DST_HOST | 938 | ? DST_HOST |
939 | : 0; | 939 | : 0; |
940 | ipv6_addr_copy(&rt->rt6i_dst.addr, addr); | 940 | ipv6_addr_copy(&rt->rt6i_dst.addr, addr); |
941 | rt->rt6i_dst.plen = 128; | 941 | rt->rt6i_dst.plen = 128; |
@@ -958,7 +958,7 @@ int ndisc_dst_gc(int *more) | |||
958 | int freed; | 958 | int freed; |
959 | 959 | ||
960 | next = NULL; | 960 | next = NULL; |
961 | freed = 0; | 961 | freed = 0; |
962 | 962 | ||
963 | spin_lock_bh(&ndisc_lock); | 963 | spin_lock_bh(&ndisc_lock); |
964 | pprev = &ndisc_dst_gc_list; | 964 | pprev = &ndisc_dst_gc_list; |
@@ -1276,7 +1276,7 @@ static int ip6_route_del(struct fib6_config *cfg) | |||
1276 | fn = fib6_locate(&table->tb6_root, | 1276 | fn = fib6_locate(&table->tb6_root, |
1277 | &cfg->fc_dst, cfg->fc_dst_len, | 1277 | &cfg->fc_dst, cfg->fc_dst_len, |
1278 | &cfg->fc_src, cfg->fc_src_len); | 1278 | &cfg->fc_src, cfg->fc_src_len); |
1279 | 1279 | ||
1280 | if (fn) { | 1280 | if (fn) { |
1281 | for (rt = fn->leaf; rt; rt = rt->u.next) { | 1281 | for (rt = fn->leaf; rt; rt = rt->u.next) { |
1282 | if (cfg->fc_ifindex && | 1282 | if (cfg->fc_ifindex && |
@@ -1405,7 +1405,7 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *src, | |||
1405 | * We have finally decided to accept it. | 1405 | * We have finally decided to accept it. |
1406 | */ | 1406 | */ |
1407 | 1407 | ||
1408 | neigh_update(neigh, lladdr, NUD_STALE, | 1408 | neigh_update(neigh, lladdr, NUD_STALE, |
1409 | NEIGH_UPDATE_F_WEAK_OVERRIDE| | 1409 | NEIGH_UPDATE_F_WEAK_OVERRIDE| |
1410 | NEIGH_UPDATE_F_OVERRIDE| | 1410 | NEIGH_UPDATE_F_OVERRIDE| |
1411 | (on_link ? 0 : (NEIGH_UPDATE_F_OVERRIDE_ISROUTER| | 1411 | (on_link ? 0 : (NEIGH_UPDATE_F_OVERRIDE_ISROUTER| |
@@ -1454,7 +1454,7 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *src, | |||
1454 | } | 1454 | } |
1455 | 1455 | ||
1456 | out: | 1456 | out: |
1457 | dst_release(&rt->u.dst); | 1457 | dst_release(&rt->u.dst); |
1458 | return; | 1458 | return; |
1459 | } | 1459 | } |
1460 | 1460 | ||
@@ -1478,7 +1478,7 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr, | |||
1478 | 1478 | ||
1479 | if (pmtu < IPV6_MIN_MTU) { | 1479 | if (pmtu < IPV6_MIN_MTU) { |
1480 | /* | 1480 | /* |
1481 | * According to RFC2460, PMTU is set to the IPv6 Minimum Link | 1481 | * According to RFC2460, PMTU is set to the IPv6 Minimum Link |
1482 | * MTU (1280) and a fragment header should always be included | 1482 | * MTU (1280) and a fragment header should always be included |
1483 | * after a node receiving Too Big message reporting PMTU is | 1483 | * after a node receiving Too Big message reporting PMTU is |
1484 | * less than the IPv6 Minimum Link MTU. | 1484 | * less than the IPv6 Minimum Link MTU. |
@@ -1632,7 +1632,7 @@ static struct rt6_info *rt6_add_route_info(struct in6_addr *prefix, int prefixle | |||
1632 | #endif | 1632 | #endif |
1633 | 1633 | ||
1634 | struct rt6_info *rt6_get_dflt_router(struct in6_addr *addr, struct net_device *dev) | 1634 | struct rt6_info *rt6_get_dflt_router(struct in6_addr *addr, struct net_device *dev) |
1635 | { | 1635 | { |
1636 | struct rt6_info *rt; | 1636 | struct rt6_info *rt; |
1637 | struct fib6_table *table; | 1637 | struct fib6_table *table; |
1638 | 1638 | ||
@@ -1896,8 +1896,8 @@ static int rt6_mtu_change_route(struct rt6_info *rt, void *p_arg) | |||
1896 | */ | 1896 | */ |
1897 | if (rt->rt6i_dev == arg->dev && | 1897 | if (rt->rt6i_dev == arg->dev && |
1898 | !dst_metric_locked(&rt->u.dst, RTAX_MTU) && | 1898 | !dst_metric_locked(&rt->u.dst, RTAX_MTU) && |
1899 | (dst_mtu(&rt->u.dst) > arg->mtu || | 1899 | (dst_mtu(&rt->u.dst) > arg->mtu || |
1900 | (dst_mtu(&rt->u.dst) < arg->mtu && | 1900 | (dst_mtu(&rt->u.dst) < arg->mtu && |
1901 | dst_mtu(&rt->u.dst) == idev->cnf.mtu6))) | 1901 | dst_mtu(&rt->u.dst) == idev->cnf.mtu6))) |
1902 | rt->u.dst.metrics[RTAX_MTU-1] = arg->mtu; | 1902 | rt->u.dst.metrics[RTAX_MTU-1] = arg->mtu; |
1903 | rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(arg->mtu); | 1903 | rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(arg->mtu); |
@@ -2083,13 +2083,13 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt, | |||
2083 | 2083 | ||
2084 | if (dst) { | 2084 | if (dst) { |
2085 | NLA_PUT(skb, RTA_DST, 16, dst); | 2085 | NLA_PUT(skb, RTA_DST, 16, dst); |
2086 | rtm->rtm_dst_len = 128; | 2086 | rtm->rtm_dst_len = 128; |
2087 | } else if (rtm->rtm_dst_len) | 2087 | } else if (rtm->rtm_dst_len) |
2088 | NLA_PUT(skb, RTA_DST, 16, &rt->rt6i_dst.addr); | 2088 | NLA_PUT(skb, RTA_DST, 16, &rt->rt6i_dst.addr); |
2089 | #ifdef CONFIG_IPV6_SUBTREES | 2089 | #ifdef CONFIG_IPV6_SUBTREES |
2090 | if (src) { | 2090 | if (src) { |
2091 | NLA_PUT(skb, RTA_SRC, 16, src); | 2091 | NLA_PUT(skb, RTA_SRC, 16, src); |
2092 | rtm->rtm_src_len = 128; | 2092 | rtm->rtm_src_len = 128; |
2093 | } else if (rtm->rtm_src_len) | 2093 | } else if (rtm->rtm_src_len) |
2094 | NLA_PUT(skb, RTA_SRC, 16, &rt->rt6i_src.addr); | 2094 | NLA_PUT(skb, RTA_SRC, 16, &rt->rt6i_src.addr); |
2095 | #endif | 2095 | #endif |
@@ -2299,7 +2299,7 @@ static int rt6_info_route(struct rt6_info *rt, void *p_arg) | |||
2299 | arg->len += sprintf(arg->buffer + arg->len, | 2299 | arg->len += sprintf(arg->buffer + arg->len, |
2300 | " %08x %08x %08x %08x %8s\n", | 2300 | " %08x %08x %08x %08x %8s\n", |
2301 | rt->rt6i_metric, atomic_read(&rt->u.dst.__refcnt), | 2301 | rt->rt6i_metric, atomic_read(&rt->u.dst.__refcnt), |
2302 | rt->u.dst.__use, rt->rt6i_flags, | 2302 | rt->u.dst.__use, rt->rt6i_flags, |
2303 | rt->rt6i_dev ? rt->rt6i_dev->name : ""); | 2303 | rt->rt6i_dev ? rt->rt6i_dev->name : ""); |
2304 | return 0; | 2304 | return 0; |
2305 | } | 2305 | } |
@@ -2371,91 +2371,91 @@ int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, struct file * filp, | |||
2371 | } | 2371 | } |
2372 | 2372 | ||
2373 | ctl_table ipv6_route_table[] = { | 2373 | ctl_table ipv6_route_table[] = { |
2374 | { | 2374 | { |
2375 | .ctl_name = NET_IPV6_ROUTE_FLUSH, | 2375 | .ctl_name = NET_IPV6_ROUTE_FLUSH, |
2376 | .procname = "flush", | 2376 | .procname = "flush", |
2377 | .data = &flush_delay, | 2377 | .data = &flush_delay, |
2378 | .maxlen = sizeof(int), | 2378 | .maxlen = sizeof(int), |
2379 | .mode = 0200, | 2379 | .mode = 0200, |
2380 | .proc_handler = &ipv6_sysctl_rtcache_flush | 2380 | .proc_handler = &ipv6_sysctl_rtcache_flush |
2381 | }, | 2381 | }, |
2382 | { | 2382 | { |
2383 | .ctl_name = NET_IPV6_ROUTE_GC_THRESH, | 2383 | .ctl_name = NET_IPV6_ROUTE_GC_THRESH, |
2384 | .procname = "gc_thresh", | 2384 | .procname = "gc_thresh", |
2385 | .data = &ip6_dst_ops.gc_thresh, | 2385 | .data = &ip6_dst_ops.gc_thresh, |
2386 | .maxlen = sizeof(int), | 2386 | .maxlen = sizeof(int), |
2387 | .mode = 0644, | 2387 | .mode = 0644, |
2388 | .proc_handler = &proc_dointvec, | 2388 | .proc_handler = &proc_dointvec, |
2389 | }, | 2389 | }, |
2390 | { | 2390 | { |
2391 | .ctl_name = NET_IPV6_ROUTE_MAX_SIZE, | 2391 | .ctl_name = NET_IPV6_ROUTE_MAX_SIZE, |
2392 | .procname = "max_size", | 2392 | .procname = "max_size", |
2393 | .data = &ip6_rt_max_size, | 2393 | .data = &ip6_rt_max_size, |
2394 | .maxlen = sizeof(int), | 2394 | .maxlen = sizeof(int), |
2395 | .mode = 0644, | 2395 | .mode = 0644, |
2396 | .proc_handler = &proc_dointvec, | 2396 | .proc_handler = &proc_dointvec, |
2397 | }, | 2397 | }, |
2398 | { | 2398 | { |
2399 | .ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL, | 2399 | .ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL, |
2400 | .procname = "gc_min_interval", | 2400 | .procname = "gc_min_interval", |
2401 | .data = &ip6_rt_gc_min_interval, | 2401 | .data = &ip6_rt_gc_min_interval, |
2402 | .maxlen = sizeof(int), | 2402 | .maxlen = sizeof(int), |
2403 | .mode = 0644, | 2403 | .mode = 0644, |
2404 | .proc_handler = &proc_dointvec_jiffies, | 2404 | .proc_handler = &proc_dointvec_jiffies, |
2405 | .strategy = &sysctl_jiffies, | 2405 | .strategy = &sysctl_jiffies, |
2406 | }, | 2406 | }, |
2407 | { | 2407 | { |
2408 | .ctl_name = NET_IPV6_ROUTE_GC_TIMEOUT, | 2408 | .ctl_name = NET_IPV6_ROUTE_GC_TIMEOUT, |
2409 | .procname = "gc_timeout", | 2409 | .procname = "gc_timeout", |
2410 | .data = &ip6_rt_gc_timeout, | 2410 | .data = &ip6_rt_gc_timeout, |
2411 | .maxlen = sizeof(int), | 2411 | .maxlen = sizeof(int), |
2412 | .mode = 0644, | 2412 | .mode = 0644, |
2413 | .proc_handler = &proc_dointvec_jiffies, | 2413 | .proc_handler = &proc_dointvec_jiffies, |
2414 | .strategy = &sysctl_jiffies, | 2414 | .strategy = &sysctl_jiffies, |
2415 | }, | 2415 | }, |
2416 | { | 2416 | { |
2417 | .ctl_name = NET_IPV6_ROUTE_GC_INTERVAL, | 2417 | .ctl_name = NET_IPV6_ROUTE_GC_INTERVAL, |
2418 | .procname = "gc_interval", | 2418 | .procname = "gc_interval", |
2419 | .data = &ip6_rt_gc_interval, | 2419 | .data = &ip6_rt_gc_interval, |
2420 | .maxlen = sizeof(int), | 2420 | .maxlen = sizeof(int), |
2421 | .mode = 0644, | 2421 | .mode = 0644, |
2422 | .proc_handler = &proc_dointvec_jiffies, | 2422 | .proc_handler = &proc_dointvec_jiffies, |
2423 | .strategy = &sysctl_jiffies, | 2423 | .strategy = &sysctl_jiffies, |
2424 | }, | 2424 | }, |
2425 | { | 2425 | { |
2426 | .ctl_name = NET_IPV6_ROUTE_GC_ELASTICITY, | 2426 | .ctl_name = NET_IPV6_ROUTE_GC_ELASTICITY, |
2427 | .procname = "gc_elasticity", | 2427 | .procname = "gc_elasticity", |
2428 | .data = &ip6_rt_gc_elasticity, | 2428 | .data = &ip6_rt_gc_elasticity, |
2429 | .maxlen = sizeof(int), | 2429 | .maxlen = sizeof(int), |
2430 | .mode = 0644, | 2430 | .mode = 0644, |
2431 | .proc_handler = &proc_dointvec_jiffies, | 2431 | .proc_handler = &proc_dointvec_jiffies, |
2432 | .strategy = &sysctl_jiffies, | 2432 | .strategy = &sysctl_jiffies, |
2433 | }, | 2433 | }, |
2434 | { | 2434 | { |
2435 | .ctl_name = NET_IPV6_ROUTE_MTU_EXPIRES, | 2435 | .ctl_name = NET_IPV6_ROUTE_MTU_EXPIRES, |
2436 | .procname = "mtu_expires", | 2436 | .procname = "mtu_expires", |
2437 | .data = &ip6_rt_mtu_expires, | 2437 | .data = &ip6_rt_mtu_expires, |
2438 | .maxlen = sizeof(int), | 2438 | .maxlen = sizeof(int), |
2439 | .mode = 0644, | 2439 | .mode = 0644, |
2440 | .proc_handler = &proc_dointvec_jiffies, | 2440 | .proc_handler = &proc_dointvec_jiffies, |
2441 | .strategy = &sysctl_jiffies, | 2441 | .strategy = &sysctl_jiffies, |
2442 | }, | 2442 | }, |
2443 | { | 2443 | { |
2444 | .ctl_name = NET_IPV6_ROUTE_MIN_ADVMSS, | 2444 | .ctl_name = NET_IPV6_ROUTE_MIN_ADVMSS, |
2445 | .procname = "min_adv_mss", | 2445 | .procname = "min_adv_mss", |
2446 | .data = &ip6_rt_min_advmss, | 2446 | .data = &ip6_rt_min_advmss, |
2447 | .maxlen = sizeof(int), | 2447 | .maxlen = sizeof(int), |
2448 | .mode = 0644, | 2448 | .mode = 0644, |
2449 | .proc_handler = &proc_dointvec_jiffies, | 2449 | .proc_handler = &proc_dointvec_jiffies, |
2450 | .strategy = &sysctl_jiffies, | 2450 | .strategy = &sysctl_jiffies, |
2451 | }, | 2451 | }, |
2452 | { | 2452 | { |
2453 | .ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, | 2453 | .ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, |
2454 | .procname = "gc_min_interval_ms", | 2454 | .procname = "gc_min_interval_ms", |
2455 | .data = &ip6_rt_gc_min_interval, | 2455 | .data = &ip6_rt_gc_min_interval, |
2456 | .maxlen = sizeof(int), | 2456 | .maxlen = sizeof(int), |
2457 | .mode = 0644, | 2457 | .mode = 0644, |
2458 | .proc_handler = &proc_dointvec_ms_jiffies, | 2458 | .proc_handler = &proc_dointvec_ms_jiffies, |
2459 | .strategy = &sysctl_ms_jiffies, | 2459 | .strategy = &sysctl_ms_jiffies, |
2460 | }, | 2460 | }, |
2461 | { .ctl_name = 0 } | 2461 | { .ctl_name = 0 } |