make really loud unable to communicate with peerinfo messages go away
[oweals/gnunet.git] / src / nat / upnp.c
index 8dd7d626cf2bff1928fcca562b95038b1fd04c77..bdb479da16365d74387f044f2b6b2d92ed781e4f 100644 (file)
  *
  * @author Milan Bouchet-Valat
  */
+#include "platform.h"
+#include "gnunet_common.h"
+
 #include <stdlib.h>
 #include <assert.h>
 #include <errno.h>
 #include <string.h>
 
-#include "platform.h"
-#include "gnunet_common.h"
 #include "gnunet_nat_lib.h"
 #include "nat.h"
 #include "upnp-discover.h"
@@ -302,7 +303,12 @@ get_ip_address_cb (int error, char *ext_addr, void *cls)
         }
 
       /* Try IPv4 and IPv6 as we don't know what's the format */
+#ifndef MINGW
       if (inet_aton (ext_addr, &addr) != 0)
+#else
+      addr.S_un.S_addr = inet_addr(ext_addr);
+      if (addr.S_un.S_addr == INADDR_NONE)
+#endif
         {
           handle->ext_addr = GNUNET_malloc (sizeof (struct sockaddr_in));
           handle->ext_addr->sa_family = AF_INET;
@@ -332,9 +338,7 @@ get_ip_address_cb (int error, char *ext_addr, void *cls)
  * 
  * @param handle the handle for UPnP object
  * @param is_enabled whether enable port redirection
- * @param doPortCheck FIXME
- * @param ext_addr pointer for returning external IP address.
- *     Will be set to NULL if address could not be found. Don't free the sockaddr.
+ * @param doPortCheck do port check
  */
 void
 GNUNET_NAT_UPNP_pulse (struct GNUNET_NAT_UPNP_Handle *handle,