[patch] hostap alignment error dumping RADIUS_ATTR_IP

Jouni Malinen j at w1.fi
Sun Nov 4 22:28:42 EST 2007

On Fri, Oct 26, 2007 at 11:02:07AM -0700, Michael Taylor wrote:

> This little patch fixes an unaligned access with debugging enabled for 
> radius messages (specifically for RADIUS_ATTR_IP values).

> +			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

Jouni Malinen                                            PGP id EFC895FA

More information about the HostAP mailing list