State table reorganisation State linking Inbound: we store a pointer to the stackside state key in the pkthdr Outbound: finding the state key is as simple as: if (dir == PF_OUT && m->m_pkthdr.pf.statekey && ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->reverse) sk = ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->reverse; no more redundant state table searches!