Skip to content

Commit

Permalink
ipv4: Don't create nh exeption when the device mtu is smaller than th…
Browse files Browse the repository at this point in the history
…e reported pmtu

When a local tool like tracepath tries to send packets bigger than
the device mtu, we create a nh exeption and set the pmtu to device
mtu. The device mtu does not expire, so check if the device mtu is
smaller than the reported pmtu and don't crerate a nh exeption in
that case.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Steffen Klassert authored and David S. Miller committed Oct 8, 2012
1 parent d851c12 commit 7f92d33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,9 @@ static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
struct dst_entry *dst = &rt->dst;
struct fib_result res;

if (dst->dev->mtu < mtu)
return;

if (mtu < ip_rt_min_pmtu)
mtu = ip_rt_min_pmtu;

Expand Down

0 comments on commit 7f92d33

Please sign in to comment.