pfsync: fix incorrect enabling of defer mode
When we exposed the PFSYNCF_OK flag to userspace in 5f5bf88949
we
unintentionally caused defer mode to always be enabled.
The ioctl check only looked for nonzero, not for the PFSYNCF_DEFER flag.
Fix this check and ensure ifconfig sets the flag.
Reviewed by: glebius
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33244
This commit is contained in:
parent
41c4f19872
commit
73fd0eaf59
@ -178,7 +178,7 @@ setpfsync_defer(const char *val, int d, int s, const struct afswtch *rafp)
|
|||||||
if (ioctl(s, SIOCGETPFSYNC, (caddr_t)&ifr) == -1)
|
if (ioctl(s, SIOCGETPFSYNC, (caddr_t)&ifr) == -1)
|
||||||
err(1, "SIOCGETPFSYNC");
|
err(1, "SIOCGETPFSYNC");
|
||||||
|
|
||||||
preq.pfsyncr_defer = d;
|
preq.pfsyncr_defer = d ? PFSYNCF_DEFER : 0;
|
||||||
if (ioctl(s, SIOCSETPFSYNC, (caddr_t)&ifr) == -1)
|
if (ioctl(s, SIOCSETPFSYNC, (caddr_t)&ifr) == -1)
|
||||||
err(1, "SIOCSETPFSYNC");
|
err(1, "SIOCSETPFSYNC");
|
||||||
}
|
}
|
||||||
|
@ -1399,7 +1399,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||||||
pfsyncr.pfsyncr_syncpeer.s_addr;
|
pfsyncr.pfsyncr_syncpeer.s_addr;
|
||||||
|
|
||||||
sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates;
|
sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates;
|
||||||
if (pfsyncr.pfsyncr_defer) {
|
if (pfsyncr.pfsyncr_defer & PFSYNCF_DEFER) {
|
||||||
sc->sc_flags |= PFSYNCF_DEFER;
|
sc->sc_flags |= PFSYNCF_DEFER;
|
||||||
V_pfsync_defer_ptr = pfsync_defer;
|
V_pfsync_defer_ptr = pfsync_defer;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user