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

Function pfsync_in_del_c

freebsd/netpfil/pf/if_pfsync.c:1143–1173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1141}
1142
1143static int
1144pfsync_in_del_c(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count)
1145{
1146 struct mbuf *mp;
1147 struct pfsync_del_c *sa, *sp;
1148 struct pf_state *st;
1149 int len = count * sizeof(*sp);
1150 int offp, i;
1151
1152 mp = m_pulldown(m, offset, len, &offp);
1153 if (mp == NULL) {
1154 V_pfsyncstats.pfsyncs_badlen++;
1155 return (-1);
1156 }
1157 sa = (struct pfsync_del_c *)(mp->m_data + offp);
1158
1159 for (i = 0; i < count; i++) {
1160 sp = &sa[i];
1161
1162 st = pf_find_state_byid(sp->id, sp->creatorid);
1163 if (st == NULL) {
1164 V_pfsyncstats.pfsyncs_badstate++;
1165 continue;
1166 }
1167
1168 st->state_flags |= PFSTATE_NOSYNC;
1169 pf_unlink_state(st, PF_ENTER_LOCKED);
1170 }
1171
1172 return (len);
1173}
1174
1175static int
1176pfsync_in_bus(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