summaryrefslogtreecommitdiff
path: root/include/net/flow_dissector.h
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2019-04-22 18:55:44 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2019-04-23 19:36:33 +0300
commit089b19a9204fc090793d389a265f54124eacb05d (patch)
tree66e9a7497cc7c7444866bda214ea14bd6b66f1ae /include/net/flow_dissector.h
parent7e6e185c74dd8a8dc539300c079adc6bc27045d6 (diff)
downloadlinux-089b19a9204fc090793d389a265f54124eacb05d.tar.xz
flow_dissector: switch kernel context to struct bpf_flow_dissector
struct bpf_flow_dissector has a small subset of sk_buff fields that flow dissector BPF program is allowed to access and an optional pointer to real skb. Real skb is used only in bpf_skb_load_bytes helper to read non-linear data. The real motivation for this is to be able to call flow dissector from eth_get_headlen context where we don't have an skb and need to dissect raw bytes. Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/net/flow_dissector.h')
-rw-r--r--include/net/flow_dissector.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h
index 2b26979efb48..7c5a8d9a8d2a 100644
--- a/include/net/flow_dissector.h
+++ b/include/net/flow_dissector.h
@@ -305,4 +305,11 @@ static inline void *skb_flow_dissector_target(struct flow_dissector *flow_dissec
return ((char *)target_container) + flow_dissector->offset[key_id];
}
+struct bpf_flow_dissector {
+ struct bpf_flow_keys *flow_keys;
+ const struct sk_buff *skb;
+ void *data;
+ void *data_end;
+};
+
#endif