[Click] Incorrect behavior from Packet::uniqueify on 64-bit

springbo at cs.wisc.edu springbo at cs.wisc.edu
Fri Jan 4 15:30:32 EST 2008


Hello,

I think I've discovered a slight bug in packet.hh when running on a 64-bit
machine. Details are outlined below and a patch is attached.

Problem:
I was seeing an extremely infrequent crash where the marker for the
beginning of the headers (mac, ip, tcp) was not being copied correctly
with uniqueify on my 64-bit machine.

Cause:
Packet::shift_header_annotations takes a 32 bit int and was being called
as 'shift_header_annotations(nskb->head + extra_headroom - old_head);' in
Packet::expensive_uniqueify, where nskb->head and old_head are 64 bit
pointers. With very large memory distances between the packets the 32 bit
int was not enough to hold the correct amount to shift.

Solution:
shift_header_annotations now accepts a 64 bit integer.

The patch compiled and ran on both 32 and 64 bit architectures.


~Kevin Springborn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: packet.patch
Type: application/octet-stream
Size: 653 bytes
Desc: not available
Url : https://pdos.csail.mit.edu/pipermail/click/attachments/20080104/e974a0ca/attachment.obj 


More information about the click mailing list