mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
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: 6b5dc98e8f
("netfilter: rt: add support to fetch path mss")
Reported-by: Matteo Croce <technoboy85@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
d11dd6cdc3
commit
1aff64715e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user