From: bluhm Date: Tue, 10 Jul 2018 10:02:14 +0000 (+0000) Subject: After removing raw_usrreq() from route and pfkey, the global sockaddr X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c80d9406c5399bc5d1503cce2cf5ab7abcbfa7c5;p=openbsd After removing raw_usrreq() from route and pfkey, the global sockaddr variables can be delared constant. OK claudio@ mpi@ --- diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 48962fd6c06..b5f839e84ec 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.95 2018/06/11 08:57:35 mpi Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.96 2018/07/10 10:02:14 bluhm Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -779,7 +779,7 @@ sbinsertoob(struct sockbuf *sb, struct mbuf *m0) * Returns 0 if no space in sockbuf or insufficient mbufs. */ int -sbappendaddr(struct socket *so, struct sockbuf *sb, struct sockaddr *asa, +sbappendaddr(struct socket *so, struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control) { struct mbuf *m, *n, *nlast; diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c index 82165449e89..161a80997e4 100644 --- a/sys/net/pfkeyv2.c +++ b/sys/net/pfkeyv2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2.c,v 1.187 2018/07/09 16:51:29 claudio Exp $ */ +/* $OpenBSD: pfkeyv2.c,v 1.188 2018/07/10 10:02:14 bluhm Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 @@ -129,7 +129,7 @@ extern struct pool ipsec_policy_pool; extern struct radix_node_head **spd_tables; #define PFKEY_MSG_MAXSZ 4096 -struct sockaddr pfkey_addr = { 2, PF_KEY, }; +const struct sockaddr pfkey_addr = { 2, PF_KEY, }; struct domain pfkeydomain; /* diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 6102e6e53ba..2b6e0b7115f 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.277 2018/07/09 16:49:36 claudio Exp $ */ +/* $OpenBSD: rtsock.c,v 1.278 2018/07/10 10:02:14 bluhm Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -95,7 +95,7 @@ #include #include -struct sockaddr route_src = { 2, PF_ROUTE, }; +const struct sockaddr route_src = { 2, PF_ROUTE, }; struct walkarg { int w_op, w_arg, w_given, w_needed, w_tmemsize; diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index e5b34a4ff63..6f4d263e485 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: socketvar.h,v 1.84 2018/06/11 08:57:35 mpi Exp $ */ +/* $OpenBSD: socketvar.h,v 1.85 2018/07/10 10:02:14 bluhm Exp $ */ /* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */ /*- @@ -288,8 +288,8 @@ int soo_close(struct file *fp, struct proc *p); int soo_stat(struct file *, struct stat *, struct proc *); void sbappend(struct socket *, struct sockbuf *, struct mbuf *); void sbappendstream(struct socket *, struct sockbuf *, struct mbuf *); -int sbappendaddr(struct socket *, struct sockbuf *, struct sockaddr *, - struct mbuf *, struct mbuf *); +int sbappendaddr(struct socket *, struct sockbuf *, + const struct sockaddr *, struct mbuf *, struct mbuf *); int sbappendcontrol(struct socket *, struct sockbuf *, struct mbuf *, struct mbuf *); void sbappendrecord(struct socket *, struct sockbuf *, struct mbuf *);