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

Function pf_patch_8

freebsd/netpfil/pf/pf.c:2134–2150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2132}
2133
2134static void
2135pf_patch_8(struct mbuf *m, u_int16_t *cksum, u_int8_t *f, u_int8_t v, bool hi,
2136 u_int8_t udp)
2137{
2138 u_int16_t old = htons(hi ? (*f << 8) : *f);
2139 u_int16_t new = htons(hi ? ( v << 8) : v);
2140
2141 if (*f == v)
2142 return;
2143
2144 *f = v;
2145
2146 if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6))
2147 return;
2148
2149 *cksum = pf_cksum_fixup(*cksum, old, new, udp);
2150}
2151
2152void
2153pf_patch_16_unaligned(struct mbuf *m, u_int16_t *cksum, void *f, u_int16_t v,

Callers 2

pf_patch_16_unalignedFunction · 0.85
pf_patch_32_unalignedFunction · 0.85

Calls 1

pf_cksum_fixupFunction · 0.85

Tested by

no test coverage detected