Commit 1aff6471 authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso

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: 6b5dc98e ("netfilter: rt: add support to fetch path mss")
Reported-by: default avatarMatteo Croce <technoboy85@gmail.com>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent d11dd6cd
...@@ -35,10 +35,11 @@ static u16 get_tcpmss(const struct nft_pktinfo *pkt, const struct dst_entry *skb ...@@ -35,10 +35,11 @@ static u16 get_tcpmss(const struct nft_pktinfo *pkt, const struct dst_entry *skb
switch (nft_pf(pkt)) { switch (nft_pf(pkt)) {
case NFPROTO_IPV4: case NFPROTO_IPV4:
fl.u.ip4.daddr = ip_hdr(skb)->saddr; fl.u.ip4.daddr = ip_hdr(skb)->saddr;
minlen = sizeof(struct iphdr); minlen = sizeof(struct iphdr) + sizeof(struct tcphdr);
break; break;
case NFPROTO_IPV6: case NFPROTO_IPV6:
fl.u.ip6.daddr = ipv6_hdr(skb)->saddr; fl.u.ip6.daddr = ipv6_hdr(skb)->saddr;
minlen = sizeof(struct ipv6hdr) + sizeof(struct tcphdr);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment