aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-03-20 19:56:32 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-20 19:56:32 -0500
commita1e783634a64d002c58391cf8150fcb80856a4fe (patch)
tree0dab259fd401c90b320dbc1832385315b1742f25 /net/ipv6/route.c
parent95a9a5ba0219a4d4237fb39703bfa58626c6fe72 (diff)
[IPV6]: ROUTE: Set appropriate information before inserting a route.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index e8855706980f..5b58a516bb16 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1221,21 +1221,24 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
1221 2. It is gatewayed route or NONEXTHOP route. Action: clone it. 1221 2. It is gatewayed route or NONEXTHOP route. Action: clone it.
1222 */ 1222 */
1223 if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) { 1223 if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) {
1224 nrt = rt6_cow(rt, daddr, saddr, NULL); 1224 nrt = rt6_alloc_cow(rt, daddr, saddr);
1225 if (!nrt->u.dst.error) { 1225 if (!nrt)
1226 nrt->u.dst.metrics[RTAX_MTU-1] = pmtu; 1226 goto out;
1227 if (allfrag) 1227
1228 nrt->u.dst.metrics[RTAX_FEATURES-1] |= RTAX_FEATURE_ALLFRAG; 1228 nrt->u.dst.metrics[RTAX_MTU-1] = pmtu;
1229 /* According to RFC 1981, detecting PMTU increase shouldn't be 1229 if (allfrag)
1230 happened within 5 mins, the recommended timer is 10 mins. 1230 nrt->u.dst.metrics[RTAX_FEATURES-1] |= RTAX_FEATURE_ALLFRAG;
1231 Here this route expiration time is set to ip6_rt_mtu_expires 1231
1232 which is 10 mins. After 10 mins the decreased pmtu is expired 1232 /* According to RFC 1981, detecting PMTU increase shouldn't be
1233 and detecting PMTU increase will be automatically happened. 1233 * happened within 5 mins, the recommended timer is 10 mins.
1234 */ 1234 * Here this route expiration time is set to ip6_rt_mtu_expires
1235 dst_set_expires(&nrt->u.dst, ip6_rt_mtu_expires); 1235 * which is 10 mins. After 10 mins the decreased pmtu is expired
1236 nrt->rt6i_flags |= RTF_DYNAMIC|RTF_EXPIRES; 1236 * and detecting PMTU increase will be automatically happened.
1237 } 1237 */
1238 dst_release(&nrt->u.dst); 1238 dst_set_expires(&nrt->u.dst, ip6_rt_mtu_expires);
1239 nrt->rt6i_flags |= RTF_DYNAMIC|RTF_EXPIRES;
1240
1241 ip6_ins_rt(nrt, NULL, NULL, NULL);
1239 } else { 1242 } else {
1240 nrt = ip6_rt_copy(rt); 1243 nrt = ip6_rt_copy(rt);
1241 if (nrt == NULL) 1244 if (nrt == NULL)