summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2015-05-12 15:56:19 +0300
committerDavid S. Miller <davem@davemloft.net>2015-05-13 22:19:47 +0300
commit67a900cc0436d74e7ff89042371760def087680d (patch)
treefa8b25e4f6117d69c1714744fe8e0fdc67914408 /net
parentb924933cbbfbdcaa2831a39780c116ec6e48c397 (diff)
downloadlinux-67a900cc0436d74e7ff89042371760def087680d.tar.xz
flow_dissector: introduce support for Ethernet addresses
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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 1b95d5ccc9d6..7a0b391114a5 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -14,6 +14,7 @@
#include <linux/if_pppox.h>
#include <linux/ppp_defs.h>
#include <linux/stddef.h>
+#include <linux/if_ether.h>
#include <net/flow_dissector.h>
#include <scsi/fc/fc_fcoe.h>
@@ -138,6 +139,17 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
FLOW_DISSECTOR_KEY_BASIC,
target_container);
+ if (skb_flow_dissector_uses_key(flow_dissector,
+ FLOW_DISSECTOR_KEY_ETH_ADDRS)) {
+ struct ethhdr *eth = eth_hdr(skb);
+ struct flow_dissector_key_eth_addrs *key_eth_addrs;
+
+ key_eth_addrs = skb_flow_dissector_target(flow_dissector,
+ FLOW_DISSECTOR_KEY_ETH_ADDRS,
+ target_container);
+ memcpy(key_eth_addrs, &eth->h_dest, sizeof(*key_eth_addrs));
+ }
+
again:
switch (proto) {
case htons(ETH_P_IP): {