Commit 0fad0895 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

rpcrt4: Don't try to resolve the name when constructing a protocol tower.

Instead just fill it in with all zeros.
parent ebcd6b6a
......@@ -584,7 +584,7 @@ static size_t rpcrt4_ncacn_ip_tcp_get_top_of_tower(unsigned char *tower_data,
ipv4_floor->protid = EPM_PROTOCOL_IP;
ipv4_floor->count_rhs = sizeof(ipv4_floor->ipv4addr);
hints.ai_flags = 0;
hints.ai_flags = AI_NUMERICHOST;
/* FIXME: only support IPv4 at the moment. how is IPv6 represented by the EPM? */
hints.ai_family = PF_INET;
hints.ai_socktype = SOCK_STREAM;
......@@ -597,8 +597,12 @@ static size_t rpcrt4_ncacn_ip_tcp_get_top_of_tower(unsigned char *tower_data,
ret = getaddrinfo(networkaddr, endpoint, &hints, &ai);
if (ret < 0)
{
ERR("getaddrinfo failed: %s\n", gai_strerror(ret));
return 0;
ret = getaddrinfo("0.0.0.0", endpoint, &hints, &ai);
if (ret < 0)
{
ERR("getaddrinfo failed: %s\n", gai_strerror(ret));
return 0;
}
}
if (ai->ai_family == PF_INET)
......
......@@ -270,6 +270,16 @@ static void test_towers(void)
ok(ret == RPC_S_OK, "TowerExplode failed with error %ld\n", ret);
I_RpcFree(tower);
/* test the behaviour for ip_tcp with name instead of dotted IP notation */
ret = TowerConstruct(&mapi_if_id, &ndr_syntax, "ncacn_ip_tcp", "135", "localhost", &tower);
ok(ret == RPC_S_OK, "TowerConstruct failed with error %ld\n", ret);
ret = TowerExplode(tower, NULL, NULL, NULL, NULL, &address);
ok(ret == RPC_S_OK, "TowerExplode failed with error %ld\n", ret);
ok(!strcmp(address, "0.0.0.0"), "address was \"%s\" instead of \"0.0.0.0\"\n", address);
I_RpcFree(address);
I_RpcFree(tower);
}
START_TEST( rpc )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment