| 1719 | } |
| 1720 | |
| 1721 | static void |
| 1722 | pfsync_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 | |
| 1749 | static int |
| 1750 | pfsync_defer(struct pf_state *st, struct mbuf *m) |
nothing calls this directly
no test coverage detected