s4-ipv6: ensure wrepl server does not use ipv6
authorAndrew Tridgell <tridge@samba.org>
Thu, 2 Jun 2011 08:20:13 +0000 (18:20 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 6 Jun 2011 02:26:10 +0000 (12:26 +1000)
WINS only does IPv4

source4/wrepl_server/wrepl_in_connection.c
source4/wrepl_server/wrepl_server.c

index 9eaf10f52c9148e593456e23a0d5023cf0e5397b..962a1cb7fa4b1619da08d2c2838661dedb19c4d3 100644 (file)
@@ -468,6 +468,9 @@ 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";
+               }
                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),
index 7b420e3d91446a0c3c5d07210949c7dbffef32bb..79e0cfc24d78e231a125c44473732d5038533af9 100644 (file)
@@ -79,7 +79,7 @@ static NTSTATUS wreplsrv_open_winsdb(struct wreplsrv_service *service,
        if (owner == NULL) {
                struct interface *ifaces;
                load_interface_list(service, lp_ctx, &ifaces);
-               owner = iface_list_n_ip(ifaces, 0);
+               owner = iface_list_first_v4(ifaces);
        }
 
        service->wins_db     = winsdb_connect(service, service->task->event_ctx, lp_ctx, owner, WINSDB_HANDLE_CALLER_WREPL);