Re: [Etherboot-developers] bootp_t alignment problem
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: <ebi...@ln...> - 2003-05-02 12:59:54
|
ke...@us... (Ken Yap) writes: > >bootpreply = (struct bootp_t *)&nic.packet[ETH_HLEN + sizeof(struct iphdr) > >+ sizeof(struct udphdr)]; > > > >how this alignment problem can be taken care of..I was using in header > >file, > >struct bootp_t __attribute__ ((aligned(4))) > >without any difference. > > This one is a nasty one, you've found an alignment bug. And it is fixed in 5.1.8. Itanium fails on every alignment issue. Why is it that no one trys porting the portable version of etherboot? > The IP and UDP headers are multiples of 4 but ETH_HLEN is 14. > Declaring bootp_t > aligned does no good because that only aligns instances of bootp_t, not > buffers that have been cast to bootp_t. To fix this will require a copy > of the packet, instead of a cast. Or it requires a misaligned ethernet header. Which is fine because mac addresses are just 6 byte character arrays (No alignment needed). [snip possible fix] > Robb Main is hacking nic.c at the moment so you should probably let him > make this fix. Unless there has been a regression nic.c is fine in this regard at least in 5.1.x. Eric |