diff mbox

[1/1] netfilter: udp: Only get 8 bytes header in udp_pkt_to_tuple to keep consistent with tcp_pkt_to_tuple and comments

Message ID 1469089774-21818-1-git-send-email-fgao@ikuai8.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

高峰 July 21, 2016, 8:29 a.m. UTC
From: Gao Feng <fgao@ikuai8.com>

Signed-off-by: Gao Feng <fgao@ikuai8.com>
---
 net/netfilter/nf_conntrack_proto_udp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Florian Westphal July 21, 2016, 9:10 a.m. UTC | #1
fgao@ikuai8.com <fgao@ikuai8.com> wrote:
> From: Gao Feng <fgao@ikuai8.com>
> 
> Signed-off-by: Gao Feng <fgao@ikuai8.com>
> ---
>  net/netfilter/nf_conntrack_proto_udp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
> index 4fd0405..a886a8a 100644
> --- a/net/netfilter/nf_conntrack_proto_udp.c
> +++ b/net/netfilter/nf_conntrack_proto_udp.c
> @@ -45,7 +45,7 @@ static bool udp_pkt_to_tuple(const struct sk_buff *skb,
>  	struct udphdr _hdr;
>  
>  	/* Actually only need first 8 bytes. */
> -	hp = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr);
> +	hp = skb_header_pointer(skb, dataoff, 8, &_hdr);

This comment is a bit misleading; sizeof(udphdr) is 8 bytes so
this patch has no effect.
diff mbox

Patch

diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
index 4fd0405..a886a8a 100644
--- a/net/netfilter/nf_conntrack_proto_udp.c
+++ b/net/netfilter/nf_conntrack_proto_udp.c
@@ -45,7 +45,7 @@  static bool udp_pkt_to_tuple(const struct sk_buff *skb,
 	struct udphdr _hdr;
 
 	/* Actually only need first 8 bytes. */
-	hp = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr);
+	hp = skb_header_pointer(skb, dataoff, 8, &_hdr);
 	if (hp == NULL)
 		return false;