pf: remove _unaligned from pf_patch_(16|32)_unaligned()

This is the only variant of the function, appending _unaligned does not clarify
anything.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost 2025-04-16 14:21:16 +02:00
parent 911d74bcbd
commit 435e921447
3 changed files with 9 additions and 9 deletions

View file

@ -2453,8 +2453,8 @@ void pf_change_a(void *, u_int16_t *, u_int32_t, u_int8_t);
void pf_change_proto_a(struct mbuf *, void *, u_int16_t *, u_int32_t,
u_int8_t);
void pf_change_tcp_a(struct mbuf *, void *, u_int16_t *, u_int32_t);
void pf_patch_16_unaligned(struct pf_pdesc *, void *, u_int16_t, bool);
void pf_patch_32_unaligned(struct pf_pdesc *, void *, u_int32_t, bool);
void pf_patch_16(struct pf_pdesc *, void *, u_int16_t, bool);
void pf_patch_32(struct pf_pdesc *, void *, u_int32_t, bool);
void pf_send_deferred_syn(struct pf_kstate *);
int pf_match_addr(u_int8_t, const struct pf_addr *,
const struct pf_addr *, const struct pf_addr *, sa_family_t);

View file

@ -3234,7 +3234,7 @@ pf_patch_8(struct pf_pdesc *pd, u_int8_t *f, u_int8_t v, bool hi)
}
void
pf_patch_16_unaligned(struct pf_pdesc *pd, void *f, u_int16_t v, bool hi)
pf_patch_16(struct pf_pdesc *pd, void *f, u_int16_t v, bool hi)
{
u_int8_t *fb = (u_int8_t *)f;
u_int8_t *vb = (u_int8_t *)&v;
@ -3244,7 +3244,7 @@ pf_patch_16_unaligned(struct pf_pdesc *pd, void *f, u_int16_t v, bool hi)
}
void
pf_patch_32_unaligned(struct pf_pdesc *pd, void *f, u_int32_t v, bool hi)
pf_patch_32(struct pf_pdesc *pd, void *f, u_int32_t v, bool hi)
{
u_int8_t *fb = (u_int8_t *)f;
u_int8_t *vb = (u_int8_t *)&v;
@ -3950,11 +3950,11 @@ pf_modulate_sack(struct pf_pdesc *pd, struct tcphdr *th,
for (i = 2; i + TCPOLEN_SACK <= olen;
i += TCPOLEN_SACK) {
memcpy(&sack, &opt[i], sizeof(sack));
pf_patch_32_unaligned(pd,
pf_patch_32(pd,
&sack.start,
htonl(ntohl(sack.start) - dst->seqdiff),
PF_ALGNMNT(startoff));
pf_patch_32_unaligned(pd,
pf_patch_32(pd,
&sack.end,
htonl(ntohl(sack.end) - dst->seqdiff),
PF_ALGNMNT(startoff));

View file

@ -1633,7 +1633,7 @@ pf_normalize_tcp_stateful(struct pf_pdesc *pd,
(src->scrub->pfss_flags &
PFSS_TIMESTAMP)) {
tsval = ntohl(tsval);
pf_patch_32_unaligned(pd,
pf_patch_32(pd,
&opt[2],
htonl(tsval +
src->scrub->pfss_ts_mod),
@ -1649,7 +1649,7 @@ pf_normalize_tcp_stateful(struct pf_pdesc *pd,
PFSS_TIMESTAMP)) {
tsecr = ntohl(tsecr)
- dst->scrub->pfss_ts_mod;
pf_patch_32_unaligned(pd,
pf_patch_32(pd,
&opt[6],
htonl(tsecr),
PF_ALGNMNT(startoff));
@ -1974,7 +1974,7 @@ pf_normalize_mss(struct pf_pdesc *pd)
case TCPOPT_MAXSEG:
mss = (u_int16_t *)(optp + 2);
if ((ntohs(*mss)) > pd->act.max_mss) {
pf_patch_16_unaligned(pd,
pf_patch_16(pd,
mss, htons(pd->act.max_mss),
PF_ALGNMNT(startoff));
m_copyback(pd->m, pd->off + sizeof(*th),