s4-ipv6: removed the old unused ipv6 code in dcerpc_sock.c
authorAndrew Tridgell <tridge@samba.org>
Mon, 6 Jun 2011 00:43:05 +0000 (10:43 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 6 Jun 2011 02:26:11 +0000 (12:26 +1000)
the code is now generic to both V4 and V6

source4/librpc/rpc/dcerpc_sock.c

index 1cd4d7121ef71c2c9c373e6b9b63852d2dc5ee27..1dd993d94b2a3bdb9cde9823db6fa5926c7cf9d4 100644 (file)
@@ -371,10 +371,7 @@ struct pipe_tcp_state {
 };
 
 
-#if 0 /* disabled till we can resolve names to ipv6 addresses */
-static void continue_ipv6_open_socket(struct composite_context *ctx);
-#endif
-static void continue_ipv4_open_socket(struct composite_context *ctx);
+static void continue_ip_open_socket(struct composite_context *ctx);
 static void continue_ip_resolve_name(struct composite_context *ctx);
 
 static void continue_ip_resolve_name(struct composite_context *ctx)
@@ -383,7 +380,7 @@ static void continue_ip_resolve_name(struct composite_context *ctx)
                                                      struct composite_context);
        struct pipe_tcp_state *s = talloc_get_type(c->private_data,
                                                   struct pipe_tcp_state);
-       struct composite_context *sock_ipv4_req;
+       struct composite_context *sock_ip_req;
 
        c->status = resolve_name_recv(ctx, s, &s->address);
        if (!composite_is_ok(c)) return;
@@ -392,53 +389,19 @@ static void continue_ip_resolve_name(struct composite_context *ctx)
        s->srvaddr = socket_address_from_strings(s->conn, "ip", s->address, s->port);
        if (composite_nomem(s->srvaddr, c)) return;
 
-       /* resolve_nbt_name gives only ipv4 ... - send socket open request */
-       sock_ipv4_req = dcerpc_pipe_open_socket_send(c, s->conn, s->localaddr,
+       sock_ip_req = dcerpc_pipe_open_socket_send(c, s->conn, s->localaddr,
                                                     s->srvaddr, s->target_hostname,
                                                     NULL,
                                                     NCACN_IP_TCP);
-       composite_continue(c, sock_ipv4_req, continue_ipv4_open_socket, c);
+       composite_continue(c, sock_ip_req, continue_ip_open_socket, c);
 }
 
-/*
-  Stage 2 of dcerpc_pipe_open_tcp_send: receive result of pipe open request
-  on IPv6 and send the request on IPv4 unless IPv6 transport succeeded.
-*/
-#if 0 /* disabled till we can resolve names to ipv6 addresses */
-static void continue_ipv6_open_socket(struct composite_context *ctx)
-{
-       struct composite_context *c = talloc_get_type(ctx->async.private_data,
-                                                     struct composite_context);
-       struct pipe_tcp_state *s = talloc_get_type(c->private_data,
-                                                  struct pipe_tcp_state);
-       struct composite_context *sock_ipv4_req;
-
-       /* receive result of socket open request */
-       c->status = dcerpc_pipe_open_socket_recv(ctx);
-       if (NT_STATUS_IS_OK(c->status)) {
-               composite_done(c);
-               return;
-       }
-
-       talloc_free(s->srvaddr);
-
-       /* prepare server address using host:ip and transport name */
-       s->srvaddr = socket_address_from_strings(s->conn, "ip", s->address, s->port);
-       if (composite_nomem(s->srvaddr, c)) return;
-
-       /* try IPv4 if IPv6 fails */
-       sock_ipv4_req = dcerpc_pipe_open_socket_send(c, s->conn, s->localaddr,
-                                                    s->srvaddr, s->target_hostname, 
-                                                    NCACN_IP_TCP);
-       composite_continue(c, sock_ipv4_req, continue_ipv4_open_socket, c);
-}
-#endif
 
 /*
   Stage 2 of dcerpc_pipe_open_tcp_send: receive result of pipe open request
-  on IPv4 transport.
+  on IP transport.
 */
-static void continue_ipv4_open_socket(struct composite_context *ctx)
+static void continue_ip_open_socket(struct composite_context *ctx)
 {
        struct composite_context *c = talloc_get_type(ctx->async.private_data,
                                                      struct composite_context);