1 Jul 2010 23:08
uip on an x86
Daine Mamacos <scuzzy <at> reverseorder.net>
2010-07-01 21:08:31 GMT
2010-07-01 21:08:31 GMT
I've used uIP on a few micro's before, and wanted to port it to x86. What I've done is just treat a raw socket as driver to ready bytes from. That's all fine and dandy, however. When the buffer gets cast into an struct uip_eth_hdr *, I noticed that because of the incorrect byte orders, the addresses (anything that uses 2 bytes) ends up in the wrong order. I see the profuse use of HTONS etc all over the place, however it's not used during ip address comparison, and as such the ip's are always in a reversed order ((168.192).(1.0)) if your ip address is 192.168.0.1. Maybe I'm being plain stupid, but surely this is an absolutely critical place to use htons? Am I missing something here? Thanks Daine.
RSS Feed