changeset 15950:45cbb80bfd54

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.
author Evan Schoenberg <evan.s@dreskin.net>
date Tue, 27 Mar 2007 04:33:51 +0000
parents b4ab4812838a
children dbb87bc732fa
files libpurple/nat-pmp.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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 <sys/types.h>
 #include <net/if.h>
 
-#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 */