]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virNetworkDefUpdateIPDHCPHost: Don't crash when updating network
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 15 Jan 2015 14:42:04 +0000 (15:42 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 16 Jan 2015 08:57:05 +0000 (09:57 +0100)
commit7d3ae359db604f6052247ad49d7fbce1db7ef99c
tree1a1760e066dbe5e8864c9e2d79f38ff9241e3254
parentdd69a14f90b4bde9c07a6ef594914323874a26ce
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 <mprivozn@redhat.com>
src/conf/network_conf.c