Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341677
b: refs/heads/master
c: ed83da1
h: refs/heads/master
i:
  341675: 95c9942
v: v3
  • Loading branch information
Alexander Duyck authored and Jeff Kirsher committed Dec 1, 2012
1 parent 51d3f12 commit 58f083f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e921eb1ac411a32b98fa1a9ccbba1b24fae8de2d
refs/heads/master: ed83da12ee742da8cefa784def3af64e4e195462
13 changes: 8 additions & 5 deletions trunk/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1338,26 +1338,29 @@ static unsigned int ixgbe_get_headlen(unsigned char *data,
if (hlen < sizeof(struct iphdr))
return hdr.network - data;

/* record next protocol */
nexthdr = hdr.ipv4->protocol;
hdr.network += hlen;
/* record next protocol if header is present */
if (!hdr.ipv4->frag_off)
nexthdr = hdr.ipv4->protocol;
} else if (protocol == __constant_htons(ETH_P_IPV6)) {
if ((hdr.network - data) > (max_len - sizeof(struct ipv6hdr)))
return max_len;

/* record next protocol */
nexthdr = hdr.ipv6->nexthdr;
hdr.network += sizeof(struct ipv6hdr);
hlen = sizeof(struct ipv6hdr);
#ifdef IXGBE_FCOE
} else if (protocol == __constant_htons(ETH_P_FCOE)) {
if ((hdr.network - data) > (max_len - FCOE_HEADER_LEN))
return max_len;
hdr.network += FCOE_HEADER_LEN;
hlen = FCOE_HEADER_LEN;
#endif
} else {
return hdr.network - data;
}

/* relocate pointer to start of L4 header */
hdr.network += hlen;

/* finally sort out TCP/UDP */
if (nexthdr == IPPROTO_TCP) {
if ((hdr.network - data) > (max_len - sizeof(struct tcphdr)))
Expand Down

0 comments on commit 58f083f

Please sign in to comment.