diff options
Diffstat (limited to 'drivers/net/ethernet/intel/igb')
-rw-r--r-- | drivers/net/ethernet/intel/igb/igb_main.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 0fe25210629b..0ce145e93545 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -6145,20 +6145,23 @@ static unsigned int igb_get_headlen(unsigned char *data, | |||
6145 | if (hlen < sizeof(struct iphdr)) | 6145 | if (hlen < sizeof(struct iphdr)) |
6146 | return hdr.network - data; | 6146 | return hdr.network - data; |
6147 | 6147 | ||
6148 | /* record next protocol */ | 6148 | /* record next protocol if header is present */ |
6149 | nexthdr = hdr.ipv4->protocol; | 6149 | if (!hdr.ipv4->frag_off) |
6150 | hdr.network += hlen; | 6150 | nexthdr = hdr.ipv4->protocol; |
6151 | } else if (protocol == __constant_htons(ETH_P_IPV6)) { | 6151 | } else if (protocol == __constant_htons(ETH_P_IPV6)) { |
6152 | if ((hdr.network - data) > (max_len - sizeof(struct ipv6hdr))) | 6152 | if ((hdr.network - data) > (max_len - sizeof(struct ipv6hdr))) |
6153 | return max_len; | 6153 | return max_len; |
6154 | 6154 | ||
6155 | /* record next protocol */ | 6155 | /* record next protocol */ |
6156 | nexthdr = hdr.ipv6->nexthdr; | 6156 | nexthdr = hdr.ipv6->nexthdr; |
6157 | hdr.network += sizeof(struct ipv6hdr); | 6157 | hlen = sizeof(struct ipv6hdr); |
6158 | } else { | 6158 | } else { |
6159 | return hdr.network - data; | 6159 | return hdr.network - data; |
6160 | } | 6160 | } |
6161 | 6161 | ||
6162 | /* relocate pointer to start of L4 header */ | ||
6163 | hdr.network += hlen; | ||
6164 | |||
6162 | /* finally sort out TCP */ | 6165 | /* finally sort out TCP */ |
6163 | if (nexthdr == IPPROTO_TCP) { | 6166 | if (nexthdr == IPPROTO_TCP) { |
6164 | if ((hdr.network - data) > (max_len - sizeof(struct tcphdr))) | 6167 | if ((hdr.network - data) > (max_len - sizeof(struct tcphdr))) |