net: Get rid of IPv6 hash addresses flow keys
authorTom Herbert <tom@herbertland.com>
Thu, 4 Jun 2015 16:16:42 +0000 (09:16 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Jun 2015 22:44:31 +0000 (15:44 -0700)
We don't need to return the IPv6 address hash as part of flow keys.
In general, using the IPv6 address hash is risky in a hash value
since the underlying use of xor provides no entropy. If someone
really needs the hash value they can get it from the full IPv6
addresses in flow keys (e.g. from flow_get_u32_src).

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/flow_dissector.h
net/core/flow_dissector.c

index 3ee606a547755328b415d6b6a53d5a4238dd7217..59f00f90fc6bdfd5c98a837ca195d48035709f16 100644 (file)
@@ -103,7 +103,6 @@ enum flow_dissector_key_id {
        FLOW_DISSECTOR_KEY_BASIC, /* struct flow_dissector_key_basic */
        FLOW_DISSECTOR_KEY_IPV4_ADDRS, /* struct flow_dissector_key_ipv4_addrs */
        FLOW_DISSECTOR_KEY_IPV6_ADDRS, /* struct flow_dissector_key_ipv6_addrs */
-       FLOW_DISSECTOR_KEY_IPV6_HASH_ADDRS, /* struct flow_dissector_key_addrs */
        FLOW_DISSECTOR_KEY_PORTS, /* struct flow_dissector_key_ports */
        FLOW_DISSECTOR_KEY_ETH_ADDRS, /* struct flow_dissector_key_eth_addrs */
        FLOW_DISSECTOR_KEY_TIPC_ADDRS, /* struct flow_dissector_key_tipc_addrs */
index 91861c3d45a7e723e12432a1d40ca05e53895981..5348a468de789053cd089c7df5e795f1aecd6e68 100644 (file)
@@ -199,19 +199,6 @@ ipv6:
                ip_proto = iph->nexthdr;
                nhoff += sizeof(struct ipv6hdr);
 
-               if (skb_flow_dissector_uses_key(flow_dissector,
-                                               FLOW_DISSECTOR_KEY_IPV6_HASH_ADDRS)) {
-                       key_addrs = skb_flow_dissector_target(flow_dissector,
-                                                             FLOW_DISSECTOR_KEY_IPV6_HASH_ADDRS,
-                                                             target_container);
-
-                       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_IPV4_ADDRS;
-                       goto flow_label;
-               }
                if (skb_flow_dissector_uses_key(flow_dissector,
                                                FLOW_DISSECTOR_KEY_IPV6_ADDRS)) {
                        struct flow_dissector_key_ipv6_addrs *key_ipv6_addrs;
@@ -650,10 +637,6 @@ static const struct flow_dissector_key flow_keys_dissector_keys[] = {
                .key_id = FLOW_DISSECTOR_KEY_IPV6_ADDRS,
                .offset = offsetof(struct flow_keys, addrs.v6addrs),
        },
-       {
-               .key_id = FLOW_DISSECTOR_KEY_IPV6_HASH_ADDRS,
-               .offset = offsetof(struct flow_keys, addrs.v4addrs),
-       },
        {
                .key_id = FLOW_DISSECTOR_KEY_TIPC_ADDRS,
                .offset = offsetof(struct flow_keys, addrs.tipcaddrs),