diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-14 22:21:46 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-14 22:22:07 -0700 |
commit | 36393395536064e483b73d173f6afc103eadfbc4 (patch) | |
tree | b45113cce1bdfc4be92a856700690a253f1bb088 /net/ipv4/raw.c | |
parent | b3908e22ad8bb6074934496ef171fd83605d7d3e (diff) | |
download | linux-stable-36393395536064e483b73d173f6afc103eadfbc4.tar.gz linux-stable-36393395536064e483b73d173f6afc103eadfbc4.tar.bz2 linux-stable-36393395536064e483b73d173f6afc103eadfbc4.zip |
ipv4: Handle PMTU in all ICMP error handlers.
With ip_rt_frag_needed() removed, we have to explicitly update PMTU
information in every ICMP error handler.
Create two helper functions to facilitate this.
1) ipv4_sk_update_pmtu()
This updates the PMTU when we have a socket context to
work with.
2) ipv4_update_pmtu()
Raw version, used when no socket context is available. For this
interface, we essentially just pass in explicit arguments for
the flow identity information we would have extracted from the
socket.
And you'll notice that ipv4_sk_update_pmtu() is simply implemented
in terms of ipv4_update_pmtu()
Note that __ip_route_output_key() is used, rather than something like
ip_route_output_flow() or ip_route_output_key(). This is because we
absolutely do not want to end up with a route that does IPSEC
encapsulation and the like. Instead, we only want the route that
would get us to the node described by the outermost IP header.
Reported-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r-- | net/ipv4/raw.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 4032b818f3e4..659ddfb10947 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -216,6 +216,9 @@ static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info) int err = 0; int harderr = 0; + if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) + ipv4_sk_update_pmtu(skb, sk, info); + /* Report error on raw socket, if: 1. User requested ip_recverr. 2. Socket is connected (otherwise the error indication |