git: b0ba95a9ce57 - main - pf: remove now unnecessary casts from hash update calls
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 19 Feb 2025 10:41:41 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=b0ba95a9ce57db8b6eef6ab2e6c9c2482c7d30ed
commit b0ba95a9ce57db8b6eef6ab2e6c9c2482c7d30ed
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-02-12 16:28:30 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-02-19 10:41:09 +0000
pf: remove now unnecessary casts from hash update calls
Obtained from: OpenBSD, tedu <tedu@openbsd.org>, e04cbca0bb
Sponsored by: Rubicon Communications, LLC ("Netgate")
---
sys/netpfil/pf/pf.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 0e816f1205c5..9b1a2f6a1bac 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -5067,16 +5067,16 @@ pf_tcp_iss(struct pf_pdesc *pd)
ctx = V_pf_tcp_secret_ctx;
- SHA512_Update(&ctx, (char *)&pd->hdr.tcp.th_sport, sizeof(u_short));
- SHA512_Update(&ctx, (char *)&pd->hdr.tcp.th_dport, sizeof(u_short));
+ SHA512_Update(&ctx, &pd->hdr.tcp.th_sport, sizeof(u_short));
+ SHA512_Update(&ctx, &pd->hdr.tcp.th_dport, sizeof(u_short));
switch (pd->af) {
case AF_INET6:
- SHA512_Update(&ctx, (char *)&pd->src->v6, sizeof(struct in6_addr));
- SHA512_Update(&ctx, (char *)&pd->dst->v6, sizeof(struct in6_addr));
+ SHA512_Update(&ctx, &pd->src->v6, sizeof(struct in6_addr));
+ SHA512_Update(&ctx, &pd->dst->v6, sizeof(struct in6_addr));
break;
case AF_INET:
- SHA512_Update(&ctx, (char *)&pd->src->v4, sizeof(struct in_addr));
- SHA512_Update(&ctx, (char *)&pd->dst->v4, sizeof(struct in_addr));
+ SHA512_Update(&ctx, &pd->src->v4, sizeof(struct in_addr));
+ SHA512_Update(&ctx, &pd->dst->v4, sizeof(struct in_addr));
break;
}
SHA512_Final(digest.bytes, &ctx);