diff options
author | venaas <venaas> | 2008-02-21 14:40:43 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-02-21 14:40:43 +0000 |
commit | 1b147faa3975dc259abb2fc8c8d398ed44c4b01f (patch) | |
tree | d9bf7b8c340ee67ddf09d41156b9c1fe316be9ea | |
parent | 1932be8fffa9c6a1e3b6df17f51f3e29746cb7f4 (diff) |
Solaris9 fix
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@216 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r-- | util.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007 Stig Venaas <venaas@uninett.no> + * Copyright (C) 2006-2008 Stig Venaas <venaas@uninett.no> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -88,10 +88,12 @@ char *addr2string(struct sockaddr *addr, socklen_t len) { addr = (struct sockaddr *)&sa4; } } + len = addr->sa_family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); + if (getnameinfo(addr, len, addr_buf[i], sizeof(addr_buf[i]), NULL, 0, NI_NUMERICHOST)) { debug(DBG_WARN, "getnameinfo failed"); - return return "getnameinfo_failed"; + return "getnameinfo_failed"; } return addr_buf[i]; } |