]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virnetsocket: fix getsockopt on FreeBSD
authorRyota Ozaki <ozaki.ryota@gmail.com>
Thu, 24 Oct 2013 15:48:25 +0000 (00:48 +0900)
committerDoug Goldstein <cardoe@cardoe.com>
Sun, 3 Nov 2013 23:08:55 +0000 (17:08 -0600)
commit8079b0e0f40aa0ad19e9aec7a69143ee858321a2
tree35c6c8f3a96790ef6461839edb4459cabbc3ba7e
parent9fa3a8ab6fd82ad2f5a14b490696085061418718
virnetsocket: fix getsockopt on FreeBSD

aa0f099 introduced a strict error checking for getsockopt and it
revealed that getting a peer credential of a socket on FreeBSD
didn't work. Libvirtd hits the error:
  error : virNetSocketGetUNIXIdentity:1198 : Failed to get valid
  client socket identity groups

SOL_SOCKET (0xffff) was used as a level of getsockopt for
LOCAL_PEERCRED, however, it was wrong. 0 is correct as well as
Mac OS X.

So for LOCAL_PEERCRED our options are SOL_LOCAL (if defined) or
0 on Mac OS X and FreeBSD. According to the fact, the patch
simplifies the code by removing ifdef __APPLE__.

I tested the patch on FreeBSD 8.4, 9.2 and 10.0-BETA1.

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
src/rpc/virnetsocket.c