Re: [PATCH] network: fix virtual network bridge delay setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/23/2012 12:06 PM, Eric Blake wrote:
> On 08/23/2012 09:26 AM, Laine Stump wrote:
>> libvirt's network config documents that a bridge's STP "forward delay"
>> (called "delay" in the XML) should be specified in seconds, but
>> virNetDevBridgeSetSTPDelay() assumes that it is given a delay in
>> milliseconds (although the comment at the top of the function
>> incorrectly says "seconds".
>>
>> This fixes the comment, and converts the delay to milliseconds before
>> calling virNetDevBridgeSetSTPDelay().
>> ---
> ACK.

Thanks. I pushed it.
>
>> +    /* delay is configured in seconds, but virNetDevBridgeSetSTPDelay
>> +     * expects milliseconds
>> +     */
>>      if (virNetDevBridgeSetSTPDelay(network->def->bridge,
>> -                          network->def->delay) < 0)
>> +                                   network->def->delay * 1000) < 0)
> Do we need to worry about integer overflow, or are the chances of
> someone configuring network->def->delay > INT_MAX/1000 unlikely?

If they set a value so large that it would overflow, they'd have bigger
problems than the overflow :-) (as in their guest's would need to be up
for the magical 49.7 days before they began to pass network traffic).
There's really no point in setting anything much bigger than 30 seconds;
if anything, we might want to consider limiting it to some maximum in
the RNG and parser. I just don't know what is the highest "reasonable"
value, though.

>

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]