summaryrefslogtreecommitdiff
path: root/source4/lib/interface.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-27 03:15:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:49 -0500
commit9d055846f225bea4953822f40fab1d2f1a2e2d07 (patch)
tree9a513f3eeb7223a96e1df1d65060b095002e534e /source4/lib/interface.c
parent5ae448116165a6bb9d792686db825b8b47f27201 (diff)
downloadsamba-9d055846f225bea4953822f40fab1d2f1a2e2d07.tar.gz
samba-9d055846f225bea4953822f40fab1d2f1a2e2d07.tar.bz2
samba-9d055846f225bea4953822f40fab1d2f1a2e2d07.zip
r3278: - rewrote the client side rpc connection code to use lib/socket/
rather than doing everything itself. This greatly simplifies the code, although I really don't like the socket_recv() interface (it always allocates memory for you, which means an extra memcpy in this code) - fixed several bugs in the socket_ipv4.c code, in particular client side code used a non-blocking connect but didn't handle EINPROGRESS, so it had no chance of working. Also fixed the error codes, using map_nt_error_from_unix() - cleaned up and expanded map_nt_error_from_unix() - changed interpret_addr2() to not take a mem_ctx. It makes absolutely no sense to allocate a fixed size 4 byte structure like this. Dozens of places in the code were also using interpret_addr2() incorrectly (precisely because the allocation made no sense) (This used to be commit 7f2c771b0e0e98c5c9e5cf662592d64d34ff1205)
Diffstat (limited to 'source4/lib/interface.c')
-rw-r--r--source4/lib/interface.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/lib/interface.c b/source4/lib/interface.c
index 14abfbd09a..b842fbb292 100644
--- a/source4/lib/interface.c
+++ b/source4/lib/interface.c
@@ -116,7 +116,7 @@ static void interpret_interface(TALLOC_CTX *mem_ctx, const char *token)
/* maybe it is a DNS name */
p = strchr_m(token,'/');
if (!p) {
- ip = *interpret_addr2(mem_ctx, token);
+ ip = interpret_addr2(token);
for (i=0;i<total_probed;i++) {
if (ip.s_addr == probed_ifaces[i].ip.s_addr &&
!ip_equal(allones_ip, probed_ifaces[i].netmask)) {
@@ -132,10 +132,10 @@ static void interpret_interface(TALLOC_CTX *mem_ctx, const char *token)
/* parse it into an IP address/netmasklength pair */
*p++ = 0;
- ip = *interpret_addr2(mem_ctx, token);
+ ip = interpret_addr2(token);
if (strlen(p) > 2) {
- nmask = *interpret_addr2(mem_ctx, p);
+ nmask = interpret_addr2(p);
} else {
nmask.s_addr = htonl(((ALLONES >> atoi(p)) ^ ALLONES));
}
@@ -174,8 +174,8 @@ void load_interfaces(void)
return;
}
- allones_ip = *interpret_addr2(mem_ctx, "255.255.255.255");
- loopback_ip = *interpret_addr2(mem_ctx, "127.0.0.1");
+ allones_ip = interpret_addr2("255.255.255.255");
+ loopback_ip = interpret_addr2("127.0.0.1");
SAFE_FREE(probed_ifaces);