Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d975ddd6 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller
Browse files

eth: Pull header from first fragment via eth_get_headlen



We want to try and pull the L4 header in if it is available in the first
fragment.  As such add the flag to indicate we want to pull the headers on
the first fragment in.

Signed-off-by: default avatarAlexander Duyck <aduyck@mirantis.com>
Acked-by: default avatarTom Herbert <tom@herbertland.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b3c3106c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -125,6 +125,7 @@ EXPORT_SYMBOL(eth_header);
 */
 */
u32 eth_get_headlen(void *data, unsigned int len)
u32 eth_get_headlen(void *data, unsigned int len)
{
{
	const unsigned int flags = FLOW_DISSECTOR_F_PARSE_1ST_FRAG;
	const struct ethhdr *eth = (const struct ethhdr *)data;
	const struct ethhdr *eth = (const struct ethhdr *)data;
	struct flow_keys keys;
	struct flow_keys keys;


@@ -134,7 +135,7 @@ u32 eth_get_headlen(void *data, unsigned int len)


	/* parse any remaining L2/L3 headers, check for L4 */
	/* parse any remaining L2/L3 headers, check for L4 */
	if (!skb_flow_dissect_flow_keys_buf(&keys, data, eth->h_proto,
	if (!skb_flow_dissect_flow_keys_buf(&keys, data, eth->h_proto,
					    sizeof(*eth), len, 0))
					    sizeof(*eth), len, flags))
		return max_t(u32, keys.control.thoff, sizeof(*eth));
		return max_t(u32, keys.control.thoff, sizeof(*eth));


	/* parse for any L4 headers */
	/* parse for any L4 headers */