Re: [PATCH] Don't use AI_ADDRCONFIG when binding to wildcard addresses

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

 



On Fri, May 30, 2014 at 08:21:40AM +0200, Ján Tomko wrote:
> On 05/29/2014 04:47 PM, Eric Blake wrote:
> > On 05/29/2014 03:32 AM, Ján Tomko wrote:
> >> https://bugzilla.redhat.com/show_bug.cgi?id=1098659
> >>
> >> With parallel boot, network addresses might not yet be assigned [1],
> >> but binding to wildcard addresses should work.
> >>
> >> For non-wildcard addresses, ADDRCONFIG is still used. Document this
> >> in libvirtd.conf.
> >>
> >> [1] http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
> >> ---
> > 
> >> -    hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
> >> +    hints.ai_flags = AI_PASSIVE;
> >>      hints.ai_socktype = SOCK_STREAM;
> >>  
> >> +    /* Don't use ADDRCONFIG for binding to the wildcard address.
> >> +     * Just catch the error returned by socket() if the system has
> >> +     * no IPv6 support.
> >> +     *
> >> +     * This allows libvirtd to be started in parallel with the network
> >> +     * startup in most cases.
> >> +     */
> >> +    if (nodename &&
> >> +        !(virSocketAddrParse(&tmp_addr, nodename, AF_UNSPEC) > 0 &&
> >> +          virSocketAddrIsWildcard(&tmp_addr)))
> >> +        hints.ai_flags = AI_ADDRCONFIG;
> > 
> > Shouldn't this be |= ?
> > 
> 
> Functionally it's the same, AI_PASSIVE is ignored if nodename is non-NULL.
> 
> But it should be |= if we were using other flags.

Please make it '|=' regardless. Using '=' is setting a nasty trap-door for
a future change which adds some other flags where use of '|=' will be
needed.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]