| 2230 | } |
| 2231 | |
| 2232 | static void |
| 2233 | pfsync_bulk_fail(void *arg) |
| 2234 | { |
| 2235 | struct pfsync_softc *sc = arg; |
| 2236 | struct pfsync_bucket *b = &sc->sc_buckets[0]; |
| 2237 | |
| 2238 | CURVNET_SET(sc->sc_ifp->if_vnet); |
| 2239 | |
| 2240 | PFSYNC_BLOCK_ASSERT(sc); |
| 2241 | |
| 2242 | if (sc->sc_bulk_tries++ < PFSYNC_MAX_BULKTRIES) { |
| 2243 | /* Try again */ |
| 2244 | callout_reset(&sc->sc_bulkfail_tmo, 5 * hz, |
| 2245 | pfsync_bulk_fail, V_pfsyncif); |
| 2246 | PFSYNC_BUCKET_LOCK(b); |
| 2247 | pfsync_request_update(0, 0); |
| 2248 | PFSYNC_BUCKET_UNLOCK(b); |
| 2249 | } else { |
| 2250 | /* Pretend like the transfer was ok. */ |
| 2251 | sc->sc_ureq_sent = 0; |
| 2252 | sc->sc_bulk_tries = 0; |
| 2253 | PFSYNC_LOCK(sc); |
| 2254 | if (!(sc->sc_flags & PFSYNCF_OK) && carp_demote_adj_p) |
| 2255 | (*carp_demote_adj_p)(-V_pfsync_carp_adj, |
| 2256 | "pfsync bulk fail"); |
| 2257 | sc->sc_flags |= PFSYNCF_OK; |
| 2258 | PFSYNC_UNLOCK(sc); |
| 2259 | if (V_pf_status.debug >= PF_DEBUG_MISC) |
| 2260 | printf("pfsync: failed to receive bulk update\n"); |
| 2261 | } |
| 2262 | |
| 2263 | CURVNET_RESTORE(); |
| 2264 | } |
| 2265 | |
| 2266 | static void |
| 2267 | pfsync_send_plus(void *plus, size_t pluslen) |
nothing calls this directly
no test coverage detected