]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: Resolve some issues around vlan copying
authorJohn Ferlan <jferlan@redhat.com>
Tue, 15 Jan 2013 18:35:34 +0000 (13:35 -0500)
committerLaine Stump <laine@laine.org>
Thu, 17 Jan 2013 17:38:51 +0000 (12:38 -0500)
commit35ed25bde9e0d1061ef9a96edcd968a5b4c8a375
tree928d4cd752f6937e78dc041602279d726d44a2c8
parent757e3d3af664691e3ce6023da49bbbb76f9eb0ac
network: Resolve some issues around vlan copying

Remove extraneous check for 'netdef' when dereferencing for vlan.nTags.
Prior code would already check if netdef was NULL.

Coverity complained about a path where the 'vlan' was potentially valid,
but a prior checks may not have allocated 'iface->data.network.actual',
so like other paths it needs to be allocated on the fly.

Move the copying of vlan up earlier in networkAllocateActualDevice, so
that actual.type gets properly set.

Since the first assignment to vlan is redundant except in the case of
jumping immediately to validate from the start of the function,
eliminate its initial setting at the top of the function in favor of
calling the helper function virDomainNetGetActualVlan() (which doesn't
depend on the local vlan pointer being initialized) down at validate:

Signed-off-by: Laine Stump <laine@redhat.com>
src/network/bridge_driver.c