eth.c (10b89ee43e849544eddfe34e535341fc077464ec) eth.c (06635a35d13d42b95422bba6633f175245cc644e)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Ethernet-type device handling.
7 *
8 * Version: @(#)eth.c 1.0.7 05/25/93

--- 117 unchanged lines hidden (view full) ---

126 const struct ethhdr *eth = (const struct ethhdr *)data;
127 struct flow_keys keys;
128
129 /* this should never happen, but better safe than sorry */
130 if (len < sizeof(*eth))
131 return len;
132
133 /* parse any remaining L2/L3 headers, check for L4 */
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Ethernet-type device handling.
7 *
8 * Version: @(#)eth.c 1.0.7 05/25/93

--- 117 unchanged lines hidden (view full) ---

126 const struct ethhdr *eth = (const struct ethhdr *)data;
127 struct flow_keys keys;
128
129 /* this should never happen, but better safe than sorry */
130 if (len < sizeof(*eth))
131 return len;
132
133 /* parse any remaining L2/L3 headers, check for L4 */
134 if (!__skb_flow_dissect(NULL, &keys, data,
135 eth->h_proto, sizeof(*eth), len))
136 return max_t(u32, keys.thoff, sizeof(*eth));
134 if (!skb_flow_dissect_flow_keys_buf(&keys, data, eth->h_proto,
135 sizeof(*eth), len))
136 return max_t(u32, keys.basic.thoff, sizeof(*eth));
137
138 /* parse for any L4 headers */
139 return min_t(u32, __skb_get_poff(NULL, data, &keys, len), len);
140}
141EXPORT_SYMBOL(eth_get_headlen);
142
143/**
144 * eth_type_trans - determine the packet's protocol ID.

--- 342 unchanged lines hidden ---
137
138 /* parse for any L4 headers */
139 return min_t(u32, __skb_get_poff(NULL, data, &keys, len), len);
140}
141EXPORT_SYMBOL(eth_get_headlen);
142
143/**
144 * eth_type_trans - determine the packet's protocol ID.

--- 342 unchanged lines hidden ---