aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-03-20 19:58:48 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-20 19:58:48 -0500
commitd5315b500b68ea921fe05fe2cbc06bcae90ff615 (patch)
treec3d063529dd6b41c81e4499e8bbd095e0c0833e9
parent299d9939089126f764090a202f2d6c69934bcf66 (diff)
[IPV6]: ROUTE: Unify two code paths for pmtu disc.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/route.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 4a8cb041f075..1a326af18f28 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1235,11 +1235,12 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
1235 1. It is connected route. Action: COW 1235 1. It is connected route. Action: COW
1236 2. It is gatewayed route or NONEXTHOP route. Action: clone it. 1236 2. It is gatewayed route or NONEXTHOP route. Action: clone it.
1237 */ 1237 */
1238 if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) { 1238 if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP))
1239 nrt = rt6_alloc_cow(rt, daddr, saddr); 1239 nrt = rt6_alloc_cow(rt, daddr, saddr);
1240 if (!nrt) 1240 else
1241 goto out; 1241 nrt = rt6_alloc_clone(rt, daddr);
1242 1242
1243 if (nrt) {
1243 nrt->u.dst.metrics[RTAX_MTU-1] = pmtu; 1244 nrt->u.dst.metrics[RTAX_MTU-1] = pmtu;
1244 if (allfrag) 1245 if (allfrag)
1245 nrt->u.dst.metrics[RTAX_FEATURES-1] |= RTAX_FEATURE_ALLFRAG; 1246 nrt->u.dst.metrics[RTAX_FEATURES-1] |= RTAX_FEATURE_ALLFRAG;
@@ -1254,18 +1255,7 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
1254 nrt->rt6i_flags |= RTF_DYNAMIC|RTF_EXPIRES; 1255 nrt->rt6i_flags |= RTF_DYNAMIC|RTF_EXPIRES;
1255 1256
1256 ip6_ins_rt(nrt, NULL, NULL, NULL); 1257 ip6_ins_rt(nrt, NULL, NULL, NULL);
1257 } else {
1258 nrt = rt6_alloc_clone(rt, daddr);
1259 if (!nrt)
1260 goto out;
1261 dst_set_expires(&nrt->u.dst, ip6_rt_mtu_expires);
1262 nrt->rt6i_flags |= RTF_DYNAMIC|RTF_EXPIRES;
1263 nrt->u.dst.metrics[RTAX_MTU-1] = pmtu;
1264 if (allfrag)
1265 nrt->u.dst.metrics[RTAX_FEATURES-1] |= RTAX_FEATURE_ALLFRAG;
1266 ip6_ins_rt(nrt, NULL, NULL, NULL);
1267 } 1258 }
1268
1269out: 1259out:
1270 dst_release(&rt->u.dst); 1260 dst_release(&rt->u.dst);
1271} 1261}