diff options
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/wrepl/winsrepl.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c index 87e5282539..3e7793c0c7 100644 --- a/source4/libcli/wrepl/winsrepl.c +++ b/source4/libcli/wrepl/winsrepl.c @@ -311,6 +311,14 @@ static void wrepl_connect_handler(struct composite_context *creq) composite_done(result); } +const char *wrepl_best_ip(struct loadparm_context *lp_ctx, const char *peer_ip) +{ + struct interface *ifaces; + load_interfaces(lp_ctx, lp_interfaces(lp_ctx), &ifaces); + return iface_best_ip(ifaces, peer_ip); +} + + /* connect a wrepl_socket to a WINS server */ @@ -334,12 +342,6 @@ struct composite_context *wrepl_connect_send(struct wrepl_socket *wrepl_socket, state->result = result; state->wrepl_socket = wrepl_socket; - if (!our_ip) { - struct interface *ifaces; - load_interfaces(state, lp_interfaces(global_loadparm), &ifaces); - our_ip = iface_best_ip(ifaces, peer_ip); - } - us = socket_address_from_strings(state, wrepl_socket->sock->backend_name, our_ip, 0); if (composite_nomem(us, result)) return result; |