Tell core that we want to have this packet delivered
[oweals/gnunet.git] / src / nat / upnp.c
index 8dd7d626cf2bff1928fcca562b95038b1fd04c77..4435741a0b6bbc85b133a9171fa375e9a3a0456c 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;