summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2015-05-12 14:56:20 +0200
committerDavid S. Miller <davem@davemloft.net>2015-05-13 21:19:47 +0200
commit59346afe7a5548ab3e9730aeff33993faa76abbe (patch)
tree6329cc2967ff9acc3f93d8f8df7b54d05b2e5e72 /net
parentflow_dissector: introduce support for Ethernet addresses (diff)
downloadlinux-59346afe7a5548ab3e9730aeff33993faa76abbe.tar.xz
linux-59346afe7a5548ab3e9730aeff33993faa76abbe.zip
flow_dissector: change port array into src, dst tuple
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/flow_dissector.c4
-rw-r--r--net/sched/cls_flow.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 7a0b391114a5..204d09c42510 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -385,9 +385,9 @@ static inline u32 __flow_hash_from_keys(struct flow_keys *keys, u32 keyval)
/* get a consistent hash (same value on both flow directions) */
if (((__force u32)keys->addrs.dst < (__force u32)keys->addrs.src) ||
(((__force u32)keys->addrs.dst == (__force u32)keys->addrs.src) &&
- ((__force u16)keys->ports.port16[1] < (__force u16)keys->ports.port16[0]))) {
+ ((__force u16)keys->ports.dst < (__force u16)keys->ports.src))) {
swap(keys->addrs.dst, keys->addrs.src);
- swap(keys->ports.port16[0], keys->ports.port16[1]);
+ swap(keys->ports.src, keys->ports.dst);
}
hash = __flow_hash_3words((__force u32)keys->addrs.dst,
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c
index 4b3e3e30bf4d..b4359924846c 100644
--- a/net/sched/cls_flow.c
+++ b/net/sched/cls_flow.c
@@ -88,7 +88,7 @@ static u32 flow_get_proto(const struct sk_buff *skb, const struct flow_keys *flo
static u32 flow_get_proto_src(const struct sk_buff *skb, const struct flow_keys *flow)
{
if (flow->ports.ports)
- return ntohs(flow->ports.port16[0]);
+ return ntohs(flow->ports.src);
return addr_fold(skb->sk);
}
@@ -96,7 +96,7 @@ static u32 flow_get_proto_src(const struct sk_buff *skb, const struct flow_keys
static u32 flow_get_proto_dst(const struct sk_buff *skb, const struct flow_keys *flow)
{
if (flow->ports.ports)
- return ntohs(flow->ports.port16[1]);
+ return ntohs(flow->ports.dst);
return addr_fold(skb_dst(skb)) ^ (__force u16) tc_skb_protocol(skb);
}