lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52437454.6020407@redhat.com>
Date:	Thu, 26 Sep 2013 01:40:04 +0200
From:	Nikolay Aleksandrov <nikolay@...hat.com>
To:	netdev@...r.kernel.org
CC:	davem@...emloft.net, andy@...yhouse.net, fubar@...ibm.com,
	eric.dumazet@...il.com, vfalico@...hat.com
Subject: Re: [PATCH net-next v2 1/3] flow_dissector: factor out the ports
 extraction in skb_flow_get_ports

On 09/25/2013 08:31 PM, Nikolay Aleksandrov wrote:
> Factor out the code that extracts the ports from skb_flow_dissect and
> add a new function skb_flow_get_ports which can be re-used.
> 
> Suggested-by: Veaceslav Falico <vfalico@...hat.com>
> Signed-off-by: Nikolay Aleksandrov <nikolay@...hat.com>
> ---
> v2: new patch
> This seems like a good idea because there're other users that can re-use
> it later as well.
> 
>  include/net/flow_keys.h   |  1 +
>  net/core/flow_dissector.c | 38 +++++++++++++++++++++++++++-----------
>  2 files changed, 28 insertions(+), 11 deletions(-)
> 
> diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h
> index ac2439d..621bf11 100644
> --- a/include/net/flow_keys.h
> +++ b/include/net/flow_keys.h
> @@ -14,4 +14,5 @@ struct flow_keys {
>  };
>  
>  bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow);
> +__be32 skb_flow_get_ports(const struct sk_buff *skb, int nhoff, u8 ip_proto);
>  #endif
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index 1929af8..c609faf 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -25,9 +25,34 @@ static void iph_to_flow_copy_addrs(struct flow_keys *flow, const struct iphdr *i
>  	memcpy(&flow->src, &iph->saddr, sizeof(flow->src) + sizeof(flow->dst));
>  }
>  
> +/**
> + * skb_flow_get_ports - extract the upper layer ports and return them
> + * @skb: buffer to extract the ports from
> + * @nhoff: network header offset
I hurried too much, this should've said "offset to the end of the network
header" i.e. nhoff + sizeof(network header), I'll wait until tomorrow to
see if there aren't any other comments and will edit this and re-post a v3.

Nik


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ