diff options
author | 2019-02-15 05:55:21 +0000 | |
---|---|---|
committer | 2019-02-15 05:55:21 +0000 | |
commit | edab645e68b5bf4d4b590ebc78778915ffb91f6c (patch) | |
tree | b8fdcd5df912fb5c5372662ea02703c9aa411ed0 | |
parent | Remove/simplify historic shell lesson; fix sentence fragment. ok deraadt@ (diff) | |
download | wireguard-openbsd-edab645e68b5bf4d4b590ebc78778915ffb91f6c.tar.xz wireguard-openbsd-edab645e68b5bf4d4b590ebc78778915ffb91f6c.zip |
let sbcreatecontrol take a const void * instead of a caddr_t.
this makes it easier to call since you don't have to cast to caddr_t
if it's a void *. this also changes a size argument from int to
size_t.
ok claudio@
-rw-r--r-- | sys/kern/uipc_socket2.c | 8 | ||||
-rw-r--r-- | sys/sys/socketvar.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index cb6dedcb1a8..4b9b79100fb 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.99 2018/11/19 13:15:37 visa Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.100 2019/02/15 05:55:21 dlg Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -1020,14 +1020,14 @@ sbdroprecord(struct sockbuf *sb) * with the specified type for presentation on a socket buffer. */ struct mbuf * -sbcreatecontrol(caddr_t p, int size, int type, int level) +sbcreatecontrol(const void *p, size_t size, int type, int level) { struct cmsghdr *cp; struct mbuf *m; if (CMSG_SPACE(size) > MCLBYTES) { - printf("sbcreatecontrol: message too large %d\n", size); - return NULL; + printf("sbcreatecontrol: message too large %zu\n", size); + return (NULL); } if ((m = m_get(M_DONTWAIT, MT_CONTROL)) == NULL) diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index c9e0cf2ef8f..864a0c3cb6d 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: socketvar.h,v 1.88 2018/11/19 13:15:37 visa Exp $ */ +/* $OpenBSD: socketvar.h,v 1.89 2019/02/15 05:55:21 dlg Exp $ */ /* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */ /*- @@ -290,7 +290,7 @@ int sbappendcontrol(struct socket *, struct sockbuf *, struct mbuf *, void sbappendrecord(struct socket *, struct sockbuf *, struct mbuf *); void sbcompress(struct sockbuf *sb, struct mbuf *m, struct mbuf *n); struct mbuf * - sbcreatecontrol(caddr_t p, int size, int type, int level); + sbcreatecontrol(const void *, size_t, int type, int level); void sbdrop(struct socket *, struct sockbuf *, int); void sbdroprecord(struct sockbuf *sb); void sbflush(struct socket *, struct sockbuf *); |