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

Function pf_change_a

freebsd/netpfil/pf/pf.c:2245–2254  ·  view source on GitHub ↗

Changes a u_int32_t. Uses a void * so there are no align restrictions */

Source from the content-addressed store, hash-verified

2243
2244/* Changes a u_int32_t. Uses a void * so there are no align restrictions */
2245void
2246pf_change_a(void *a, u_int16_t *c, u_int32_t an, u_int8_t u)
2247{
2248 u_int32_t ao;
2249
2250 memcpy(&ao, a, sizeof(ao));
2251 memcpy(a, &an, sizeof(u_int32_t));
2252 *c = pf_cksum_fixup(pf_cksum_fixup(*c, ao / 65536, an / 65536, u),
2253 ao % 65536, an % 65536, u);
2254}
2255
2256void
2257pf_change_proto_a(struct mbuf *m, void *a, u_int16_t *c, u_int32_t an, u_int8_t udp)

Callers 3

pf_test_ruleFunction · 0.85
pf_test_state_icmpFunction · 0.85
pf_test_state_otherFunction · 0.85

Calls 2

pf_cksum_fixupFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected