File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 4
4
#include <linux/types.h>
5
5
#include <linux/skbuff.h>
6
6
#include <linux/in6.h>
7
+ #include <uapi/linux/if_ether.h>
7
8
8
9
/**
9
10
* struct flow_dissector_key_basic:
@@ -54,12 +55,24 @@ struct flow_dissector_key_ipv6_addrs {
54
55
struct in6_addr dst ;
55
56
};
56
57
58
+ /**
59
+ * struct flow_dissector_key_eth_addrs:
60
+ * @src: source Ethernet address
61
+ * @dst: destination Ethernet address
62
+ */
63
+ struct flow_dissector_key_eth_addrs {
64
+ /* (dst,src) must be grouped, in the same way than in ETH header */
65
+ unsigned char dst [ETH_ALEN ];
66
+ unsigned char src [ETH_ALEN ];
67
+ };
68
+
57
69
enum flow_dissector_key_id {
58
70
FLOW_DISSECTOR_KEY_BASIC , /* struct flow_dissector_key_basic */
59
71
FLOW_DISSECTOR_KEY_IPV4_ADDRS , /* struct flow_dissector_key_addrs */
60
72
FLOW_DISSECTOR_KEY_IPV6_HASH_ADDRS , /* struct flow_dissector_key_addrs */
61
73
FLOW_DISSECTOR_KEY_PORTS , /* struct flow_dissector_key_ports */
62
74
FLOW_DISSECTOR_KEY_IPV6_ADDRS , /* struct flow_dissector_key_ipv6_addrs */
75
+ FLOW_DISSECTOR_KEY_ETH_ADDRS , /* struct flow_dissector_key_eth_addrs */
63
76
64
77
FLOW_DISSECTOR_KEY_MAX ,
65
78
};
Original file line number Diff line number Diff line change 14
14
#include <linux/if_pppox.h>
15
15
#include <linux/ppp_defs.h>
16
16
#include <linux/stddef.h>
17
+ #include <linux/if_ether.h>
17
18
#include <net/flow_dissector.h>
18
19
#include <scsi/fc/fc_fcoe.h>
19
20
@@ -138,6 +139,17 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
138
139
FLOW_DISSECTOR_KEY_BASIC ,
139
140
target_container );
140
141
142
+ if (skb_flow_dissector_uses_key (flow_dissector ,
143
+ FLOW_DISSECTOR_KEY_ETH_ADDRS )) {
144
+ struct ethhdr * eth = eth_hdr (skb );
145
+ struct flow_dissector_key_eth_addrs * key_eth_addrs ;
146
+
147
+ key_eth_addrs = skb_flow_dissector_target (flow_dissector ,
148
+ FLOW_DISSECTOR_KEY_ETH_ADDRS ,
149
+ target_container );
150
+ memcpy (key_eth_addrs , & eth -> h_dest , sizeof (* key_eth_addrs ));
151
+ }
152
+
141
153
again :
142
154
switch (proto ) {
143
155
case htons (ETH_P_IP ): {
You can’t perform that action at this time.
0 commit comments