diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-07-03 04:26:38 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-07-03 04:26:38 +0000 |
commit | 85f7e485610d4e93178637679e3054e5ad33db92 (patch) | |
tree | afe5a3982e05644f1b2b77e9e17ee4024d381c8b | |
parent | abcdf46868e2ed243e2f64dc35b7810329c5c23a (diff) |
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 |