mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
Fix units in virNetDevBridgeSetSTPDelay on BSD
virNetDevBridgeSetSTPDelay accepts delay in milliseconds, but BSD implementation was expecting seconds. Therefore, it was working correctly only with delay == 0.
This commit is contained in:
parent
0c737dfb44
commit
f3d08aa0ba
@ -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, ¶m, sizeof(param)) < 0) {
|
||||
virReportSystemError(errno,
|
||||
|
Loading…
x
Reference in New Issue
Block a user