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

Eric Blake eblake at redhat.com
Thu Aug 23 16:06:04 UTC 2012


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.

> +    /* 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?

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120823/f8727f29/attachment-0001.sig>


More information about the libvir-list mailing list