Skip to contentSkip to conversation

Progress on PPC ax25 2.6 kernel problem

DISCUSSION Bob Brose N0QBJ 1 participant 1 message Oct 3, 2005

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Mike Murphree
Quoted 3 lines · Bob Brose N0QBJ said:

Ater inserting a bunch of printks in the ax25 code I found that there is a problem in ax25_rcv() in ax25_in.c. (kernel 2.6.14-rc1)

Quoted 8 lines
Quoted 4 lines

The reason packets aren't passed to the IP layer is that dp.lastrepeat on x86 is -1 and on PPC it's 255. So the code that checks to see if the packet belongs to this machine fails in more than one spot. Here is a chunk of code from line 217:

I don't have this code sitting in front of me, but you realize that 255 is
-1 in 2's complement math? Maybe it's variable type or typecast error of
some sort...

Hi Mike, I did realize -1 was 255 but I couldn't see why it should be any different on the two different architectures however I just found out why. I tested this out then asked on the PPC kernel list. The PPC default for char is UNSIGNED while the x86 default is SIGNED. Since the declaration of the variable in structure just says char (incorrectly, since it's counting on being able to use -1) the result is foobar on the PPC.

I just did a one word patch that I'll post. I'll bet there are other instances of this in the kernel code elsewhere...

73, Bob