On Aug 22, 2006, at 11:26 AM, Ralph Lange wrote:
Nah. Sorry. Darn.
calloc() is working - our assert had the big bug right in the _expression_ :-)
You were obviously much closer -
Doing the printout in ifreqNext() that you suggested, we find the size of the first structure coming up is 70 (dec), which is not divisible by 4, which leads to the pointer to the second structure being misaligned.
Who decides the size of the ifreq structure and doesn't pad correctly? Or should we do the padding up there?
A value of 70 from ifreq_size sounds awfully suspicious. I don' t know of anything in the network stack that could possibly be that large. RTEMS is IPV4 only so I would expect that ifreqNext would always drop back to returning the 'sizeof(*pifreq)' value.
Sounds like it's time for some well-placed printfs in the network code.