diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-05-31 13:15:54 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-05-31 13:15:54 +0000 |
commit | 956076bda4f834be239075d492595bf4cfd779a0 (patch) | |
tree | 684c0cf0167beea3d7e0a4f316a679c26bef726f /sys/netinet/udp_usrreq.c | |
parent | d8793a1eb2f35729775ed62e6b1bfb59400984f2 (diff) |
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/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 1231135e191..a4863ebea6b 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.161 2013/05/17 09:04:30 mpi Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.162 2013/05/31 13:15:53 bluhm Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -884,12 +884,11 @@ udp6_ctlinput(int cmd, struct sockaddr *sa, void *d) */ } - (void) in6_pcbnotify(&udbtable, (struct sockaddr *)&sa6, - uh.uh_dport, (struct sockaddr *)&sa6_src, - uh.uh_sport, cmd, cmdarg, notify); + (void) in6_pcbnotify(&udbtable, &sa6, uh.uh_dport, + &sa6_src, uh.uh_sport, cmd, cmdarg, notify); } else { - (void) in6_pcbnotify(&udbtable, (struct sockaddr *)&sa6, 0, - (struct sockaddr *)&sa6_any, 0, cmd, cmdarg, notify); + (void) in6_pcbnotify(&udbtable, &sa6, 0, + &sa6_any, 0, cmd, cmdarg, notify); } } #endif |