diff options
author | 2001-07-03 04:26:37 +0000 | |
---|---|---|
committer | 2001-07-03 04:26:37 +0000 | |
commit | 5b12846ffc8eb8b21d199b60ffb9325510b11e61 (patch) | |
tree | 8576c32932c0fff9351c7f0501b33067f170d919 | |
parent | grr, you guys keep not obeying KNF (diff) | |
download | wireguard-openbsd-5b12846ffc8eb8b21d199b60ffb9325510b11e61.tar.xz wireguard-openbsd-5b12846ffc8eb8b21d199b60ffb9325510b11e61.zip |
Pointer arithmetic fixes work better when you get the casting right.
-rw-r--r-- | sys/netinet/tcp_subr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 1cf1bada291..e2444a531d5 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.49 2001/06/26 06:56:41 aaron Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.50 2001/07/03 04:26:37 angelos Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -369,13 +369,13 @@ tcp_respond(tp, template, m, ack, seq, flags) xchg(((struct ip6_hdr *)ti)->ip6_dst,\ ((struct ip6_hdr *)ti)->ip6_src,\ struct in6_addr); - th = (void *)(ti + sizeof(struct ip6_hdr)); + th = (void *)((caddr_t)ti + sizeof(struct ip6_hdr)); } else #endif /* INET6 */ { m->m_len = sizeof (struct tcpiphdr); xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_int32_t); - th = (void *)(ti + sizeof(struct ip)); + th = (void *)((caddr_t)ti + sizeof(struct ip)); } xchg(th->th_dport, th->th_sport, u_int16_t); #undef xchg |