diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-05-27 11:44:16 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-06-02 14:07:45 -0400 |
commit | bfdcff2b28f399d236b592d13663c7283d6eac2c (patch) | |
tree | 30f94de16adef2e5058ae902bea2b5edccc2b39b /src/providers | |
parent | 7591a7368078c2b4cde744ede431260fd663903a (diff) | |
download | sssd-bfdcff2b28f399d236b592d13663c7283d6eac2c.tar.gz sssd-bfdcff2b28f399d236b592d13663c7283d6eac2c.tar.bz2 sssd-bfdcff2b28f399d236b592d13663c7283d6eac2c.zip |
Add utility function to return IP address as string
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/ipa/ipa_common.c | 10 | ||||
-rw-r--r-- | src/providers/krb5/krb5_common.c | 11 |
2 files changed, 4 insertions, 17 deletions
diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c index da3fcd6f..eadbda35 100644 --- a/src/providers/ipa/ipa_common.c +++ b/src/providers/ipa/ipa_common.c @@ -609,15 +609,9 @@ static void ipa_resolve_callback(void *private_data, struct fo_server *server) return; } - address = talloc_zero_size(service, 128); + address = resolv_get_string_address(service, srvaddr); if (address == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); - return; - } - - if (inet_ntop(srvaddr->h_addrtype, srvaddr->h_addr_list[0], - address, 128) == NULL) { - DEBUG(1, ("inet_ntop failed [%d][%s].\n", errno, strerror(errno))); + DEBUG(1, ("resolv_get_string_address failed.\n")); return; } diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c index ca37ba7d..c0ed6ce3 100644 --- a/src/providers/krb5/krb5_common.c +++ b/src/providers/krb5/krb5_common.c @@ -394,16 +394,9 @@ static void krb5_resolve_callback(void *private_data, struct fo_server *server) return; } - address = talloc_zero_size(krb5_service, 128); + address = resolv_get_string_address(krb5_service, srvaddr); if (address == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); - return; - } - - if (inet_ntop(srvaddr->h_addrtype, srvaddr->h_addr_list[0], - address, 128) == NULL) { - ret = errno; - DEBUG(1, ("inet_ntop failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, ("resolv_get_string_address failed.\n")); return; } |