The branch, v3-3-test has been updated via f2a3617778cab1695a09f065840907e1227b6d86 (commit) from 37a92ed0eb2c8cf7f3eac1d90ba5300cbce45186 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test - Log ----------------------------------------------------------------- commit f2a3617778cab1695a09f065840907e1227b6d86 Author: Tim Prouty <[EMAIL PROTECTED]> Date: Wed Dec 3 10:37:03 2008 -0800 Change sockaddr util function names for consistency and to eliminate name conflicts ----------------------------------------------------------------------- Summary of changes: source/client/client.c | 2 +- source/include/proto.h | 4 ++-- source/lib/interface.c | 10 +++++----- source/lib/util_sock.c | 14 +++++++------- source/libads/kerberos.c | 6 +++--- source/libsmb/cliconnect.c | 2 +- source/libsmb/clidfs.c | 4 ++-- source/libsmb/libsmb_server.c | 6 +++--- source/libsmb/namequery.c | 10 +++++----- source/libsmb/namequery_dc.c | 4 ++-- source/rpcclient/rpcclient.c | 2 +- source/torture/locktest.c | 4 ++-- source/torture/masktest.c | 4 ++-- source/torture/torture.c | 2 +- source/utils/net.c | 2 +- source/utils/smbcacls.c | 2 +- source/utils/smbcquotas.c | 2 +- source/utils/smbfilter.c | 2 +- source/winbindd/winbindd_cm.c | 2 +- 19 files changed, 42 insertions(+), 42 deletions(-) Changeset truncated at 500 lines: diff --git a/source/client/client.c b/source/client/client.c index 3048d95..d05a82a 100644 --- a/source/client/client.c +++ b/source/client/client.c @@ -4615,7 +4615,7 @@ static int do_message_op(void) snprintf(name_type_hex, sizeof(name_type_hex), "#%X", name_type); fstrcat(server_name, name_type_hex); - zero_addr(&ss); + zero_sockaddr(&ss); if (have_ip) ss = dest_ss; diff --git a/source/include/proto.h b/source/include/proto.h index 99e9d76..06130c4 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -1538,14 +1538,14 @@ bool is_loopback_addr(const struct sockaddr_storage *pss); bool is_zero_ip_v4(struct in_addr ip); bool is_zero_addr(const struct sockaddr_storage *pss); void zero_ip_v4(struct in_addr *ip); -void zero_addr(struct sockaddr_storage *pss); +void zero_sockaddr(struct sockaddr_storage *pss); bool same_net_v4(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); void in_addr_to_sockaddr_storage(struct sockaddr_storage *ss, struct in_addr ip); bool same_net(const struct sockaddr_storage *ip1, const struct sockaddr_storage *ip2, const struct sockaddr_storage *mask); -bool addr_equal(const struct sockaddr_storage *ip1, +bool sockaddr_equal(const struct sockaddr_storage *ip1, const struct sockaddr_storage *ip2); bool is_address_any(const struct sockaddr_storage *psa); uint16_t get_sockaddr_port(const struct sockaddr_storage *pss); diff --git a/source/lib/interface.c b/source/lib/interface.c index 2e7c270..15fed9e 100644 --- a/source/lib/interface.c +++ b/source/lib/interface.c @@ -33,7 +33,7 @@ bool ismyaddr(const struct sockaddr_storage *ip) { struct interface *i; for (i=local_interfaces;i;i=i->next) { - if (addr_equal(&i->ip,ip)) { + if (sockaddr_equal(&i->ip,ip)) { return true; } } @@ -65,7 +65,7 @@ static struct interface *iface_find(const struct sockaddr_storage *ip, if (same_net(ip, &i->ip, &i->netmask)) { return i; } - } else if (addr_equal(&i->ip, ip)) { + } else if (sockaddr_equal(&i->ip, ip)) { return i; } } @@ -93,7 +93,7 @@ void setup_linklocal_scope_id(struct sockaddr_storage *pss) { struct interface *i; for (i=local_interfaces;i;i=i->next) { - if (addr_equal(&i->ip,pss)) { + if (sockaddr_equal(&i->ip,pss)) { struct sockaddr_in6 *psa6 = (struct sockaddr_in6 *)pss; psa6->sin6_scope_id = if_nametoindex(i->name); @@ -388,7 +388,7 @@ static void interpret_interface(char *token) } for (i=0;i<total_probed;i++) { - if (addr_equal(&ss, &probed_ifaces[i].ip)) { + if (sockaddr_equal(&ss, &probed_ifaces[i].ip)) { add_interface(&probed_ifaces[i]); return; } @@ -441,7 +441,7 @@ static void interpret_interface(char *token) make_net(&ss_net, &ss, &ss_mask); /* Maybe the first component was a broadcast address. */ - if (addr_equal(&ss_bcast, &ss) || addr_equal(&ss_net, &ss)) { + if (sockaddr_equal(&ss_bcast, &ss) || sockaddr_equal(&ss_net, &ss)) { for (i=0;i<total_probed;i++) { if (same_net(&ss, &probed_ifaces[i].ip, &ss_mask)) { /* Temporarily replace netmask on diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c index e20768e..e64b003 100644 --- a/source/lib/util_sock.c +++ b/source/lib/util_sock.c @@ -234,7 +234,7 @@ bool interpret_string_addr(struct sockaddr_storage *pss, } #endif - zero_addr(pss); + zero_sockaddr(pss); if (!interpret_string_addr_internal(&res, str, flags|AI_ADDRCONFIG)) { return false; @@ -334,7 +334,7 @@ void zero_ip_v4(struct in_addr *ip) Set an address to INADDR_ANY. ******************************************************************/ -void zero_addr(struct sockaddr_storage *pss) +void zero_sockaddr(struct sockaddr_storage *pss) { memset(pss, '\0', sizeof(*pss)); /* Ensure we're at least a valid sockaddr-storage. */ @@ -429,8 +429,8 @@ bool same_net(const struct sockaddr_storage *ip1, Are two sockaddr_storage's the same family and address ? Ignore port etc. ********************************************************************/ -bool addr_equal(const struct sockaddr_storage *ip1, - const struct sockaddr_storage *ip2) +bool sockaddr_equal(const struct sockaddr_storage *ip1, + const struct sockaddr_storage *ip2) { if (ip1->ss_family != ip2->ss_family) { /* Never the same. */ @@ -1659,7 +1659,7 @@ static bool matchname(const char *remotehost, if (!res->ai_addr) { continue; } - if (addr_equal((const struct sockaddr_storage *)res->ai_addr, + if (sockaddr_equal((const struct sockaddr_storage *)res->ai_addr, pss)) { freeaddrinfo(ailist); return true; @@ -1772,7 +1772,7 @@ const char *get_peer_name(int fd, bool force_lookup) p = get_peer_addr_internal(fd, addr_buf, sizeof(addr_buf), &ss, &length); /* it might be the same as the last one - save some DNS work */ - if (addr_equal(&ss, &nc.ss)) { + if (sockaddr_equal(&ss, &nc.ss)) { return nc.name ? nc.name : "UNKNOWN"; } @@ -2091,7 +2091,7 @@ bool is_myname_or_ipaddr(const char *s) } n = get_interfaces(nics, MAX_INTERFACES); for (i=0; i<n; i++) { - if (addr_equal(&nics[i].ip, &ss)) { + if (sockaddr_equal(&nics[i].ip, &ss)) { TALLOC_FREE(nics); return true; } diff --git a/source/libads/kerberos.c b/source/libads/kerberos.c index 501ef01..56c3af8 100644 --- a/source/libads/kerberos.c +++ b/source/libads/kerberos.c @@ -772,7 +772,7 @@ static char *get_kdc_ip_string(char *mem_ctx, get_kdc_list(realm, sitename, &ip_srv_site, &count_site); for (i = 0; i < count_site; i++) { - if (addr_equal(&ip_srv_site[i].ss, pss)) { + if (sockaddr_equal(&ip_srv_site[i].ss, pss)) { continue; } /* Append to the string - inefficient @@ -794,13 +794,13 @@ static char *get_kdc_ip_string(char *mem_ctx, for (i = 0; i < count_nonsite; i++) { int j; - if (addr_equal(&ip_srv_nonsite[i].ss, pss)) { + if (sockaddr_equal(&ip_srv_nonsite[i].ss, pss)) { continue; } /* Ensure this isn't an IP already seen (YUK! this is n*n....) */ for (j = 0; j < count_site; j++) { - if (addr_equal(&ip_srv_nonsite[i].ss, + if (sockaddr_equal(&ip_srv_nonsite[i].ss, &ip_srv_site[j].ss)) { break; } diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c index 8ef14d7..69f84aa 100644 --- a/source/libsmb/cliconnect.c +++ b/source/libsmb/cliconnect.c @@ -1622,7 +1622,7 @@ NTSTATUS cli_start_connection(struct cli_state **output_cli, if (dest_ss) { ss = *dest_ss; } else { - zero_addr(&ss); + zero_sockaddr(&ss); } again: diff --git a/source/libsmb/clidfs.c b/source/libsmb/clidfs.c index 7b63f95..35922b1 100644 --- a/source/libsmb/clidfs.c +++ b/source/libsmb/clidfs.c @@ -144,13 +144,13 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, server_n = server; - zero_addr(&ss); + zero_sockaddr(&ss); make_nmb_name(&calling, global_myname(), 0x0); make_nmb_name(&called , server, name_type); again: - zero_addr(&ss); + zero_sockaddr(&ss); if (have_ip) ss = dest_ss; diff --git a/source/libsmb/libsmb_server.c b/source/libsmb/libsmb_server.c index 0a3287b..9b4d3f6 100644 --- a/source/libsmb/libsmb_server.c +++ b/source/libsmb/libsmb_server.c @@ -248,7 +248,7 @@ SMBC_server(TALLOC_CTX *ctx, const char *username_used; NTSTATUS status; - zero_addr(&ss); + zero_sockaddr(&ss); ZERO_STRUCT(c); if (server[0] == 0) { @@ -348,7 +348,7 @@ SMBC_server(TALLOC_CTX *ctx, again: - zero_addr(&ss); + zero_sockaddr(&ss); /* have to open a new connection */ if ((c = cli_initialise()) == NULL) { @@ -595,7 +595,7 @@ SMBC_attr_server(TALLOC_CTX *ctx, flags |= CLI_FULL_CONNECTION_USE_KERBEROS; } - zero_addr(&ss); + zero_sockaddr(&ss); nt_status = cli_full_connection(&ipc_cli, global_myname(), server, &ss, 0, "IPC$", "?????", diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c index 24d7ee1..5945683 100644 --- a/source/libsmb/namequery.c +++ b/source/libsmb/namequery.c @@ -331,7 +331,7 @@ bool name_status_find(const char *q_name, if (!interpret_string_addr(&ss, lp_socket_address(), AI_NUMERICHOST|AI_PASSIVE)) { - zero_addr(&ss); + zero_sockaddr(&ss); } sock = open_socket_in(SOCK_DGRAM, 0, 3, &ss, True); @@ -526,9 +526,9 @@ static int remove_duplicate_addrs2(struct ip_service *iplist, int count ) } for ( j=i+1; j<count; j++ ) { - if (addr_equal(&iplist[i].ss, &iplist[j].ss) && + if (sockaddr_equal(&iplist[i].ss, &iplist[j].ss) && iplist[i].port == iplist[j].port) { - zero_addr(&iplist[j].ss); + zero_sockaddr(&iplist[j].ss); } } } @@ -954,7 +954,7 @@ NTSTATUS name_resolve_bcast(const char *name, if (!interpret_string_addr(&ss, lp_socket_address(), AI_NUMERICHOST|AI_PASSIVE)) { - zero_addr(&ss); + zero_sockaddr(&ss); } sock = open_socket_in( SOCK_DGRAM, 0, 3, &ss, true ); @@ -1042,7 +1042,7 @@ NTSTATUS resolve_wins(const char *name, /* the address we will be sending from */ if (!interpret_string_addr(&src_ss, lp_socket_address(), AI_NUMERICHOST|AI_PASSIVE)) { - zero_addr(&src_ss); + zero_sockaddr(&src_ss); } if (src_ss.ss_family != AF_INET) { diff --git a/source/libsmb/namequery_dc.c b/source/libsmb/namequery_dc.c index d080f8f..e2fe248 100644 --- a/source/libsmb/namequery_dc.c +++ b/source/libsmb/namequery_dc.c @@ -134,7 +134,7 @@ static bool ads_dc_name(const char *domain, #ifdef HAVE_ADS *dc_ss = ads->ldap.ss; #else - zero_addr(dc_ss); + zero_sockaddr(dc_ss); #endif ads_destroy(&ads); @@ -217,7 +217,7 @@ bool get_dc_name(const char *domain, bool ret; bool our_domain = False; - zero_addr(&dc_ss); + zero_sockaddr(&dc_ss); ret = False; diff --git a/source/rpcclient/rpcclient.c b/source/rpcclient/rpcclient.c index e4cdd9c..421c681 100644 --- a/source/rpcclient/rpcclient.c +++ b/source/rpcclient/rpcclient.c @@ -776,7 +776,7 @@ out_free: load_case_tables(); - zero_addr(&server_ss); + zero_sockaddr(&server_ss); setlinebuf(stdout); diff --git a/source/torture/locktest.c b/source/torture/locktest.c index 2ba5ab8..4ac0279 100644 --- a/source/torture/locktest.c +++ b/source/torture/locktest.c @@ -176,7 +176,7 @@ static struct cli_state *connect_one(char *share, int snum) server_n = server; - zero_addr(&ss); + zero_sockaddr(&ss); slprintf(myname,sizeof(myname), "lock-%lu-%u", (unsigned long)getpid(), count++); @@ -184,7 +184,7 @@ static struct cli_state *connect_one(char *share, int snum) make_nmb_name(&called , server, 0x20); again: - zero_addr(&ss); + zero_sockaddr(&ss); /* have to open a new connection */ if (!(c=cli_initialise())) { diff --git a/source/torture/masktest.c b/source/torture/masktest.c index c5612fe..8fea158 100644 --- a/source/torture/masktest.c +++ b/source/torture/masktest.c @@ -178,13 +178,13 @@ static struct cli_state *connect_one(char *share) server_n = server; - zero_addr(&ss); + zero_sockaddr(&ss); make_nmb_name(&calling, "masktest", 0x0); make_nmb_name(&called , server, 0x20); again: - zero_addr(&ss); + zero_sockaddr(&ss); /* have to open a new connection */ if (!(c=cli_initialise())) { diff --git a/source/torture/torture.c b/source/torture/torture.c index a4b4679..ace8fef 100644 --- a/source/torture/torture.c +++ b/source/torture/torture.c @@ -158,7 +158,7 @@ static struct cli_state *open_nbt_connection(void) make_nmb_name(&calling, myname, 0x0); make_nmb_name(&called , host, 0x20); - zero_addr(&ss); + zero_sockaddr(&ss); if (!(c = cli_initialise())) { printf("Failed initialize cli_struct to connect with %s\n", host); diff --git a/source/utils/net.c b/source/utils/net.c index bab2f41..f1a5be1 100644 --- a/source/utils/net.c +++ b/source/utils/net.c @@ -662,7 +662,7 @@ static struct functable net_func[] = { }; - zero_addr(&c->opt_dest_ip); + zero_sockaddr(&c->opt_dest_ip); load_case_tables(); diff --git a/source/utils/smbcacls.c b/source/utils/smbcacls.c index 10b5501..1bfc475 100644 --- a/source/utils/smbcacls.c +++ b/source/utils/smbcacls.c @@ -956,7 +956,7 @@ static struct cli_state *connect_one(const char *server, const char *share) NTSTATUS nt_status; uint32_t flags = 0; - zero_addr(&ss); + zero_sockaddr(&ss); if (get_cmdline_auth_info_use_kerberos()) { flags |= CLI_FULL_CONNECTION_USE_KERBEROS | diff --git a/source/utils/smbcquotas.c b/source/utils/smbcquotas.c index 11f8776..16e2e85 100644 --- a/source/utils/smbcquotas.c +++ b/source/utils/smbcquotas.c @@ -375,7 +375,7 @@ static struct cli_state *connect_one(const char *share) NTSTATUS nt_status; uint32_t flags = 0; - zero_addr(&ss); + zero_sockaddr(&ss); if (get_cmdline_auth_info_use_machine_account() && !set_cmdline_auth_info_machine_account_creds()) { diff --git a/source/utils/smbfilter.c b/source/utils/smbfilter.c index d274e09..1e22a40 100644 --- a/source/utils/smbfilter.c +++ b/source/utils/smbfilter.c @@ -212,7 +212,7 @@ static void start_filter(char *desthost) /* start listening on port 445 locally */ - zero_addr(&my_ss); + zero_sockaddr(&my_ss); s = open_socket_in(SOCK_STREAM, 445, 0, &my_ss, True); if (s == -1) { diff --git a/source/winbindd/winbindd_cm.c b/source/winbindd/winbindd_cm.c index 38c0abe..a918fb8 100644 --- a/source/winbindd/winbindd_cm.c +++ b/source/winbindd/winbindd_cm.c @@ -1038,7 +1038,7 @@ static bool add_one_dc_unique(TALLOC_CTX *mem_ctx, const char *domain_name, /* Make sure there's no duplicates in the list */ for (i=0; i<*num; i++) - if (addr_equal(&(*dcs)[i].ss, pss)) + if (sockaddr_equal(&(*dcs)[i].ss, pss)) return False; *dcs = TALLOC_REALLOC_ARRAY(mem_ctx, *dcs, struct dc_name_ip, (*num)+1); -- Samba Shared Repository