MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pfsync_insert_state

Function pfsync_insert_state

freebsd/netpfil/pf/if_pfsync.c:1721–1747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1719}
1720
1721static void
1722pfsync_insert_state(struct pf_state *st)
1723{
1724 struct pfsync_softc *sc = V_pfsyncif;
1725 struct pfsync_bucket *b = pfsync_get_bucket(sc, st);
1726
1727 if (st->state_flags & PFSTATE_NOSYNC)
1728 return;
1729
1730 if ((st->rule.ptr->rule_flag & PFRULE_NOSYNC) ||
1731 st->key[PF_SK_WIRE]->proto == IPPROTO_PFSYNC) {
1732 st->state_flags |= PFSTATE_NOSYNC;
1733 return;
1734 }
1735
1736 KASSERT(st->sync_state == PFSYNC_S_NONE,
1737 ("%s: st->sync_state %u", __func__, st->sync_state));
1738
1739 PFSYNC_BUCKET_LOCK(b);
1740 if (b->b_len == PFSYNC_MINPKT)
1741 callout_reset(&b->b_tmo, 1 * hz, pfsync_timeout, b);
1742
1743 pfsync_q_ins(st, PFSYNC_S_INS, true);
1744 PFSYNC_BUCKET_UNLOCK(b);
1745
1746 st->sync_updates = 0;
1747}
1748
1749static int
1750pfsync_defer(struct pf_state *st, struct mbuf *m)

Callers

nothing calls this directly

Calls 2

pfsync_get_bucketFunction · 0.85
pfsync_q_insFunction · 0.85

Tested by

no test coverage detected