From: <the...@us...> - 2006-12-15 07:46:23
|
Revision: 18006 http://svn.sourceforge.net/gaim/?rev=18006&view=rev Author: thekingant Date: 2006-12-14 23:46:08 -0800 (Thu, 14 Dec 2006) Log Message: ----------- Another bug fix from Graham Booker to allow gaim_network_get_local_system_ip() to work correctly/reliably on Mac OS X (and probably some BSDs) Modified Paths: -------------- trunk/libgaim/network.c Modified: trunk/libgaim/network.c =================================================================== --- trunk/libgaim/network.c 2006-12-15 07:28:23 UTC (rev 18005) +++ trunk/libgaim/network.c 2006-12-15 07:46:08 UTC (rev 18006) @@ -47,6 +47,16 @@ #include "stun.h" #include "upnp.h" +/* + * Calling sizeof(struct ifreq) isn't always correct on + * Mac OS X (and maybe others). + */ +#ifdef _SIZEOF_ADDR_IFREQ +# define HX_SIZE_OF_IFREQ(a) _SIZEOF_ADDR_IFREQ(a) +#else +# define HX_SIZE_OF_IFREQ(a) sizeof(a) +#endif + #ifdef HAVE_LIBNM #include <libnm_glib.h> @@ -135,7 +145,7 @@ while (tmp < buffer + ifc.ifc_len) { ifr = (struct ifreq *)tmp; - tmp += sizeof(struct ifreq); + tmp += HX_SIZE_OF_IFREQ(*ifr); if (ifr->ifr_addr.sa_family == AF_INET) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |