# HG changeset patch # User Evan Schoenberg # Date 1174970031 0 # Node ID 45cbb80bfd549600220c02e764d9b0fdc47f471f # Parent b4ab4812838a69d5b3f939153ba11d7d393f47e1 Using rt_msghdr instead of rt_msghdr2 compiles on a greater number of systems -- specifically Mac OS X 10.3.x, in addition to the previous compilation on OS X 10.4.x and above -- and seems to work just as well. If anyone knows how the use of these seemingly very similar structs differs, enlightenment would be appreciated. diff -r b4ab4812838a -r 45cbb80bfd54 libpurple/nat-pmp.c --- a/libpurple/nat-pmp.c Tue Mar 27 04:20:55 2007 +0000 +++ b/libpurple/nat-pmp.c Tue Mar 27 04:33:51 2007 +0000 @@ -49,7 +49,7 @@ #include #include -#ifdef NET_RT_DUMP2 +#ifdef NET_RT_DUMP #define PMP_DEBUG 1 @@ -148,7 +148,7 @@ int mib[6]; size_t needed; char *buf, *next, *lim; - struct rt_msghdr2 *rtm; + struct rt_msghdr *rtm; struct sockaddr *sa; struct sockaddr_in *sin = NULL; gboolean found = FALSE; @@ -157,7 +157,7 @@ mib[1] = PF_ROUTE; /* entire routing table or a subset of it */ mib[2] = 0; /* protocol number - always 0 */ mib[3] = 0; /* address family - 0 for all addres families */ - mib[4] = NET_RT_DUMP2; + mib[4] = NET_RT_DUMP; mib[5] = 0; /* Determine the buffer side needed to get the full routing table */ @@ -184,7 +184,7 @@ for (next = buf; next < lim; next += rtm->rtm_msglen) { - rtm = (struct rt_msghdr2 *)next; + rtm = (struct rt_msghdr *)next; sa = (struct sockaddr *)(rtm + 1); if (sa->sa_family == AF_INET) @@ -458,7 +458,7 @@ return success; } -#else /* #ifdef NET_RT_DUMP2 */ +#else /* #ifdef NET_RT_DUMP */ char * purple_pmp_get_public_ip() { @@ -476,4 +476,4 @@ { return FALSE; } -#endif /* #ifndef NET_RT_DUMP2 */ +#endif /* #ifndef NET_RT_DUMP */