Skip to content

Commit

Permalink
ipv4: replace dst_metric() with dst_mtu() in net/ipv4/route.c.
Browse files Browse the repository at this point in the history
This patch replaces dst_metric() with dst_mtu() in net/ipv4/route.c.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rami Rosen authored and David S. Miller committed Aug 6, 2008
1 parent 0967d61 commit 6d273f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1509,14 +1509,14 @@ unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph,

/* BSD 4.2 compatibility hack :-( */
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 -= iph->ihl << 2;

mtu = guess_mtu(old_mtu);
}
if (mtu <= dst_metric(&rth->u.dst, RTAX_MTU)) {
if (mtu < dst_metric(&rth->u.dst, RTAX_MTU)) {
if (mtu <= dst_mtu(&rth->u.dst)) {
if (mtu < dst_mtu(&rth->u.dst)) {
dst_confirm(&rth->u.dst);
if (mtu < ip_rt_min_pmtu) {
mtu = ip_rt_min_pmtu;
Expand All @@ -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)
{
if (dst_metric(dst, RTAX_MTU) > mtu && mtu >= 68 &&
if (dst_mtu(dst) > mtu && mtu >= 68 &&
!(dst_metric_locked(dst, RTAX_MTU))) {
if (mtu < ip_rt_min_pmtu) {
mtu = ip_rt_min_pmtu;
Expand Down Expand Up @@ -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)
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;
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,
Expand Down

0 comments on commit 6d273f8

Please sign in to comment.