On Wed, 2007-02-14 at 12:23 +0000, B B wrote: > > Hi again, > > correction to the below, the address calculated > is resulting in a 2 byte aligned value and not 4 byte as required. > > (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4) = > 0x0020b1fa
This suggests that p->payload is also not 4-byte aligned (as "+ IPH_HL (iphdr) * 4" should not change the bottom 2 bits), which in turn suggests that when the data was put into the pbuf, it wasn't done in a way that guarantees the headers and payloads will fall on the required alignment. For example, with ethernet which has 14 byte headers, a driver will normally arrange to put the ethernet header on at a 2 byte offset, so that the IP header, TCP header and packet data all align on 4 byte boundaries. How are you creating and filling your packet buffers? Kieran _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
