forked from rubenslte/android_kernel_samsung_msm8226
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. Change-Id: Ibac77b728baba05841286ea5a8a2089d56e6ad65 Signed-off-by: Patrick McHardy <kaber@trash.net> Acked-by: Eric Dumazet <edumazet@google.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
This commit is contained in:
committed by
Francescodario Cuzzocrea
parent
82a0debf71
commit
8832193715
@@ -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
|
||||
|
||||
@@ -43,6 +43,8 @@ struct inet_skb_parm {
|
||||
#define IPSKB_FRAG_COMPLETE BIT(3)
|
||||
#define IPSKB_REROUTED BIT(4)
|
||||
#define IPSKB_DOREDIRECT BIT(5)
|
||||
|
||||
u16 frag_max_size;
|
||||
};
|
||||
|
||||
static inline unsigned int ip_hdrlen(const struct sk_buff *skb)
|
||||
|
||||
Reference in New Issue
Block a user