Commit 601a2e7a authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Kirsher

i40e/i40evf: make IPv6 ATR code clearer

This just reorders some local vars and makes the code flow
clearer.
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 4d433084
...@@ -2451,9 +2451,15 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb, ...@@ -2451,9 +2451,15 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,
hlen = (hdr.network[0] & 0x0F) << 2; hlen = (hdr.network[0] & 0x0F) << 2;
l4_proto = hdr.ipv4->protocol; l4_proto = hdr.ipv4->protocol;
} else { } else {
hlen = hdr.network - skb->data; /* find the start of the innermost ipv6 header */
l4_proto = ipv6_find_hdr(skb, &hlen, IPPROTO_TCP, NULL, NULL); unsigned int inner_hlen = hdr.network - skb->data;
hlen -= hdr.network - skb->data; unsigned int h_offset = inner_hlen;
/* this function updates h_offset to the end of the header */
l4_proto =
ipv6_find_hdr(skb, &h_offset, IPPROTO_TCP, NULL, NULL);
/* hlen will contain our best estimate of the tcp header */
hlen = h_offset - inner_hlen;
} }
if (l4_proto != IPPROTO_TCP) if (l4_proto != IPPROTO_TCP)
......
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