Skip to content

Commit

Permalink
fragroute fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dsrana authored and dsrana committed May 12, 2016
1 parent f330786 commit 1eaab22
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/fragroute/pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,18 @@ pkt_decorate(struct pkt *pkt)
pkt->pkt_ip = NULL;
return;
}
/* If IP length is longer than packet length, stop. */

len = ntohs(pkt->pkt_ip->ip_len);

/* If IP length is 0, this packet was generated by wireshark
on systems with TCP Segmentation offloading to NIC enabled.
Calculate the IP length from packet end and packet data pointers.
*/
if (0 == len)
len = (pkt->pkt_end - (pkt->pkt_data + ETH_HDR_LEN));

/* If IP length is longer than packet length, stop.
*/
if (p + len > pkt->pkt_end)
return;

Expand Down

0 comments on commit 1eaab22

Please sign in to comment.