virNetworkDefUpdateIPDHCPHost: Don't crash when updating network
virNetworkDefUpdateIPDHCPHost: Don't crash when updating network

https://bugzilla.redhat.com/show_bug.cgi?id=1182486

When updating a network and adding new ip-dhcp-host entry, the deamon
may crash. The problem is, we iterate over existing <host/> entries
trying to compare MAC addresses to see if there's already an existing
rule. However, not all entries are required to have MAC address. For
instance, the following is perfectly valid entry:

<host id='00:04:58:fd:e4:15:1b:09:4c:0e:09:af:e4:d3:8c:b8:ca:1e'
name='redhatipv6.redhat.com' ip='2001:db8:ca2:2::119'/>

When the checking loop iterates over this, the entry's MAC address is
accessed directly. Well, the fix is obvious - check if the address is
defined before trying to compare it.

Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

jardasgit/libvirt,shugaoye/libvirt,jfehlig/libvirt,elmarco/libvirt,shugaoye/libvirt,datto/libvirt,olafhering/libvirt,andreabolognani/libvirt,datto/libvirt,fabianfreyer/libvirt,datto/libvirt,jardasgit/libvirt,taget/libvirt,andreabolognani/libvirt,agx/libvirt,libvirt/libvirt,eskultety/libvirt,taget/libvirt,rlaager/libvirt,andreabolognani/libvirt,jfehlig/libvirt,jfehlig/libvirt,jardasgit/libvirt,crobinso/libvirt,fabianfreyer/libvirt,elmarco/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,VenkatDatta/libvirt,eskultety/libvirt,shugaoye/libvirt,datto/libvirt,nertpinx/libvirt,olafhering/libvirt,nertpinx/libvirt,rlaager/libvirt,fabianfreyer/libvirt,zippy2/libvirt,VenkatDatta/libvirt,elmarco/libvirt,VenkatDatta/libvirt,agx/libvirt,elmarco/libvirt,crobinso/libvirt,agx/libvirt,eskultety/libvirt,datto/libvirt,nertpinx/libvirt,jfehlig/libvirt,nertpinx/libvirt,zippy2/libvirt,VenkatDatta/libvirt,libvirt/libvirt,zippy2/libvirt,eskultety/libvirt,zippy2/libvirt,jardasgit/libvirt,olafhering/libvirt,taget/libvirt,crobinso/libvirt,eskultety/libvirt,shugaoye/libvirt,olafhering/libvirt,taget/libvirt,elmarco/libvirt,andreabolognani/libvirt,VenkatDatta/libvirt,crobinso/libvirt,andreabolognani/libvirt,rlaager/libvirt,libvirt/libvirt,taget/libvirt,libvirt/libvirt,agx/libvirt,jardasgit/libvirt,rlaager/libvirt,rlaager/libvirt,agx/libvirt,shugaoye/libvirt