[REPOST PATCH xauth] Look for FamilyLocal if inet or inet6 address is loopback

Egbert Eich e4t at freenet.de
Mon Sep 30 12:03:31 PDT 2013


Jeremy,

On Sun, Sep 29, 2013 at 08:29:48AM -0700, Jeremy Huddleston Sequoia wrote:
> You had incorrect casting in the IN6_IS_ADDR_* macros.  Does Linux (or whatever platform you tested on) cast the arguments to those macros for you (thus correcting / undoing the casting that you provided)?  That seems quite dangerous.
> 
> I initially reverted this but then noticed it was a trivial error and pushed a commit with the fixed cast.
> 

Thanks! Good catch!

Unfortunately, with the semi-recent glibc on my Linux build machine 
at least, there are casts in both macros which will defeat any type 
checking whatsoever :(
Ie:

# define IN6_IS_ADDR_UNSPECIFIED(a) \
  (__extension__                                                              \
   ({ const struct in6_addr *__a = (const struct in6_addr *) (a);             \
      __a->s6_addr32[0] == 0                                                  \
      && __a->s6_addr32[1] == 0                                               \
      && __a->s6_addr32[2] == 0                                               \
      && __a->s6_addr32[3] == 0; }))

Cheers,
	Egbert.





More information about the xorg-devel mailing list