aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_conntrack_proto_tcp.c
diff options
context:
space:
mode:
authorGao Feng <fgao@ikuai8.com>2016-07-23 19:21:47 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2016-08-12 00:41:08 +0200
commite5e693ab49a95e1994979972eea224eefa81eba9 (patch)
treecf3ea62e374b6fcbeba3aa4cc089b61b3f57718d /net/netfilter/nf_conntrack_proto_tcp.c
parentnet: ethernet: renesas: sh_eth: use new api ethtool_{get|set}_link_ksettings (diff)
downloadlinux-dev-e5e693ab49a95e1994979972eea224eefa81eba9.tar.xz
linux-dev-e5e693ab49a95e1994979972eea224eefa81eba9.zip
netfilter: conntrack: Only need first 4 bytes to get l4proto ports
We only need first 4 bytes instead of 8 bytes to get the ports of tcp/udp/dccp/sctp/udplite in their pkt_to_tuple function. Signed-off-by: Gao Feng <fgao@ikuai8.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to '')
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 70c8381641a7..4abe9e1f8909 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -282,8 +282,8 @@ static bool tcp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,
const struct tcphdr *hp;
struct tcphdr _hdr;
- /* Actually only need first 8 bytes. */
- hp = skb_header_pointer(skb, dataoff, 8, &_hdr);
+ /* Actually only need first 4 bytes to get ports. */
+ hp = skb_header_pointer(skb, dataoff, 4, &_hdr);
if (hp == NULL)
return false;