diff options
author | Gao Feng <fgao@ikuai8.com> | 2016-07-23 11:21:47 (GMT) |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-11 22:41:08 (GMT) |
commit | e5e693ab49a95e1994979972eea224eefa81eba9 (patch) | |
tree | cf3ea62e374b6fcbeba3aa4cc089b61b3f57718d /net/netfilter/nf_conntrack_proto_udplite.c | |
parent | f08aff444ae0004c9ae6df3241fc313a5024d375 (diff) | |
download | linux-e5e693ab49a95e1994979972eea224eefa81eba9.tar.xz |
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 'net/netfilter/nf_conntrack_proto_udplite.c')
-rw-r--r-- | net/netfilter/nf_conntrack_proto_udplite.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/nf_conntrack_proto_udplite.c b/net/netfilter/nf_conntrack_proto_udplite.c index 9d692f5..029206e 100644 --- a/net/netfilter/nf_conntrack_proto_udplite.c +++ b/net/netfilter/nf_conntrack_proto_udplite.c @@ -54,7 +54,8 @@ static bool udplite_pkt_to_tuple(const struct sk_buff *skb, const struct udphdr *hp; struct udphdr _hdr; - hp = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr); + /* Actually only need first 4 bytes to get ports. */ + hp = skb_header_pointer(skb, dataoff, 4, &_hdr); if (hp == NULL) return false; |