[PATCH] bugfix: virNetDevBridgeSetSTPDelay on BSD

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

 



virNetDevBridgeSetSTPDelay accepts delay in milliseconds,
but BSD implementation was expecting seconds. Therefore,
it was working correctly only with delay == 0.
---
 src/util/virnetdevbridge.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c
index ffcb4a4..9d95374 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -593,10 +593,11 @@ int virNetDevBridgeSetSTPDelay(const char *brname,
                                int delay)
 {
     struct ifbrparam param;
+    u_long delay_seconds = delay / 1000;
 
     /* FreeBSD doesn't allow setting STP delay < 4 */
-    delay = delay < 4 ? 4 : delay;
-    param.ifbrp_fwddelay = ((u_long)delay) & 0xff;
+    delay_seconds = delay_seconds < 4 ? 4 : delay_seconds;
+    param.ifbrp_fwddelay = delay_seconds & 0xff;
 
     if (virNetDevBridgeCmd(brname, BRDGSFD, &param, sizeof(param)) < 0) {
         virReportSystemError(errno,
-- 
1.8.2.3

--
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]