[patch] hostap alignment error dumping RADIUS_ATTR_IP

Jouni Malinen j
Sun Nov 4 19:28:42 PST 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
in_addr.

-- 
Jouni Malinen                                            PGP id EFC895FA




More information about the Hostap mailing list