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

Function pfsync_in_iack

freebsd/netpfil/pf/if_pfsync.c:827–862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825}
826
827static int
828pfsync_in_iack(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count)
829{
830 struct pfsync_ins_ack *ia, *iaa;
831 struct pf_state *st;
832
833 struct mbuf *mp;
834 int len = count * sizeof(*ia);
835 int offp, i;
836
837 mp = m_pulldown(m, offset, len, &offp);
838 if (mp == NULL) {
839 V_pfsyncstats.pfsyncs_badlen++;
840 return (-1);
841 }
842 iaa = (struct pfsync_ins_ack *)(mp->m_data + offp);
843
844 for (i = 0; i < count; i++) {
845 ia = &iaa[i];
846
847 st = pf_find_state_byid(ia->id, ia->creatorid);
848 if (st == NULL)
849 continue;
850
851 if (st->state_flags & PFSTATE_ACK) {
852 pfsync_undefer_state(st, 0);
853 }
854 PF_STATE_UNLOCK(st);
855 }
856 /*
857 * XXX this is not yet implemented, but we know the size of the
858 * message so we can skip it.
859 */
860
861 return (count * sizeof(struct pfsync_ins_ack));
862}
863
864static int
865pfsync_upd_tcp(struct pf_state *st, struct pfsync_state_peer *src,

Callers

nothing calls this directly

Calls 3

m_pulldownFunction · 0.85
pf_find_state_byidFunction · 0.85
pfsync_undefer_stateFunction · 0.85

Tested by

no test coverage detected