Hi, pfsync does "bulk update" just after boot, I noticed it sometimes fails. When finishing "bulk update", the duration in the "bulk-end" packet and our duration based on uptime are compared, but that comparision should be fixed. It must consider the values are rounded in a second.
ok? Consider being rounded in a second when comparing the duration in "bulk-end" packet and the duration based on our uptime. This fixes the problem the carp demote count sometimes becomes 33 after reboot. Index: sys/net/if_pfsync.c =================================================================== RCS file: /cvs/src/sys/net/if_pfsync.c,v retrieving revision 1.274 diff -u -p -r1.274 if_pfsync.c --- sys/net/if_pfsync.c 10 Jul 2020 13:26:42 -0000 1.274 +++ sys/net/if_pfsync.c 25 Jul 2020 05:09:47 -0000 @@ -1169,8 +1169,7 @@ pfsync_in_bus(caddr_t buf, int len, int break; case PFSYNC_BUS_END: - if (getuptime() - ntohl(bus->endtime) >= - sc->sc_ureq_sent) { + if (ntohl(bus->endtime) <= getuptime() + 1 - sc->sc_ureq_sent) { /* that's it, we're happy */ sc->sc_ureq_sent = 0; sc->sc_bulk_tries = 0;