mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
pfsync: fix incorrect enabling of defer mode
When we exposed the PFSYNCF_OK flag to userspace in5f5bf88949we 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 (cherry picked from commit73fd0eaf59)
This commit is contained in:
parent
87246654e3
commit
3836400a78
2 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
err(1, "SIOCGETPFSYNC");
|
||||
|
||||
preq.pfsyncr_defer = d;
|
||||
preq.pfsyncr_defer = d ? PFSYNCF_DEFER : 0;
|
||||
if (ioctl(s, SIOCSETPFSYNC, (caddr_t)&ifr) == -1)
|
||||
err(1, "SIOCSETPFSYNC");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1399,7 +1399,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||
pfsyncr.pfsyncr_syncpeer.s_addr;
|
||||
|
||||
sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates;
|
||||
if (pfsyncr.pfsyncr_defer) {
|
||||
if (pfsyncr.pfsyncr_defer & PFSYNCF_DEFER) {
|
||||
sc->sc_flags |= PFSYNCF_DEFER;
|
||||
V_pfsync_defer_ptr = pfsync_defer;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue