Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276232
b: refs/heads/master
c: 618f9bc
h: refs/heads/master
v: v3
  • Loading branch information
Steffen Klassert authored and David S. Miller committed Nov 26, 2011
1 parent f323416 commit 4ccf6c2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ebb762f27fed083cb993a0816393aba4615f6544
refs/heads/master: 618f9bc74a039da76fa027ac2600c5b785b964c5
7 changes: 1 addition & 6 deletions trunk/include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,7 @@ dst_feature(const struct dst_entry *dst, u32 feature)

static inline u32 dst_mtu(const struct dst_entry *dst)
{
u32 mtu = dst_metric_raw(dst, RTAX_MTU);

if (!mtu)
mtu = dst->ops->mtu(dst);

return mtu;
return dst->ops->mtu(dst);
}

/* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */
Expand Down
4 changes: 3 additions & 1 deletion trunk/net/decnet/dn_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,9 @@ static unsigned int dn_dst_default_advmss(const struct dst_entry *dst)

static unsigned int dn_dst_mtu(const struct dst_entry *dst)
{
return dst->dev->mtu;
unsigned int mtu = dst_metric_raw(dst, RTAX_MTU);

return mtu ? : dst->dev->mtu;
}

static struct neighbour *dn_dst_neigh_lookup(const struct dst_entry *dst, const void *daddr)
Expand Down
11 changes: 9 additions & 2 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,12 @@ static unsigned int ipv4_default_advmss(const struct dst_entry *dst)

static unsigned int ipv4_mtu(const struct dst_entry *dst)
{
unsigned int mtu = dst->dev->mtu;
unsigned int mtu = dst_metric_raw(dst, RTAX_MTU);

if (mtu)
return mtu;

mtu = dst->dev->mtu;

if (unlikely(dst_metric_locked(dst, RTAX_MTU))) {
const struct rtable *rt = (const struct rtable *) dst;
Expand Down Expand Up @@ -2757,7 +2762,9 @@ static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 coo

static unsigned int ipv4_blackhole_mtu(const struct dst_entry *dst)
{
return dst->dev->mtu;
unsigned int mtu = dst_metric_raw(dst, RTAX_MTU);

return mtu ? : dst->dev->mtu;
}

static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)
Expand Down
11 changes: 9 additions & 2 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ static struct dst_ops ip6_dst_ops_template = {

static unsigned int ip6_blackhole_mtu(const struct dst_entry *dst)
{
return dst->dev->mtu;
unsigned int mtu = dst_metric_raw(dst, RTAX_MTU);

return mtu ? : dst->dev->mtu;
}

static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)
Expand Down Expand Up @@ -1043,8 +1045,13 @@ static unsigned int ip6_default_advmss(const struct dst_entry *dst)

static unsigned int ip6_mtu(const struct dst_entry *dst)
{
unsigned int mtu = IPV6_MIN_MTU;
struct inet6_dev *idev;
unsigned int mtu = dst_metric_raw(dst, RTAX_MTU);

if (mtu)
return mtu;

mtu = IPV6_MIN_MTU;

rcu_read_lock();
idev = __in6_dev_get(dst->dev);
Expand Down
4 changes: 3 additions & 1 deletion trunk/net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2384,7 +2384,9 @@ static unsigned int xfrm_default_advmss(const struct dst_entry *dst)

static unsigned int xfrm_mtu(const struct dst_entry *dst)
{
return dst_mtu(dst->path);
unsigned int mtu = dst_metric_raw(dst, RTAX_MTU);

return mtu ? : dst_mtu(dst->path);
}

static struct neighbour *xfrm_neigh_lookup(const struct dst_entry *dst, const void *daddr)
Expand Down

0 comments on commit 4ccf6c2

Please sign in to comment.