summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-11-16 17:40:17 +0000
committertedu <tedu@openbsd.org>2014-11-16 17:40:17 +0000
commite04cbca0bb7dcb6bd0be44b126d48e08d14e12a1 (patch)
tree67750950f605b232cbacc70c11e2d58200e05ff9
parentDefining the interface in terms of char * means most callers are (diff)
downloadwireguard-openbsd-e04cbca0bb7dcb6bd0be44b126d48e08d14e12a1.tar.xz
wireguard-openbsd-e04cbca0bb7dcb6bd0be44b126d48e08d14e12a1.zip
remove now unnecessary casts from hash update calls.
-rw-r--r--sys/net/pf.c16
-rw-r--r--sys/netinet/tcp_subr.c16
2 files changed, 16 insertions, 16 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 5ea4baf9b45..6851e9778a1 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.893 2014/11/16 17:37:42 tedu Exp $ */
+/* $OpenBSD: pf.c,v 1.894 2014/11/16 17:40:17 tedu Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -3046,20 +3046,20 @@ pf_tcp_iss(struct pf_pdesc *pd)
}
ctx = pf_tcp_secret_ctx;
- SHA512Update(&ctx, (char *)&pd->rdomain, sizeof(pd->rdomain));
- SHA512Update(&ctx, (char *)&pd->hdr.tcp->th_sport, sizeof(u_short));
- SHA512Update(&ctx, (char *)&pd->hdr.tcp->th_dport, sizeof(u_short));
+ SHA512Update(&ctx, &pd->rdomain, sizeof(pd->rdomain));
+ SHA512Update(&ctx, &pd->hdr.tcp->th_sport, sizeof(u_short));
+ SHA512Update(&ctx, &pd->hdr.tcp->th_dport, sizeof(u_short));
switch (pd->af) {
#ifdef INET
case AF_INET:
- SHA512Update(&ctx, (char *)&pd->src->v4, sizeof(struct in_addr));
- SHA512Update(&ctx, (char *)&pd->dst->v4, sizeof(struct in_addr));
+ SHA512Update(&ctx, &pd->src->v4, sizeof(struct in_addr));
+ SHA512Update(&ctx, &pd->dst->v4, sizeof(struct in_addr));
break;
#endif /* INET */
#ifdef INET6
case AF_INET6:
- SHA512Update(&ctx, (char *)&pd->src->v6, sizeof(struct in6_addr));
- SHA512Update(&ctx, (char *)&pd->dst->v6, sizeof(struct in6_addr));
+ SHA512Update(&ctx, &pd->src->v6, sizeof(struct in6_addr));
+ SHA512Update(&ctx, &pd->dst->v6, sizeof(struct in6_addr));
break;
#endif /* INET6 */
}
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index a3810f38c0d..628aac461a0 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_subr.c,v 1.136 2014/11/06 12:05:32 mpi Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.137 2014/11/16 17:40:17 tedu Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@@ -963,18 +963,18 @@ tcp_set_iss_tsm(struct tcpcb *tp)
tcp_secret_init = 1;
}
ctx = tcp_secret_ctx;
- SHA512Update(&ctx, (char *)&rdomain, sizeof(rdomain));
- SHA512Update(&ctx, (char *)&tp->t_inpcb->inp_lport, sizeof(u_short));
- SHA512Update(&ctx, (char *)&tp->t_inpcb->inp_fport, sizeof(u_short));
+ SHA512Update(&ctx, &rdomain, sizeof(rdomain));
+ SHA512Update(&ctx, &tp->t_inpcb->inp_lport, sizeof(u_short));
+ SHA512Update(&ctx, &tp->t_inpcb->inp_fport, sizeof(u_short));
if (tp->pf == AF_INET6) {
- SHA512Update(&ctx, (char *)&tp->t_inpcb->inp_laddr6,
+ SHA512Update(&ctx, &tp->t_inpcb->inp_laddr6,
sizeof(struct in6_addr));
- SHA512Update(&ctx, (char *)&tp->t_inpcb->inp_faddr6,
+ SHA512Update(&ctx, &tp->t_inpcb->inp_faddr6,
sizeof(struct in6_addr));
} else {
- SHA512Update(&ctx, (char *)&tp->t_inpcb->inp_laddr,
+ SHA512Update(&ctx, &tp->t_inpcb->inp_laddr,
sizeof(struct in_addr));
- SHA512Update(&ctx, (char *)&tp->t_inpcb->inp_faddr,
+ SHA512Update(&ctx, &tp->t_inpcb->inp_faddr,
sizeof(struct in_addr));
}
SHA512Final(digest.bytes, &ctx);