Commit 8306b688 authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller

flow_dissector: Add flag to stop parsing at L3

Add an input flag to flow dissector on rather dissection should be
stopped when an L3 packet is encountered. This would be useful if a
caller just wanted to get IP addresses of the outermost header (e.g.
to do an L3 hash).
Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b840f28b
...@@ -125,6 +125,7 @@ enum flow_dissector_key_id { ...@@ -125,6 +125,7 @@ enum flow_dissector_key_id {
}; };
#define FLOW_DISSECTOR_F_PARSE_1ST_FRAG BIT(0) #define FLOW_DISSECTOR_F_PARSE_1ST_FRAG BIT(0)
#define FLOW_DISSECTOR_F_STOP_AT_L3 BIT(1)
struct flow_dissector_key { struct flow_dissector_key {
enum flow_dissector_key_id key_id; enum flow_dissector_key_id key_id;
......
...@@ -200,6 +200,9 @@ bool __skb_flow_dissect(const struct sk_buff *skb, ...@@ -200,6 +200,9 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
} }
} }
if (flags & FLOW_DISSECTOR_F_STOP_AT_L3)
goto out_good;
break; break;
} }
case htons(ETH_P_IPV6): { case htons(ETH_P_IPV6): {
...@@ -238,6 +241,9 @@ bool __skb_flow_dissect(const struct sk_buff *skb, ...@@ -238,6 +241,9 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
} }
} }
if (flags & FLOW_DISSECTOR_F_STOP_AT_L3)
goto out_good;
break; break;
} }
case htons(ETH_P_8021AD): case htons(ETH_P_8021AD):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment