diff options
author | Moon <moon@140774ce-b5e7-0310-ab8b-a85725594a96> | 2010-12-03 19:07:32 +0000 |
---|---|---|
committer | Moon <moon@140774ce-b5e7-0310-ab8b-a85725594a96> | 2010-12-03 19:07:32 +0000 |
commit | b2b6dc4587616ef3e18ba469ed17158b1099c4ee (patch) | |
tree | 8f11d70aa094f7c67fd6856b26ecf04c6050c3dd /src/nat | |
parent | ce86cefa5e51082153e52b1a99e8f69f5242c012 (diff) | |
download | gnunet-b2b6dc4587616ef3e18ba469ed17158b1099c4ee.tar.gz gnunet-b2b6dc4587616ef3e18ba469ed17158b1099c4ee.zip |
Fix W32 interface listing, and correctly copy addr in test-nat (patch by LRN)
Diffstat (limited to 'src/nat')
-rw-r--r-- | src/nat/test_nat.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/nat/test_nat.c b/src/nat/test_nat.c index 6f2226929..c71623c2e 100644 --- a/src/nat/test_nat.c +++ b/src/nat/test_nat.c | |||
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | struct addr_cls | 46 | struct addr_cls |
47 | { | 47 | { |
48 | const struct sockaddr *addr; | 48 | struct sockaddr *addr; |
49 | socklen_t addrlen; | 49 | socklen_t addrlen; |
50 | }; | 50 | }; |
51 | 51 | ||
@@ -76,22 +76,16 @@ process_if (void *cls, | |||
76 | { | 76 | { |
77 | struct addr_cls *data = cls; | 77 | struct addr_cls *data = cls; |
78 | 78 | ||
79 | if (addr) | 79 | if (addr && addrlen > 0) |
80 | { | 80 | { |
81 | data->addr = addr; | 81 | if (data->addr) |
82 | GNUNET_free (data->addr); | ||
83 | data->addr = memcpy (GNUNET_malloc (addrlen), addr, addrlen); | ||
82 | data->addrlen = addrlen; | 84 | data->addrlen = addrlen; |
85 | if (isDefault) | ||
86 | return GNUNET_SYSERR; | ||
83 | } | 87 | } |
84 | |||
85 | if (strcmp (name, "eth1") == 0 && addr->sa_family == AF_INET) | ||
86 | return GNUNET_SYSERR; | ||
87 | |||
88 | return GNUNET_OK; | 88 | return GNUNET_OK; |
89 | |||
90 | |||
91 | if (isDefault && addr) | ||
92 | return GNUNET_SYSERR; | ||
93 | else | ||
94 | return GNUNET_OK; | ||
95 | } | 89 | } |
96 | 90 | ||
97 | static void | 91 | static void |