From ca0b64e5ed5c60543ff4758c858f65cd090512f0 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 30 Mar 2017 19:43:09 +0200 Subject: nbd sockets vnc: Mark problematic address family tests TODO Certain features make sense only with certain address families. For instance, passing file descriptors requires AF_UNIX. Testing SocketAddress's saddr->type == SOCKET_ADDRESS_KIND_UNIX is obvious, but problematic: it can't recognize AF_UNIX when type == SOCKET_ADDRESS_KIND_FD. Mark such tests of saddr->type TODO. We may want to check the address family with getsockname() there. Cc: Paolo Bonzini Cc: Gerd Hoffmann Cc: Daniel P. Berrange Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz Reviewed-by: Eric Blake Message-id: 1490895797-29094-2-git-send-email-armbru@redhat.com Signed-off-by: Max Reitz --- util/qemu-sockets.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util') diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 40164bf681..9b7368113c 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -1154,6 +1154,10 @@ int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp) { int fd; + /* + * TODO SOCKET_ADDRESS_KIND_FD when fd is AF_INET or AF_INET6 + * (although other address families can do SOCK_DGRAM, too) + */ switch (remote->type) { case SOCKET_ADDRESS_KIND_INET: fd = inet_dgram_saddr(remote->u.inet.data, -- cgit v1.2.1