Commit 6d273f8d authored by Rami Rosen's avatar Rami Rosen Committed by David S. Miller

ipv4: replace dst_metric() with dst_mtu() in net/ipv4/route.c.

This patch replaces dst_metric() with dst_mtu() in net/ipv4/route.c.
Signed-off-by: default avatarRami Rosen <ramirose@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0967d61e
...@@ -1509,14 +1509,14 @@ unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, ...@@ -1509,14 +1509,14 @@ unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph,
/* BSD 4.2 compatibility hack :-( */ /* BSD 4.2 compatibility hack :-( */
if (mtu == 0 && if (mtu == 0 &&
old_mtu >= dst_metric(&rth->u.dst, RTAX_MTU) && old_mtu >= dst_mtu(&rth->u.dst) &&
old_mtu >= 68 + (iph->ihl << 2)) old_mtu >= 68 + (iph->ihl << 2))
old_mtu -= iph->ihl << 2; old_mtu -= iph->ihl << 2;
mtu = guess_mtu(old_mtu); mtu = guess_mtu(old_mtu);
} }
if (mtu <= dst_metric(&rth->u.dst, RTAX_MTU)) { if (mtu <= dst_mtu(&rth->u.dst)) {
if (mtu < dst_metric(&rth->u.dst, RTAX_MTU)) { if (mtu < dst_mtu(&rth->u.dst)) {
dst_confirm(&rth->u.dst); dst_confirm(&rth->u.dst);
if (mtu < ip_rt_min_pmtu) { if (mtu < ip_rt_min_pmtu) {
mtu = ip_rt_min_pmtu; mtu = ip_rt_min_pmtu;
...@@ -1538,7 +1538,7 @@ unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, ...@@ -1538,7 +1538,7 @@ unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph,
static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu) static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
{ {
if (dst_metric(dst, RTAX_MTU) > mtu && mtu >= 68 && if (dst_mtu(dst) > mtu && mtu >= 68 &&
!(dst_metric_locked(dst, RTAX_MTU))) { !(dst_metric_locked(dst, RTAX_MTU))) {
if (mtu < ip_rt_min_pmtu) { if (mtu < ip_rt_min_pmtu) {
mtu = ip_rt_min_pmtu; mtu = ip_rt_min_pmtu;
...@@ -1667,7 +1667,7 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag) ...@@ -1667,7 +1667,7 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag)
if (dst_metric(&rt->u.dst, RTAX_HOPLIMIT) == 0) if (dst_metric(&rt->u.dst, RTAX_HOPLIMIT) == 0)
rt->u.dst.metrics[RTAX_HOPLIMIT-1] = sysctl_ip_default_ttl; rt->u.dst.metrics[RTAX_HOPLIMIT-1] = sysctl_ip_default_ttl;
if (dst_metric(&rt->u.dst, RTAX_MTU) > IP_MAX_MTU) if (dst_mtu(&rt->u.dst) > IP_MAX_MTU)
rt->u.dst.metrics[RTAX_MTU-1] = IP_MAX_MTU; rt->u.dst.metrics[RTAX_MTU-1] = IP_MAX_MTU;
if (dst_metric(&rt->u.dst, RTAX_ADVMSS) == 0) if (dst_metric(&rt->u.dst, RTAX_ADVMSS) == 0)
rt->u.dst.metrics[RTAX_ADVMSS-1] = max_t(unsigned int, rt->u.dst.dev->mtu - 40, rt->u.dst.metrics[RTAX_ADVMSS-1] = max_t(unsigned int, rt->u.dst.dev->mtu - 40,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment