summaryrefslogtreecommitdiffstats
path: root/src/common/address_helper.cc
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2016-05-11 18:40:18 +0200
committerSage Weil <sage@redhat.com>2016-05-11 18:40:18 +0200
commitc68c5ce5639ecba483f7e8c55011a03b841d4182 (patch)
treeb39e8e405a1a27f0ec982668d6ed1a2cf4ce6f3b /src/common/address_helper.cc
parentmsg/xio: use set_sockaddr (diff)
downloadceph-c68c5ce5639ecba483f7e8c55011a03b841d4182.tar.xz
ceph-c68c5ce5639ecba483f7e8c55011a03b841d4182.zip
common/address_helper: drop entity_addr_from_sockaddr
entity_addr_t::set_sockaddr() does this. Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src/common/address_helper.cc')
-rw-r--r--src/common/address_helper.cc31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/common/address_helper.cc b/src/common/address_helper.cc
index 4431cb6dd94..4637935ebc7 100644
--- a/src/common/address_helper.cc
+++ b/src/common/address_helper.cc
@@ -51,34 +51,3 @@ int entity_addr_from_url(entity_addr_t *addr /* out */, const char *url)
return 1;
}
-int entity_addr_from_sockaddr(entity_addr_t *addr /* out */,
- const struct sockaddr *sa)
-{
- struct sockaddr_in *sin;
- struct sockaddr_in6 *sin6;
-
- if (! sa)
- return 0;
-
- addr->addr.ss_family = sa->sa_family;
- switch(sa->sa_family) {
- case AF_INET:
- sin = (struct sockaddr_in *) sa;
- memcpy(&addr->addr4.sin_addr, &sin->sin_addr,
- sizeof(sin->sin_addr));
- addr->addr4.sin_port = sin->sin_port;
- break;
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) sa;
- memcpy(&addr->addr6.sin6_addr, &sin6->sin6_addr,
- sizeof(sin6->sin6_addr));
- addr->addr6.sin6_port = sin6->sin6_port;
- break;
- default:
- break;
- };
-
- return 1;
-}
-
-