Home page logo
/

nmap-dev logo Nmap Development mailing list archives

[Patch] nsock/tests/addrset.c
From: Gisle Vanem <gvanem () broadpark no>
Date: Wed, 07 Aug 2013 16:57:30 +0200

The nsock/test/addrset.c needs a call to WSAStartup() to succeed.

But since I have no IPv6 installed here (WinXP-SP3), I cannot check the IPv6 parsing. Hence the 'sh test-addrset.sh' fails on 4 tests, but from the output, it looks like 5 tests fails:

Error adding spec "fe80::202:e3ff:fe14:1102".
FAIL ./addrset returned 1.
Error adding spec "1:2:3::4".
FAIL ./addrset returned 1.
..
Error adding spec "1:2::0003/120".
FAIL ./addrset returned 1.
Error adding spec "1:2::0003/128".
FAIL ./addrset returned 1.
Error adding spec "1:2::0003/0".
FAIL ./addrset returned 1.
Error resolving "1:2::3:4": Kjenner ingen slik vert. .

--------------

Patch:

--- SVN-Latest/ncat/test/addrset.c        2013-04-25 08:06:41 +0000
+++ ncat/test/addrset.c   2013-08-07 14:39:46 +0000
@@ -22,6 +22,15 @@

#include "ncat_core.h"

+#ifdef WIN32
+static void win_init (void)
+{
+  WSADATA data;
+  if (WSAStartup(MAKEWORD(2,2), &data) != 0)
+     fatal ("failed to start winsock.\n");
+}
+#endif
+
static int resolve_name(const char *name, struct addrinfo **result)
{
    struct addrinfo hints = { 0 };
@@ -38,6 +47,10 @@
    char line[1024];
    int i;

+#ifdef WIN32
+    win_init();
+#endif
+
    addrset_init(&set);

    options_init();

------------

--gv
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
AlienVault