[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHA+R7PWHdAa9Tc5zHkx7k8+7NH_M5_9OF8vO3aOVQRw0NkyAw@mail.gmail.com>
Date: Thu, 21 May 2015 21:16:58 -0700
From: Cong Wang <cwang@...pensource.com>
To: Tom Herbert <tom@...bertland.com>
Cc: David Miller <davem@...emloft.net>,
Jiří Pírko <jiri@...nulli.us>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH v4 net-next 05/11] net: Add full IPv6 addresses to flow_keys
On Thu, May 21, 2015 at 5:11 PM, Tom Herbert <tom@...bertland.com> wrote:
> static inline void ip6_set_txhash(struct sock *sk)
> {
> @@ -700,8 +714,11 @@ static inline void ip6_set_txhash(struct sock *sk)
>
> memset(&keys, 0, sizeof(keys));
>
> - keys.addrs.src = (__force __be32)ipv6_addr_hash(&np->saddr);
> - keys.addrs.dst = (__force __be32)ipv6_addr_hash(&sk->sk_v6_daddr);
> + memcpy(&keys.addrs.v6addrs.src, &np->saddr,
> + sizeof(keys.addrs.v6addrs.src));
> + memcpy(&keys.addrs.v6addrs.dst, &sk->sk_v6_daddr,
> + sizeof(keys.addrs.v6addrs.dst));
> + keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
> keys.ports.src = inet->inet_sport;
> keys.ports.dst = inet->inet_dport;
>
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index 017fb84..d77619f 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -178,10 +178,12 @@ ip:
> if (!skb_flow_dissector_uses_key(flow_dissector,
> FLOW_DISSECTOR_KEY_IPV4_ADDRS))
> break;
> +
> key_addrs = skb_flow_dissector_target(flow_dissector,
> - FLOW_DISSECTOR_KEY_IPV4_ADDRS,
> - target_container);
> - memcpy(key_addrs, &iph->saddr, sizeof(*key_addrs));
> + FLOW_DISSECTOR_KEY_IPV4_ADDRS, target_container);
> + memcpy(&key_addrs->v4addrs, &iph->saddr,
> + sizeof(key_addrs->v4addrs));
> + key_control->addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
> break;
> }
> case htons(ETH_P_IPV6): {
> @@ -203,8 +205,11 @@ ipv6:
> FLOW_DISSECTOR_KEY_IPV6_HASH_ADDRS,
> target_container);
>
> - key_addrs->src = (__force __be32)ipv6_addr_hash(&iph->saddr);
> - key_addrs->dst = (__force __be32)ipv6_addr_hash(&iph->daddr);
> + key_addrs->v4addrs.src =
> + (__force __be32)ipv6_addr_hash(&iph->saddr);
> + key_addrs->v4addrs.dst =
> + (__force __be32)ipv6_addr_hash(&iph->daddr);
> + key_control->addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
Comparing with the change in ip6_set_txhash(), this one reads odd, not sure
if you do this intentionally?
--
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