> If you are accessing a 32 bit number, you should use a "naturally
> aligned" address. In your previous example you were using
> (int *)(base + 21)
> If "base" is aligned, base+21 will be misaligned for all but byte accesses.
Then I should be fine, as my original code read:
*(((unsigned int *) (skb->data+20)) + 1)
I was under the assumption that int was 16 bits on x86, but Rene corrected me
("int = 32Bit @ linux"). I will test the code modified with u16 first thing in
the morning tomorrow. In all cases, the "+1" above refers to a pointer of
unsigned int, then alignment should be OK, right?
Thanks for the input. I hope not to bother anyone with that after tomorrow. :)
As a last resort, I will add some heuristic to find the port number in the
packet and start from there.
Guilhem.
__________________________________________________
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/
|