diff options
author | Sage Weil <sage@newdream.net> | 2009-10-27 11:46:38 -0700 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-10-27 11:46:38 -0700 |
commit | 23161f80effb094fd3a4cf2b01c1dba337c6f0c1 (patch) | |
tree | 7a864f054c86b7f58157f56e45075b31a1223581 /src/mount | |
parent | fe5639319140aa0a30734cf6a2f6b2746b2f9f8f (diff) | |
download | ceph-23161f80effb094fd3a4cf2b01c1dba337c6f0c1.tar.gz |
mount.ceph: only return INET addr when doing lookup
Diffstat (limited to 'src/mount')
-rw-r--r-- | src/mount/mount.ceph.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mount/mount.ceph.c b/src/mount/mount.ceph.c index 9cd90d86c2c..208be173864 100644 --- a/src/mount/mount.ceph.c +++ b/src/mount/mount.ceph.c @@ -75,6 +75,7 @@ char *mount_resolve_dest(char *orig_str) tok = strtok(orig_str, ","); while (tok) { + struct addrinfo hint; struct addrinfo *res, *ores; int r; @@ -88,7 +89,10 @@ char *mount_resolve_dest(char *orig_str) /*printf("name '%s' port '%s'\n", tok, port_str);*/ - r = getaddrinfo(tok, port_str, NULL, &res); + memset(&hint, 0, sizeof(hint)); + hint.ai_protocol = AF_INET; + + r = getaddrinfo(tok, port_str, &hint, &res); if (r < 0) { printf("server name not found: %s (%s)\n", tok, strerror(errno)); free(new_str); @@ -103,7 +107,10 @@ char *mount_resolve_dest(char *orig_str) host, sizeof(host), port, sizeof(port), NI_NUMERICSERV | NI_NUMERICHOST); - /*printf(" host %s port %s\n", host, port);*/ + /*printf(" host %s port %s flags %d family %d socktype %d proto %d sanonname %s\n", + host, port, + res->ai_flags, res->ai_family, res->ai_socktype, res->ai_protocol, + res->ai_canonname);*/ pos = safe_cat(&new_str, &len, pos, host); if (port_str) { pos = safe_cat(&new_str, &len, pos, ":"); |