Jonathan Larmour wrote: > dst_in_addr will already be aligned, so does not need memcpy. > You can just do: > dst_ip_addr.addr = dst_in_addr->addr; > > However in the other direction - if there's an ip_addr you > need to convert back to a struct in_addr, then you /would/ > need memcpy, to safely guarantee alignment.
Thanks for the reply Jonathan. It's not clear to me why one direction would need memcpy() and not the other. (I am speaking in general, not about the example function I provided) Anyway, for the records, it turns out that even though my CPU (Blackfin) does not support unaligned access, the compiler (from Analog Devices) will translate those accesses into 4 byte accesses. It will be slow and pointer-unsafe, but so far it's ok for my --very limited-- case. Luca _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
