Re: [libvirt] [PATCH] Fix misuse of PF_UNIX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



john.levon@xxxxxxx wrote:
> Fix misuse of PF_UNIX
>
> PF_UNIX is a protocol familay, not a valid protocol, so isn't suitable
> for the 3rd socket() argument. Solaris should be ignoring the invalid
> protocol anyway, but this fix is correct regardless.
>
> Signed-off-by: John Levon <john.levon@xxxxxxx>
>
> diff --git a/src/xend_internal.c b/src/xend_internal.c
> --- a/src/xend_internal.c
> +++ b/src/xend_internal.c
> @@ -752,7 +752,11 @@ xenDaemonOpen_unix(virConnectPtr conn, c
>
>      memset(&priv->addr, 0, sizeof(priv->addr));
>      priv->addrfamily = AF_UNIX;
> -    priv->addrprotocol = PF_UNIX;
> +    /*
> +     * This must be zero on Solaris at least for AF_UNIX (which should
> +     * really be PF_UNIX, but doesn't matter).
> +     */
> +    priv->addrprotocol = 0;
>      priv->addrlen = sizeof(struct sockaddr_un);
>
>      addr = (struct sockaddr_un *)&priv->addr;

This looks like a fine change, especially
since the general recommendation is to specify protocol as 0.
Considering the above and that this is a bug fix, I'd drop the
comment altogether.

ACK.

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]