Skip to contentSkip to conversation

netfilter: rt: account for tcp header size too

PATCH Applied Florian Westphal 2 participants 2 messages Aug 28, 2017

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: rt: account for tcp header size too

This needs to accout for the ipv4/ipv6 header size and the tcp header without options.

Fixes 6b5dc98e8fac0 ("netfilter: rt: add support to fetch path mss")
---
 net/netfilter/nft_rt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nft_rt.c +2 -1
index e142e65d3176..8a49b5b54ede 100644
@@ -35,10 +35,11 @@ static u16 get_tcpmss(const struct nft_pktinfo *pkt, const struct dst_entry *skb
 	switch (nft_pf(pkt)) {
 	case NFPROTO_IPV4:
 		fl.u.ip4.daddr = ip_hdr(skb)->saddr;
-		minlen = sizeof(struct iphdr);
+		minlen = sizeof(struct iphdr) + sizeof(struct tcphdr);
 		break;
 	case NFPROTO_IPV6:
 		fl.u.ip6.daddr = ipv6_hdr(skb)->saddr;
+		minlen = sizeof(struct ipv6hdr) + sizeof(struct tcphdr);
 		break;
 	}
 
Signature · 1 line
2.13.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Florian Westphal

This needs to accout for the ipv4/ipv6 header size and the tcp header without options.

Applied, thanks.