[libvirt] [PATCH] network: fix crash when starting a network with no <pf> element

Laine Stump laine at laine.org
Fri Aug 15 06:50:30 UTC 2014


On 08/14/2014 05:10 PM, Martin Kletzander wrote:
> On Thu, Aug 14, 2014 at 12:40:07PM -0400, Laine Stump wrote:
>>
>> src/network/bridge_driver.c | 17 +++++++----------
>> 1 file changed, 7 insertions(+), 10 deletions(-)
>>
>> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
>> index 1ba4c3d..fc4c73d 100644
>> --- a/src/network/bridge_driver.c
>> +++ b/src/network/bridge_driver.c
>> @@ -2196,6 +2196,9 @@ networkCreateInterfacePool(virNetworkDefPtr
>> netdef)
>>     int ret = -1;
>>     size_t i;
>>
>> +    if (!netdef->forward.npfs || netdef->forward.nifs > 0)
>
> I'd match these to use both !var (or var != 0), but other than that
> the patch is fine, ACK with that fixed.

I decided to go with == 0 and > 0. They are closest to what is happening
in my mind when I think about the condition, so hopefully will be the
easiest for others to understand.

Thanks!




More information about the libvir-list mailing list