From: Alexander Duyck Date: Wed, 24 Feb 2016 17:29:57 +0000 (-0800) Subject: flow_dissector: Use same pointer for IPv4 and IPv6 addresses X-Git-Tag: v4.9.8~2476^2~196^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3c3106ce3f4646a008cd238b16f899ae14fd2a7;p=platform%2Fkernel%2Flinux-rpi3.git flow_dissector: Use same pointer for IPv4 and IPv6 addresses 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 Acked-by: Tom Herbert Signed-off-by: David S. Miller --- diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 6288153..7c7b873 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; }