mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
ipv4: fix path MTU discovery with connection tracking
IPv4 conntrack defragments incoming packet at the PRE_ROUTING hook and (in case of forwarded packets) refragments them at POST_ROUTING independent of the IP_DF flag. Refragmentation uses the dst_mtu() of the local route without caring about the original fragment sizes, thereby breaking PMTUD. This patch fixes this by keeping track of the largest received fragment with IP_DF set and generates an ICMP fragmentation required error during refragmentation if that size exceeds the MTU. Signed-off-by: Patrick McHardy <kaber@trash.net> Acked-by: Eric Dumazet <edumazet@google.com> Acked-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0fa7fa98db
commit
5f2d04f1f9
4 changed files with 14 additions and 2 deletions
|
|
@ -29,6 +29,8 @@ struct inet_frag_queue {
|
|||
#define INET_FRAG_COMPLETE 4
|
||||
#define INET_FRAG_FIRST_IN 2
|
||||
#define INET_FRAG_LAST_IN 1
|
||||
|
||||
u16 max_size;
|
||||
};
|
||||
|
||||
#define INETFRAGS_HASHSZ 64
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ struct inet_skb_parm {
|
|||
#define IPSKB_XFRM_TRANSFORMED 4
|
||||
#define IPSKB_FRAG_COMPLETE 8
|
||||
#define IPSKB_REROUTED 16
|
||||
|
||||
u16 frag_max_size;
|
||||
};
|
||||
|
||||
static inline unsigned int ip_hdrlen(const struct sk_buff *skb)
|
||||
|
|
|
|||
Loading…
Reference in a new issue