[patch] hostap alignment error dumping RADIUS_ATTR_IP

Jouni Malinen j
Tue Nov 6 20:18:26 PST 2007


On Sun, Nov 04, 2007 at 10:06:08PM -0800, Michael Taylor wrote:

> >> +			struct in_addr addr;
> >> +			addr.s_addr = WPA_GET_BE32(pos);
> >> +			printf("      Value: %s\n", inet_ntoa(addr));

> > Thanks! Though please note that inet_ntoa() needs to get the value
> > without any byte swapping and as such, this code would not work on
> > little-endian CPU. I fixed this by just copying the data to local struct
> > in_addr.

> Good catch.  Thanks.  Can you paste the fragment you wound up using ?

http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff;h=b29c5bb0689de5f560dd44e62427ceb580b66484

+                       struct in_addr addr;
+                       os_memcpy(&addr, pos, 4);
+                       printf("      Value: %s\n", inet_ntoa(addr));

-- 
Jouni Malinen                                            PGP id EFC895FA




More information about the Hostap mailing list