diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2011-11-22 21:13:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-26 14:29:51 -0500 |
commit | 618f9bc74a039da76fa027ac2600c5b785b964c5 (patch) | |
tree | ff69bc14b711c9c9d4c691d2a8c262401d62c8c9 /net/ipv4 | |
parent | ebb762f27fed083cb993a0816393aba4615f6544 (diff) |
net: Move mtu handling down to the protocol depended handlers
We move all mtu handling from dst_mtu() down to the protocol
layer. So each protocol can implement the mtu handling in
a different manner.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/route.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index f1ac3efc5524..11d1b2080a16 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1816,7 +1816,12 @@ static unsigned int ipv4_default_advmss(const struct dst_entry *dst) | |||
1816 | 1816 | ||
1817 | static unsigned int ipv4_mtu(const struct dst_entry *dst) | 1817 | static unsigned int ipv4_mtu(const struct dst_entry *dst) |
1818 | { | 1818 | { |
1819 | unsigned int mtu = dst->dev->mtu; | 1819 | unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); |
1820 | |||
1821 | if (mtu) | ||
1822 | return mtu; | ||
1823 | |||
1824 | mtu = dst->dev->mtu; | ||
1820 | 1825 | ||
1821 | if (unlikely(dst_metric_locked(dst, RTAX_MTU))) { | 1826 | if (unlikely(dst_metric_locked(dst, RTAX_MTU))) { |
1822 | const struct rtable *rt = (const struct rtable *) dst; | 1827 | const struct rtable *rt = (const struct rtable *) dst; |
@@ -2757,7 +2762,9 @@ static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 coo | |||
2757 | 2762 | ||
2758 | static unsigned int ipv4_blackhole_mtu(const struct dst_entry *dst) | 2763 | static unsigned int ipv4_blackhole_mtu(const struct dst_entry *dst) |
2759 | { | 2764 | { |
2760 | return dst->dev->mtu; | 2765 | unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); |
2766 | |||
2767 | return mtu ? : dst->dev->mtu; | ||
2761 | } | 2768 | } |
2762 | 2769 | ||
2763 | static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) | 2770 | static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) |