diff options
author | 2013-05-31 13:15:53 +0000 | |
---|---|---|
committer | 2013-05-31 13:15:53 +0000 | |
commit | 55851b2e3e09ff1e3467e680021396460ab6426f (patch) | |
tree | 4fe27da078f732e19ba1f994d3cfdfa71d84e5fa /sys/netinet/tcp_subr.c | |
parent | Use u_char for the send-keys string to avoid mangling top-bit-set (diff) | |
download | wireguard-openbsd-55851b2e3e09ff1e3467e680021396460ab6426f.tar.xz wireguard-openbsd-55851b2e3e09ff1e3467e680021396460ab6426f.zip |
The function rip6_ctlinput() claims that sa6_src is constant to
allow the assingment of &sa6_any. But rip6_ctlinput() could not
guarantee that as it casted away the const attribute when it passes
the pointer to in6_pcbnotify(). Replace sockaddr with const
sockaddr_in6 in the in6_pcbnotify() parameters. This reduces the
number of casts. Also adjust in6_pcbhashlookup() to handle the
const attribute correctly.
Input and OK claudio@
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 1038cfb61ad..508a57ee1b3 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.118 2013/04/10 08:50:59 mpi Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.119 2013/05/31 13:15:53 bluhm Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -663,7 +663,7 @@ tcp6_ctlinput(cmd, sa, d) void (*notify)(struct inpcb *, int) = tcp_notify; struct ip6_hdr *ip6; const struct sockaddr_in6 *sa6_src = NULL; - struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa; + struct sockaddr_in6 *sa6 = satosin6(sa); struct inpcb *inp; struct mbuf *m; tcp_seq seq; @@ -760,8 +760,8 @@ tcp6_ctlinput(cmd, sa, d) syn_cache_unreach((struct sockaddr *)sa6_src, sa, &th, /* XXX */ 0); } else { - (void) in6_pcbnotify(&tcbtable, sa, 0, - (struct sockaddr *)sa6_src, 0, cmd, NULL, notify); + (void) in6_pcbnotify(&tcbtable, sa6, 0, + sa6_src, 0, cmd, NULL, notify); } } #endif @@ -906,8 +906,8 @@ tcp6_mtudisc_callback(faddr) sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_addr = *faddr; - (void) in6_pcbnotify(&tcbtable, (struct sockaddr *)&sin6, 0, - (struct sockaddr *)&sa6_any, 0, PRC_MSGSIZE, NULL, tcp_mtudisc); + (void) in6_pcbnotify(&tcbtable, &sin6, 0, + &sa6_any, 0, PRC_MSGSIZE, NULL, tcp_mtudisc); } #endif /* INET6 */ |