aboutsummaryrefslogtreecommitdiff
path: root/vnc.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-01-20 11:42:40 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-01-20 08:25:23 -0600
commitdc0d4efc02188ad9e5785adaba874bfd198eee76 (patch)
tree8377d36d89af5e9412447e62a4a5cb36314e8230 /vnc.c
parentc445321e66facc440d7de64f39fa33cb0cc330b2 (diff)
vnc: Use inet_strfamily()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vnc.c')
-rw-r--r--vnc.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/vnc.c b/vnc.c
index c7d6652e15..cc2a26e5c6 100644
--- a/vnc.c
+++ b/vnc.c
@@ -100,26 +100,6 @@ char *vnc_socket_remote_addr(const char *format, int fd) {
return addr_to_string(format, &sa, salen);
}
-static QString *get_sock_family(const struct sockaddr_storage *sa)
-{
- const char *name;
-
- switch (sa->ss_family)
- {
- case AF_INET:
- name = "ipv4";
- break;
- case AF_INET6:
- name = "ipv6";
- break;
- default:
- name = "unknown";
- break;
- }
-
- return qstring_from_str(name);
-}
-
static int put_addr_qdict(QDict *qdict, struct sockaddr_storage *sa,
socklen_t salen)
{
@@ -138,7 +118,7 @@ static int put_addr_qdict(QDict *qdict, struct sockaddr_storage *sa,
qdict_put(qdict, "host", qstring_from_str(host));
qdict_put(qdict, "service", qstring_from_str(serv));
- qdict_put(qdict, "family", get_sock_family(sa));
+ qdict_put(qdict, "family",qstring_from_str(inet_strfamily(sa->ss_family)));
return 0;
}