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

Instead just fill it in with all zeros.
This commit is contained in:
Robert Shearman 2006-06-02 20:46:29 +01:00 committed by Alexandre Julliard
parent ebcd6b6a24
commit 0fad0895d7
2 changed files with 17 additions and 3 deletions

View File

@ -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)

View File

@ -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 )