netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Duyck <aduyck@mirantis.com>
To: netdev@vger.kernel.org, davem@davemloft.net, alexander.duyck@gmail.com
Subject: [net-next PATCH 4/5] flow_dissector: Use same pointer for IPv4 and IPv6 addresses
Date: Wed, 24 Feb 2016 09:29:57 -0800	[thread overview]
Message-ID: <20160224172957.12339.12061.stgit@localhost.localdomain> (raw)
In-Reply-To: <20160224172644.12339.92679.stgit@localhost.localdomain>

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@mirantis.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;
 		}
 

  parent reply	other threads:[~2016-02-24 17:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 17:29 [net-next PATCH 0/5] Flow dissector fixes and improvements Alexander Duyck
2016-02-24 17:29 ` [net-next PATCH 1/5] flow_dissector: Check for IP fragmentation even if not using IPv4 address Alexander Duyck
2016-02-24 18:14   ` Tom Herbert
2016-02-24 17:29 ` [net-next PATCH 2/5] flow_dissector: Fix fragment handling for header length computation Alexander Duyck
2016-02-24 18:14   ` Tom Herbert
2016-02-24 17:29 ` [net-next PATCH 3/5] flow_dissector: Correctly handle parsing FCoE Alexander Duyck
2016-02-24 18:14   ` Tom Herbert
2016-02-24 17:29 ` Alexander Duyck [this message]
2016-02-24 18:15   ` [net-next PATCH 4/5] flow_dissector: Use same pointer for IPv4 and IPv6 addresses Tom Herbert
2016-02-24 17:30 ` [net-next PATCH 5/5] eth: Pull header from first fragment via eth_get_headlen Alexander Duyck
2016-02-24 18:15   ` Tom Herbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160224172957.12339.12061.stgit@localhost.localdomain \
    --to=aduyck@mirantis.com \
    --cc=alexander.duyck@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).