[libvirt] [libvirt-sandbox][PATCH] Avoid segfault if broadcast address is NULL

Daniel P. Berrange berrange at redhat.com
Thu Mar 14 11:16:35 UTC 2013


On Thu, Mar 14, 2013 at 07:00:43PM +0800, Alex Jia wrote:
> It seems the broadcast address parameter is not optional now, if users haven't
> specified the broadcast address to the network interface then a segfault will
> be raised.
> 
> This patch is just a temporary solution to avoid segfault, and with the patch,
> users will get a expected error "Unable to parse networks: Unable to parse
> broadcast address (null)", of course, a better patch should automatically
> generate a broadcast address according to actual ip address. But AFAIK,
> the IPv6 hasn't defined broadcast address, so it needs to do address protocol
> judgement firstly, I will try to implement it later.

I think that if you don't explicitly set a broadcast address, then the
kernel will set one on the device based on its address/netmask. So I
think you can just allow a NULL bcast value everywhere in virt-sandbox
code.

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




More information about the libvir-list mailing list