lib/param: Remove use of lp{cfg,}_socket_address outside the NBT client and server
authorAndrew Bartlett <abartlet@samba.org>
Fri, 27 Jul 2012 02:31:28 +0000 (12:31 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 27 Jul 2012 07:59:51 +0000 (17:59 +1000)
In these other cases, control of the sockets to bind to can be obtained using
"bind interfaces only = yes" and "interfaces = ".

Andrew Bartlett

source3/rpc_server/rpc_sock_helper.c
source3/smbd/server.c
source4/lib/socket/interface.c
source4/wrepl_server/wrepl_in_connection.c

index c767cd817ded59dac26e88d4344dd360ae02b52c..198df903ad422aae34949f3c27900cd6c1d9b5a8 100644 (file)
@@ -98,18 +98,15 @@ NTSTATUS rpc_create_tcpip_sockets(const struct ndr_interface_table *iface,
                        }
                }
        } else {
-               const char *sock_addr = lp_socket_address();
+               const char *sock_addr;
                const char *sock_ptr;
                char *sock_tok;
 
-               if (strequal(sock_addr, "0.0.0.0") ||
-                   strequal(sock_addr, "::")) {
 #if HAVE_IPV6
-                       sock_addr = "::,0.0.0.0";
+               sock_addr = "::,0.0.0.0";
 #else
-                       sock_addr = "0.0.0.0";
+               sock_addr = "0.0.0.0";
 #endif
-               }
 
                for (sock_ptr = sock_addr;
                     next_token_talloc(talloc_tos(), &sock_ptr, &sock_tok, " \t,");
@@ -217,18 +214,15 @@ NTSTATUS rpc_setup_tcpip_sockets(struct tevent_context *ev_ctx,
                        }
                }
        } else {
-               const char *sock_addr = lp_socket_address();
+               const char *sock_addr;
                const char *sock_ptr;
                char *sock_tok;
 
-               if (strequal(sock_addr, "0.0.0.0") ||
-                   strequal(sock_addr, "::")) {
 #if HAVE_IPV6
-                       sock_addr = "::,0.0.0.0";
+               sock_addr = "::,0.0.0.0";
 #else
-                       sock_addr = "0.0.0.0";
+               sock_addr = "0.0.0.0";
 #endif
-               }
 
                for (sock_ptr = sock_addr;
                     next_token_talloc(talloc_tos(), &sock_ptr, &sock_tok, " \t,");
index 63edf0020a59aa3f14377032b8ea0a1c561b6d0d..6abf8ccaeb3a0611e11f20cf154e2d5cddc372ed 100644 (file)
@@ -796,18 +796,15 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
                /* Just bind to 0.0.0.0 - accept connections
                   from anywhere. */
 
-               const char *sock_addr = lp_socket_address();
+               const char *sock_addr;
                char *sock_tok;
                const char *sock_ptr;
 
-               if (strequal(sock_addr, "0.0.0.0") ||
-                   strequal(sock_addr, "::")) {
 #if HAVE_IPV6
-                       sock_addr = "::,0.0.0.0";
+               sock_addr = "::,0.0.0.0";
 #else
-                       sock_addr = "0.0.0.0";
+               sock_addr = "0.0.0.0";
 #endif
-               }
 
                for (sock_ptr=sock_addr;
                     next_token_talloc(talloc_tos(), &sock_ptr, &sock_tok, " \t,"); ) {
index 27ac7151a3b18ae798c8db06339554dfe9dcffe7..7a4733f466665298c3c579a63f0ecd954c76964a 100644 (file)
@@ -502,20 +502,10 @@ bool iface_list_same_net(const char *ip1, const char *ip2, const char *netmask)
 /**
    return the list of wildcard interfaces
    this will include the IPv4 0.0.0.0, and may include IPv6 ::
-   it is overridden by the 'socket address' option in smb.conf
 */
 const char **iface_list_wildcard(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
 {
        const char **ret;
-       const char *socket_address;
-
-       /* the user may have configured a specific address */
-       socket_address = lpcfg_socket_address(lp_ctx);
-       if (strcmp(socket_address, "") != 0) {
-               ret = (const char **)str_list_make(mem_ctx, socket_address, NULL);
-               return ret;
-       }
-
        ret = (const char **)str_list_make(mem_ctx, "0.0.0.0", NULL);
        if (ret == NULL) return NULL;
 
index 962a1cb7fa4b1619da08d2c2838661dedb19c4d3..251e5a024757c0893c0ca93271819f6ffdedead5 100644 (file)
@@ -467,10 +467,7 @@ NTSTATUS wreplsrv_setup_sockets(struct wreplsrv_service *service, struct loadpar
                        }
                }
        } else {
-               address = lpcfg_socket_address(lp_ctx);
-               if (strcmp(address, "") == 0) {
-                       address = "0.0.0.0";
-               }
+               address = "0.0.0.0";
                status = stream_setup_socket(task, task->event_ctx, task->lp_ctx,
                                             model_ops, &wreplsrv_stream_ops,
                                             "ipv4", address, &port, lpcfg_socket_options(task->lp_ctx),