[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALx6S37wKR7KbVcOSvQHMg3x71Mqqc63-qR=r42rYQJMea8m0Q@mail.gmail.com>
Date: Wed, 24 Feb 2016 10:15:13 -0800
From: Tom Herbert <tom@...bertland.com>
To: Alexander Duyck <aduyck@...antis.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Alexander Duyck <alexander.duyck@...il.com>
Subject: Re: [net-next PATCH 4/5] flow_dissector: Use same pointer for IPv4
and IPv6 addresses
On Wed, Feb 24, 2016 at 9:29 AM, Alexander Duyck <aduyck@...antis.com> wrote:
> The IPv6 parsing was using a local pointer when it could use the same
> pointer as the IPv4 portion of the code since the key_addrs can support
> both IPv4 and IPv6 as it is just a pointer.
>
> Signed-off-by: Alexander Duyck <aduyck@...antis.com>
Acked-by: Tom Herbert <tom@...bertland.com>
> ---
> net/core/flow_dissector.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index 6288153d7f36..7c7b8739b8b8 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -220,13 +220,12 @@ ipv6:
>
> if (dissector_uses_key(flow_dissector,
> FLOW_DISSECTOR_KEY_IPV6_ADDRS)) {
> - struct flow_dissector_key_ipv6_addrs *key_ipv6_addrs;
> -
> - key_ipv6_addrs = skb_flow_dissector_target(flow_dissector,
> - FLOW_DISSECTOR_KEY_IPV6_ADDRS,
> - target_container);
> + key_addrs = skb_flow_dissector_target(flow_dissector,
> + FLOW_DISSECTOR_KEY_IPV6_ADDRS,
> + target_container);
>
> - memcpy(key_ipv6_addrs, &iph->saddr, sizeof(*key_ipv6_addrs));
> + memcpy(&key_addrs->v6addrs, &iph->saddr,
> + sizeof(key_addrs->v6addrs));
> key_control->addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
> }
>
>
Powered by blists - more mailing lists