aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 5e3685c5c407..92f90ae46f4a 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1468,14 +1468,14 @@ unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph,
1468 1468
1469 /* BSD 4.2 compatibility hack :-( */ 1469 /* BSD 4.2 compatibility hack :-( */
1470 if (mtu == 0 && 1470 if (mtu == 0 &&
1471 old_mtu >= rth->u.dst.metrics[RTAX_MTU-1] && 1471 old_mtu >= dst_metric(&rth->u.dst, RTAX_MTU) &&
1472 old_mtu >= 68 + (iph->ihl << 2)) 1472 old_mtu >= 68 + (iph->ihl << 2))
1473 old_mtu -= iph->ihl << 2; 1473 old_mtu -= iph->ihl << 2;
1474 1474
1475 mtu = guess_mtu(old_mtu); 1475 mtu = guess_mtu(old_mtu);
1476 } 1476 }
1477 if (mtu <= rth->u.dst.metrics[RTAX_MTU-1]) { 1477 if (mtu <= dst_metric(&rth->u.dst, RTAX_MTU)) {
1478 if (mtu < rth->u.dst.metrics[RTAX_MTU-1]) { 1478 if (mtu < dst_metric(&rth->u.dst, RTAX_MTU)) {
1479 dst_confirm(&rth->u.dst); 1479 dst_confirm(&rth->u.dst);
1480 if (mtu < ip_rt_min_pmtu) { 1480 if (mtu < ip_rt_min_pmtu) {
1481 mtu = ip_rt_min_pmtu; 1481 mtu = ip_rt_min_pmtu;
@@ -1497,7 +1497,7 @@ unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph,
1497 1497
1498static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu) 1498static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
1499{ 1499{
1500 if (dst->metrics[RTAX_MTU-1] > mtu && mtu >= 68 && 1500 if (dst_metric(dst, RTAX_MTU) > mtu && mtu >= 68 &&
1501 !(dst_metric_locked(dst, RTAX_MTU))) { 1501 !(dst_metric_locked(dst, RTAX_MTU))) {
1502 if (mtu < ip_rt_min_pmtu) { 1502 if (mtu < ip_rt_min_pmtu) {
1503 mtu = ip_rt_min_pmtu; 1503 mtu = ip_rt_min_pmtu;
@@ -1613,7 +1613,7 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag)
1613 sizeof(rt->u.dst.metrics)); 1613 sizeof(rt->u.dst.metrics));
1614 if (fi->fib_mtu == 0) { 1614 if (fi->fib_mtu == 0) {
1615 rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu; 1615 rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu;
1616 if (rt->u.dst.metrics[RTAX_LOCK-1] & (1 << RTAX_MTU) && 1616 if (dst_metric_locked(&rt->u.dst, RTAX_MTU) &&
1617 rt->rt_gateway != rt->rt_dst && 1617 rt->rt_gateway != rt->rt_dst &&
1618 rt->u.dst.dev->mtu > 576) 1618 rt->u.dst.dev->mtu > 576)
1619 rt->u.dst.metrics[RTAX_MTU-1] = 576; 1619 rt->u.dst.metrics[RTAX_MTU-1] = 576;
@@ -1624,14 +1624,14 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag)
1624 } else 1624 } else
1625 rt->u.dst.metrics[RTAX_MTU-1]= rt->u.dst.dev->mtu; 1625 rt->u.dst.metrics[RTAX_MTU-1]= rt->u.dst.dev->mtu;
1626 1626
1627 if (rt->u.dst.metrics[RTAX_HOPLIMIT-1] == 0) 1627 if (dst_metric(&rt->u.dst, RTAX_HOPLIMIT) == 0)
1628 rt->u.dst.metrics[RTAX_HOPLIMIT-1] = sysctl_ip_default_ttl; 1628 rt->u.dst.metrics[RTAX_HOPLIMIT-1] = sysctl_ip_default_ttl;
1629 if (rt->u.dst.metrics[RTAX_MTU-1] > IP_MAX_MTU) 1629 if (dst_metric(&rt->u.dst, RTAX_MTU) > IP_MAX_MTU)
1630 rt->u.dst.metrics[RTAX_MTU-1] = IP_MAX_MTU; 1630 rt->u.dst.metrics[RTAX_MTU-1] = IP_MAX_MTU;
1631 if (rt->u.dst.metrics[RTAX_ADVMSS-1] == 0) 1631 if (dst_metric(&rt->u.dst, RTAX_ADVMSS) == 0)
1632 rt->u.dst.metrics[RTAX_ADVMSS-1] = max_t(unsigned int, rt->u.dst.dev->mtu - 40, 1632 rt->u.dst.metrics[RTAX_ADVMSS-1] = max_t(unsigned int, rt->u.dst.dev->mtu - 40,
1633 ip_rt_min_advmss); 1633 ip_rt_min_advmss);
1634 if (rt->u.dst.metrics[RTAX_ADVMSS-1] > 65535 - 40) 1634 if (dst_metric(&rt->u.dst, RTAX_ADVMSS) > 65535 - 40)
1635 rt->u.dst.metrics[RTAX_ADVMSS-1] = 65535 - 40; 1635 rt->u.dst.metrics[RTAX_ADVMSS-1] = 65535 - 40;
1636 1636
1637#ifdef CONFIG_NET_CLS_ROUTE 1637#ifdef CONFIG_NET_CLS_ROUTE