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

Function pfsync_in_del

freebsd/netpfil/pf/if_pfsync.c:1112–1141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1110}
1111
1112static int
1113pfsync_in_del(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count)
1114{
1115 struct mbuf *mp;
1116 struct pfsync_state *sa, *sp;
1117 struct pf_state *st;
1118 int len = count * sizeof(*sp);
1119 int offp, i;
1120
1121 mp = m_pulldown(m, offset, len, &offp);
1122 if (mp == NULL) {
1123 V_pfsyncstats.pfsyncs_badlen++;
1124 return (-1);
1125 }
1126 sa = (struct pfsync_state *)(mp->m_data + offp);
1127
1128 for (i = 0; i < count; i++) {
1129 sp = &sa[i];
1130
1131 st = pf_find_state_byid(sp->id, sp->creatorid);
1132 if (st == NULL) {
1133 V_pfsyncstats.pfsyncs_badstate++;
1134 continue;
1135 }
1136 st->state_flags |= PFSTATE_NOSYNC;
1137 pf_unlink_state(st, PF_ENTER_LOCKED);
1138 }
1139
1140 return (len);
1141}
1142
1143static int
1144pfsync_in_del_c(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count)

Callers

nothing calls this directly

Calls 3

m_pulldownFunction · 0.85
pf_find_state_byidFunction · 0.85
pf_unlink_stateFunction · 0.85

Tested by

no test coverage detected