summaryrefslogtreecommitdiff
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2011-11-23 06:13:31 +0400
committerDavid S. Miller <davem@davemloft.net>2011-11-26 23:29:51 +0400
commit618f9bc74a039da76fa027ac2600c5b785b964c5 (patch)
treeff69bc14b711c9c9d4c691d2a8c262401d62c8c9 /net/ipv4/route.c
parentebb762f27fed083cb993a0816393aba4615f6544 (diff)
downloadlinux-618f9bc74a039da76fa027ac2600c5b785b964c5.tar.xz
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/route.c')
-rw-r--r--net/ipv4/route.c11
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)
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;
@@ -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)