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

Eddie Kohler kohler at cs.ucla.edu
Fri Jan 4 17:41:05 EST 2008


Hi James,

Thanks for the patch!  I've checked in a version that uses ptrdiff_t.

Eddie


springbo at cs.wisc.edu wrote:
> 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
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list