Module Name:    src
Committed By:   rtr
Date:           Tue Jul  1 05:49:19 UTC 2014

Modified Files:
        src/sys/compat/common: if_43.c
        src/sys/kern: sys_socket.c uipc_usrreq.c
        src/sys/net: if.c if.h link_proto.c rtsock.c
        src/sys/netatalk: at_control.c at_extern.h ddp_usrreq.c
        src/sys/netbt: hci.h hci_ioctl.c hci_socket.c l2cap_socket.c
            rfcomm_socket.c sco_socket.c
        src/sys/netinet: in.c in_var.h raw_ip.c tcp_usrreq.c udp_usrreq.c
        src/sys/netinet6: in6.c in6_var.h raw_ip6.c udp6_usrreq.c
        src/sys/netipsec: keysock.c
        src/sys/netmpls: mpls_proto.c
        src/sys/netnatm: natm.c
        src/sys/rump/net/lib/libnetinet: netinet_component.c
        src/sys/rump/net/lib/libsockin: sockin.c
        src/sys/sys: protosw.h

Log Message:
fix parameter types in pr_ioctl, called xx_control() functions and remove
abuse of pointer to struct mbuf type.

param2 changed to u_long type and uses parameter name 'cmd' (ioctl command)
param3 changed to void * type and uses parameter name 'data'
param4 changed to struct ifnet * and uses parameter name 'ifp'
param5 has been removed (formerly struct lwp *) and uses of 'l' have been
       replaced with curlwp from curproc(9).

callers have had (now unnecessary) casts to struct mbuf * removed, called
code has had (now unnecessary) casts to u_long, void * and struct ifnet *
respectively removed.

reviewed by rmind@


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/common/if_43.c
cvs rdiff -u -r1.70 -r1.71 src/sys/kern/sys_socket.c
cvs rdiff -u -r1.154 -r1.155 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.283 -r1.284 src/sys/net/if.c
cvs rdiff -u -r1.167 -r1.168 src/sys/net/if.h
cvs rdiff -u -r1.11 -r1.12 src/sys/net/link_proto.c
cvs rdiff -u -r1.148 -r1.149 src/sys/net/rtsock.c
cvs rdiff -u -r1.34 -r1.35 src/sys/netatalk/at_control.c
cvs rdiff -u -r1.17 -r1.18 src/sys/netatalk/at_extern.h
cvs rdiff -u -r1.46 -r1.47 src/sys/netatalk/ddp_usrreq.c
cvs rdiff -u -r1.38 -r1.39 src/sys/netbt/hci.h
cvs rdiff -u -r1.11 -r1.12 src/sys/netbt/hci_ioctl.c
cvs rdiff -u -r1.25 -r1.26 src/sys/netbt/hci_socket.c
cvs rdiff -u -r1.16 -r1.17 src/sys/netbt/l2cap_socket.c
cvs rdiff -u -r1.17 -r1.18 src/sys/netbt/rfcomm_socket.c
cvs rdiff -u -r1.18 -r1.19 src/sys/netbt/sco_socket.c
cvs rdiff -u -r1.146 -r1.147 src/sys/netinet/in.c
cvs rdiff -u -r1.69 -r1.70 src/sys/netinet/in_var.h
cvs rdiff -u -r1.126 -r1.127 src/sys/netinet/raw_ip.c
cvs rdiff -u -r1.179 -r1.180 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.201 -r1.202 src/sys/netinet/udp_usrreq.c
cvs rdiff -u -r1.171 -r1.172 src/sys/netinet6/in6.c
cvs rdiff -u -r1.69 -r1.70 src/sys/netinet6/in6_var.h
cvs rdiff -u -r1.120 -r1.121 src/sys/netinet6/raw_ip6.c
cvs rdiff -u -r1.100 -r1.101 src/sys/netinet6/udp6_usrreq.c
cvs rdiff -u -r1.28 -r1.29 src/sys/netipsec/keysock.c
cvs rdiff -u -r1.10 -r1.11 src/sys/netmpls/mpls_proto.c
cvs rdiff -u -r1.28 -r1.29 src/sys/netnatm/natm.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libnetinet/netinet_component.c
cvs rdiff -u -r1.41 -r1.42 src/sys/rump/net/lib/libsockin/sockin.c
cvs rdiff -u -r1.48 -r1.49 src/sys/sys/protosw.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/if_43.c
diff -u src/sys/compat/common/if_43.c:1.6 src/sys/compat/common/if_43.c:1.7
--- src/sys/compat/common/if_43.c:1.6	Sun Jun 22 08:10:18 2014
+++ src/sys/compat/common/if_43.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_43.c,v 1.6 2014/06/22 08:10:18 rtr Exp $	*/
+/*	$NetBSD: if_43.c,v 1.7 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.6 2014/06/22 08:10:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.7 2014/07/01 05:49:18 rtr Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -256,8 +256,7 @@ compat_ifioctl(struct socket *so, u_long
 		cmd = SIOCGIFNETMASK;
 	}
 
-	error = (*so->so_proto->pr_usrreqs->pr_ioctl)(so,
-	    (struct mbuf *)cmd, (struct mbuf *)ifr, (struct mbuf *)ifp, l);
+	error = (*so->so_proto->pr_usrreqs->pr_ioctl)(so, cmd, ifr, ifp);
 
 	switch (ocmd) {
 	case OOSIOCGIFADDR:

Index: src/sys/kern/sys_socket.c
diff -u src/sys/kern/sys_socket.c:1.70 src/sys/kern/sys_socket.c:1.71
--- src/sys/kern/sys_socket.c:1.70	Mon Jun 23 17:18:45 2014
+++ src/sys/kern/sys_socket.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_socket.c,v 1.70 2014/06/23 17:18:45 rtr Exp $	*/
+/*	$NetBSD: sys_socket.c,v 1.71 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_socket.c,v 1.70 2014/06/23 17:18:45 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_socket.c,v 1.71 2014/07/01 05:49:18 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -202,8 +202,7 @@ soo_ioctl(file_t *fp, u_long cmd, void *
 			error = ifioctl(so, cmd, data, curlwp);
 		else {
 			error = (*so->so_proto->pr_usrreqs->pr_ioctl)(so,
-			    (struct mbuf *)cmd, (struct mbuf *)data,
-			    NULL, curlwp);
+			    cmd, data, NULL);
 		}
 		KERNEL_UNLOCK_ONE(NULL);
 		break;

Index: src/sys/kern/uipc_usrreq.c
diff -u src/sys/kern/uipc_usrreq.c:1.154 src/sys/kern/uipc_usrreq.c:1.155
--- src/sys/kern/uipc_usrreq.c:1.154	Sun Jun 22 08:10:18 2014
+++ src/sys/kern/uipc_usrreq.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_usrreq.c,v 1.154 2014/06/22 08:10:18 rtr Exp $	*/
+/*	$NetBSD: uipc_usrreq.c,v 1.155 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.154 2014/06/22 08:10:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.155 2014/07/01 05:49:18 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -866,8 +866,7 @@ unp_detach(struct socket *so)
 }
 
 static int
-unp_ioctl(struct socket *so, struct mbuf *m, struct mbuf *nam,
-    struct mbuf *control, struct lwp *l)
+unp_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
 	return EOPNOTSUPP;
 }

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.283 src/sys/net/if.c:1.284
--- src/sys/net/if.c:1.283	Sun Jun 22 08:10:18 2014
+++ src/sys/net/if.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.283 2014/06/22 08:10:18 rtr Exp $	*/
+/*	$NetBSD: if.c,v 1.284 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.283 2014/06/22 08:10:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.284 2014/07/01 05:49:18 rtr Exp $");
 
 #include "opt_inet.h"
 
@@ -1715,8 +1715,7 @@ ifioctl_common(struct ifnet *ifp, u_long
 }
 
 int
-ifaddrpref_ioctl(struct socket *so, u_long cmd, void *data, struct ifnet *ifp,
-    lwp_t *l)
+ifaddrpref_ioctl(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
 {
 	struct if_addrprefreq *ifap = (struct if_addrprefreq *)data;
 	struct ifaddr *ifa;
@@ -1728,7 +1727,7 @@ ifaddrpref_ioctl(struct socket *so, u_lo
 
 	switch (cmd) {
 	case SIOCSIFADDRPREF:
-		if (kauth_authorize_network(l->l_cred, KAUTH_NETWORK_INTERFACE,
+		if (kauth_authorize_network(curlwp->l_cred, KAUTH_NETWORK_INTERFACE,
 		    KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, (void *)cmd,
 		    NULL) != 0)
 			return EPERM;
@@ -1923,8 +1922,7 @@ doifioctl(struct socket *so, u_long cmd,
 		error = compat_ifioctl(so, ocmd, cmd, data, l);
 #else
 		error = (*so->so_proto->pr_usrreqs->pr_ioctl)(so,
-		    (struct mbuf *)cmd, (struct mbuf *)data,
-		    (struct mbuf *)ifp, l);
+		    cmd, data, ifp);
 #endif
 	}
 

Index: src/sys/net/if.h
diff -u src/sys/net/if.h:1.167 src/sys/net/if.h:1.168
--- src/sys/net/if.h:1.167	Mon Jun 16 03:43:10 2014
+++ src/sys/net/if.h	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.167 2014/06/16 03:43:10 ozaki-r Exp $	*/
+/*	$NetBSD: if.h,v 1.168 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -873,8 +873,7 @@ void	if_up(struct ifnet *);
 int	ifconf(u_long, void *);
 void	ifinit(void);
 void	ifinit1(void);
-int	ifaddrpref_ioctl(struct socket *, u_long, void *, struct ifnet *,
-    lwp_t *);
+int	ifaddrpref_ioctl(struct socket *, u_long, void *, struct ifnet *);
 extern int (*ifioctl)(struct socket *, u_long, void *, struct lwp *);
 int	ifioctl_common(struct ifnet *, u_long, void *);
 int	ifpromisc(struct ifnet *, int);

Index: src/sys/net/link_proto.c
diff -u src/sys/net/link_proto.c:1.11 src/sys/net/link_proto.c:1.12
--- src/sys/net/link_proto.c:1.11	Mon Jun 23 17:18:45 2014
+++ src/sys/net/link_proto.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: link_proto.c,v 1.11 2014/06/23 17:18:45 rtr Exp $	*/
+/*	$NetBSD: link_proto.c,v 1.12 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.11 2014/06/23 17:18:45 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.12 2014/07/01 05:49:18 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -50,8 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: link_proto.c
 static int sockaddr_dl_cmp(const struct sockaddr *, const struct sockaddr *);
 static int link_attach(struct socket *, int);
 static void link_detach(struct socket *);
-static int link_ioctl(struct socket *, struct mbuf *, struct mbuf *,
-    struct mbuf *, struct lwp *);
+static int link_ioctl(struct socket *, u_long, void *, struct ifnet *);
 static int link_usrreq(struct socket *, int, struct mbuf *, struct mbuf *,
     struct mbuf *, struct lwp *);
 static void link_init(void);
@@ -100,7 +99,7 @@ link_init(void)
 
 static int
 link_control(struct socket *so, unsigned long cmd, void *data,
-    struct ifnet *ifp, struct lwp *l)
+    struct ifnet *ifp)
 {
 	int error, s;
 	bool isactive, mkactive;
@@ -233,11 +232,9 @@ link_detach(struct socket *so)
 }
 
 static int
-link_ioctl(struct socket *so, struct mbuf *m, struct mbuf *nam,
-	struct mbuf *ifp, struct lwp *l)
+link_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
-	return link_control(so, (unsigned long)m, nam,
-	    (struct ifnet *)ifp, l);
+	return link_control(so, cmd, nam, ifp);
 }
 
 static int

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.148 src/sys/net/rtsock.c:1.149
--- src/sys/net/rtsock.c:1.148	Sun Jun 22 08:10:18 2014
+++ src/sys/net/rtsock.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.148 2014/06/22 08:10:18 rtr Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.149 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.148 2014/06/22 08:10:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.149 2014/07/01 05:49:18 rtr Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -224,8 +224,8 @@ COMPATNAME(route_detach)(struct socket *
 }
 
 static int
-COMPATNAME(route_ioctl)(struct socket *so, struct mbuf *m,
-    struct mbuf *nam, struct mbuf *control, struct lwp *l)
+COMPATNAME(route_ioctl)(struct socket *so, u_long cmd, void *nam,
+    struct ifnet * ifp)
 {
 	return EOPNOTSUPP;
 }

Index: src/sys/netatalk/at_control.c
diff -u src/sys/netatalk/at_control.c:1.34 src/sys/netatalk/at_control.c:1.35
--- src/sys/netatalk/at_control.c:1.34	Wed Oct 19 01:50:27 2011
+++ src/sys/netatalk/at_control.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: at_control.c,v 1.34 2011/10/19 01:50:27 dyoung Exp $	 */
+/*	$NetBSD: at_control.c,v 1.35 2014/07/01 05:49:18 rtr Exp $	 */
 
 /*
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at_control.c,v 1.34 2011/10/19 01:50:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at_control.c,v 1.35 2014/07/01 05:49:18 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -72,7 +72,7 @@ static void aa_clean(void);
 			 (a)->sat_addr.s_node == (b)->sat_addr.s_node )
 
 int
-at_control(u_long cmd, void * data, struct ifnet *ifp, struct lwp *l)
+at_control(u_long cmd, void *data, struct ifnet *ifp)
 {
 	struct ifreq   *ifr = (struct ifreq *) data;
 	const struct sockaddr_at *csat;
@@ -125,7 +125,7 @@ at_control(u_long cmd, void * data, stru
 		 * If we are not superuser, then we don't get to do these
 		 * ops.
 		 */
-		if (l && kauth_authorize_network(l->l_cred,
+		if (kauth_authorize_network(curlwp->l_cred,
 		    KAUTH_NETWORK_INTERFACE,
 		    KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, (void *)cmd,
 		    NULL) != 0)

Index: src/sys/netatalk/at_extern.h
diff -u src/sys/netatalk/at_extern.h:1.17 src/sys/netatalk/at_extern.h:1.18
--- src/sys/netatalk/at_extern.h:1.17	Sun May 18 14:46:16 2014
+++ src/sys/netatalk/at_extern.h	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: at_extern.h,v 1.17 2014/05/18 14:46:16 rmind Exp $	*/
+/*	$NetBSD: at_extern.h,v 1.18 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
@@ -50,7 +50,7 @@ int	aarpresolve(struct ifnet *, struct m
 void	aarpinput(struct ifnet *, struct mbuf *);
 int	at_broadcast(const struct sockaddr_at *);
 void	aarp_clean(void);
-int	at_control(u_long, void *, struct ifnet *, struct lwp *);
+int	at_control(u_long, void *, struct ifnet *);
 int	at_inithead(void **, int);
 void	at_purgeaddr(struct ifaddr *);
 void	at_purgeif(struct ifnet *);

Index: src/sys/netatalk/ddp_usrreq.c
diff -u src/sys/netatalk/ddp_usrreq.c:1.46 src/sys/netatalk/ddp_usrreq.c:1.47
--- src/sys/netatalk/ddp_usrreq.c:1.46	Mon Jun 23 17:18:45 2014
+++ src/sys/netatalk/ddp_usrreq.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ddp_usrreq.c,v 1.46 2014/06/23 17:18:45 rtr Exp $	 */
+/*	$NetBSD: ddp_usrreq.c,v 1.47 2014/07/01 05:49:18 rtr Exp $	 */
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.46 2014/06/23 17:18:45 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.47 2014/07/01 05:49:18 rtr Exp $");
 
 #include "opt_mbuftrace.h"
 
@@ -479,11 +479,9 @@ ddp_detach(struct socket *so)
 }
 
 static int
-ddp_ioctl(struct socket *so, struct mbuf *m, struct mbuf *addr,
-    struct mbuf *ifp, struct lwp *l)
+ddp_ioctl(struct socket *so, u_long cmd, void *addr, struct ifnet *ifp)
 {
-	return at_control((long) m, (void *) addr,
-	    (struct ifnet *) ifp, l);
+	return at_control(cmd, addr, ifp);
 }
 
 /*

Index: src/sys/netbt/hci.h
diff -u src/sys/netbt/hci.h:1.38 src/sys/netbt/hci.h:1.39
--- src/sys/netbt/hci.h:1.38	Sun Jun 22 08:10:18 2014
+++ src/sys/netbt/hci.h	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci.h,v 1.38 2014/06/22 08:10:18 rtr Exp $	*/
+/*	$NetBSD: hci.h,v 1.39 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -54,7 +54,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: hci.h,v 1.38 2014/06/22 08:10:18 rtr Exp $
+ * $Id: hci.h,v 1.39 2014/07/01 05:49:18 rtr Exp $
  * $FreeBSD: src/sys/netgraph/bluetooth/include/ng_hci.h,v 1.6 2005/01/07 01:45:43 imp Exp $
  */
 
@@ -2536,7 +2536,7 @@ extern SIMPLEQ_HEAD(hci_unit_list, hci_u
 void hci_event(struct mbuf *, struct hci_unit *);
 
 /* hci_ioctl.c */
-int hci_ioctl_pcb(unsigned long, void *, struct lwp *);
+int hci_ioctl_pcb(unsigned long, void *);
 
 /* hci_link.c */
 struct hci_link *hci_acl_open(struct hci_unit *, bdaddr_t *);

Index: src/sys/netbt/hci_ioctl.c
diff -u src/sys/netbt/hci_ioctl.c:1.11 src/sys/netbt/hci_ioctl.c:1.12
--- src/sys/netbt/hci_ioctl.c:1.11	Sun Jun 22 08:10:18 2014
+++ src/sys/netbt/hci_ioctl.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci_ioctl.c,v 1.11 2014/06/22 08:10:18 rtr Exp $	*/
+/*	$NetBSD: hci_ioctl.c,v 1.12 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hci_ioctl.c,v 1.11 2014/06/22 08:10:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hci_ioctl.c,v 1.12 2014/07/01 05:49:18 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/domain.h>
@@ -132,7 +132,7 @@ hci_dump(void)
 #endif
 
 int
-hci_ioctl_pcb(unsigned long cmd, void *data, struct lwp *l)
+hci_ioctl_pcb(unsigned long cmd, void *data)
 {
 	struct btreq *btr = data;
 	struct hci_unit *unit;
@@ -225,7 +225,7 @@ hci_ioctl_pcb(unsigned long cmd, void *d
 		break;
 
 	case SIOCSBTFLAGS:	/* set unit flags (privileged) */
-		err = kauth_authorize_device(l->l_cred,
+		err = kauth_authorize_device(curlwp->l_cred,
 		    KAUTH_DEVICE_BLUETOOTH_SETPRIV, unit, KAUTH_ARG(cmd),
 		    btr, NULL);
 		if (err)
@@ -253,7 +253,7 @@ hci_ioctl_pcb(unsigned long cmd, void *d
 		break;
 
 	case SIOCSBTPOLICY:	/* set unit link policy (privileged) */
-		err = kauth_authorize_device(l->l_cred,
+		err = kauth_authorize_device(curlwp->l_cred,
 		    KAUTH_DEVICE_BLUETOOTH_SETPRIV, unit, KAUTH_ARG(cmd),
 		    btr, NULL);
 		if (err)
@@ -265,7 +265,7 @@ hci_ioctl_pcb(unsigned long cmd, void *d
 		break;
 
 	case SIOCSBTPTYPE:	/* set unit packet types (privileged) */
-		err = kauth_authorize_device(l->l_cred,
+		err = kauth_authorize_device(curlwp->l_cred,
 		    KAUTH_DEVICE_BLUETOOTH_SETPRIV, unit, KAUTH_ARG(cmd),
 		    btr, NULL);
 		if (err)
@@ -281,7 +281,7 @@ hci_ioctl_pcb(unsigned long cmd, void *d
 		break;
 
 	case SIOCZBTSTATS:	/* get & reset unit statistics */
-		err = kauth_authorize_device(l->l_cred,
+		err = kauth_authorize_device(curlwp->l_cred,
 		    KAUTH_DEVICE_BLUETOOTH_SETPRIV, unit, KAUTH_ARG(cmd),
 		    btr, NULL);
 		if (err)
@@ -297,7 +297,7 @@ hci_ioctl_pcb(unsigned long cmd, void *d
 		 * sent to USB bluetooth controllers that are not an
 		 * integer number of frame sizes, the USB bus locks up.
 		 */
-		err = kauth_authorize_device(l->l_cred,
+		err = kauth_authorize_device(curlwp->l_cred,
 		    KAUTH_DEVICE_BLUETOOTH_SETPRIV, unit, KAUTH_ARG(cmd),
 		    btr, NULL);
 		if (err)

Index: src/sys/netbt/hci_socket.c
diff -u src/sys/netbt/hci_socket.c:1.25 src/sys/netbt/hci_socket.c:1.26
--- src/sys/netbt/hci_socket.c:1.25	Sun Jun 22 08:10:18 2014
+++ src/sys/netbt/hci_socket.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci_socket.c,v 1.25 2014/06/22 08:10:18 rtr Exp $	*/
+/*	$NetBSD: hci_socket.c,v 1.26 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.25 2014/06/22 08:10:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.26 2014/07/01 05:49:18 rtr Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -484,12 +484,11 @@ hci_detach(struct socket *so)
 }
 
 static int
-hci_ioctl(struct socket *up, struct mbuf *m,
-		struct mbuf *nam, struct mbuf *ctl, struct lwp *l)
+hci_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
 {
 	int err;
 	mutex_enter(bt_lock);
-	err = hci_ioctl_pcb((unsigned long)m, (void *)nam, l);
+	err = hci_ioctl_pcb(cmd, nam);
 	mutex_exit(bt_lock);
 	return err;
 }

Index: src/sys/netbt/l2cap_socket.c
diff -u src/sys/netbt/l2cap_socket.c:1.16 src/sys/netbt/l2cap_socket.c:1.17
--- src/sys/netbt/l2cap_socket.c:1.16	Sun Jun 22 08:10:18 2014
+++ src/sys/netbt/l2cap_socket.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: l2cap_socket.c,v 1.16 2014/06/22 08:10:18 rtr Exp $	*/
+/*	$NetBSD: l2cap_socket.c,v 1.17 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: l2cap_socket.c,v 1.16 2014/06/22 08:10:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: l2cap_socket.c,v 1.17 2014/07/01 05:49:18 rtr Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -117,8 +117,7 @@ l2cap_detach(struct socket *so)
 }
 
 static int
-l2cap_ioctl(struct socket *up, struct mbuf *m,
-    struct mbuf *nam, struct mbuf *ctl, struct lwp *l)
+l2cap_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
 {
 	return EPASSTHROUGH;
 }

Index: src/sys/netbt/rfcomm_socket.c
diff -u src/sys/netbt/rfcomm_socket.c:1.17 src/sys/netbt/rfcomm_socket.c:1.18
--- src/sys/netbt/rfcomm_socket.c:1.17	Sun Jun 22 08:10:18 2014
+++ src/sys/netbt/rfcomm_socket.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rfcomm_socket.c,v 1.17 2014/06/22 08:10:18 rtr Exp $	*/
+/*	$NetBSD: rfcomm_socket.c,v 1.18 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rfcomm_socket.c,v 1.17 2014/06/22 08:10:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rfcomm_socket.c,v 1.18 2014/07/01 05:49:18 rtr Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -125,8 +125,7 @@ rfcomm_detach(struct socket *so)
 }
 
 static int
-rfcomm_ioctl(struct socket *up, struct mbuf *m,
-		struct mbuf *nam, struct mbuf *ctl, struct lwp *l)
+rfcomm_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
 {
 	return EPASSTHROUGH;
 }

Index: src/sys/netbt/sco_socket.c
diff -u src/sys/netbt/sco_socket.c:1.18 src/sys/netbt/sco_socket.c:1.19
--- src/sys/netbt/sco_socket.c:1.18	Sun Jun 22 08:10:18 2014
+++ src/sys/netbt/sco_socket.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sco_socket.c,v 1.18 2014/06/22 08:10:18 rtr Exp $	*/
+/*	$NetBSD: sco_socket.c,v 1.19 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sco_socket.c,v 1.18 2014/06/22 08:10:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sco_socket.c,v 1.19 2014/07/01 05:49:18 rtr Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -108,8 +108,7 @@ sco_detach(struct socket *so)
 }
 
 static int
-sco_ioctl(struct socket *up, struct mbuf *m,
-    struct mbuf *nam, struct mbuf *ctl, struct lwp *l)
+sco_ioctl(struct socket *up, u_long cmd, void *nam, struct ifnet *ifp)
 {
 	return EOPNOTSUPP;
 }

Index: src/sys/netinet/in.c
diff -u src/sys/netinet/in.c:1.146 src/sys/netinet/in.c:1.147
--- src/sys/netinet/in.c:1.146	Thu May 29 23:02:48 2014
+++ src/sys/netinet/in.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.146 2014/05/29 23:02:48 rmind Exp $	*/
+/*	$NetBSD: in.c,v 1.147 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.146 2014/05/29 23:02:48 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.147 2014/07/01 05:49:18 rtr Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet_conf.h"
@@ -135,7 +135,7 @@ __KERNEL_RCSID(0, "$NetBSD: in.c,v 1.146
 static u_int	in_mask2len(struct in_addr *);
 static void	in_len2mask(struct in_addr *, u_int);
 static int	in_lifaddr_ioctl(struct socket *, u_long, void *,
-	struct ifnet *, struct lwp *);
+	struct ifnet *);
 
 static int	in_addprefix(struct in_ifaddr *, int);
 static int	in_scrubprefix(struct in_ifaddr *);
@@ -340,8 +340,7 @@ in_len2mask(struct in_addr *mask, u_int 
  */
 /* ARGSUSED */
 int
-in_control(struct socket *so, u_long cmd, void *data, struct ifnet *ifp,
-    struct lwp *l)
+in_control(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
 {
 	struct ifreq *ifr = (struct ifreq *)data;
 	struct in_ifaddr *ia = NULL;
@@ -356,12 +355,12 @@ in_control(struct socket *so, u_long cmd
 	case SIOCGLIFADDR:
 		if (ifp == NULL)
 			return EINVAL;
-		return in_lifaddr_ioctl(so, cmd, data, ifp, l);
+		return in_lifaddr_ioctl(so, cmd, data, ifp);
 	case SIOCGIFADDRPREF:
 	case SIOCSIFADDRPREF:
 		if (ifp == NULL)
 			return EINVAL;
-		return ifaddrpref_ioctl(so, cmd, data, ifp, l);
+		return ifaddrpref_ioctl(so, cmd, data, ifp);
 	}
 
 	/*
@@ -407,9 +406,7 @@ in_control(struct socket *so, u_long cmd
 		    (cmd == SIOCSIFNETMASK || cmd == SIOCSIFDSTADDR))
 			return (EADDRNOTAVAIL);
 
-		if (l == NULL)
-			return (EPERM);
-		if (kauth_authorize_network(l->l_cred, KAUTH_NETWORK_INTERFACE,
+		if (kauth_authorize_network(curlwp->l_cred, KAUTH_NETWORK_INTERFACE,
 		    KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, (void *)cmd,
 		    NULL) != 0)
 			return (EPERM);
@@ -442,9 +439,7 @@ in_control(struct socket *so, u_long cmd
 		break;
 
 	case SIOCSIFBRDADDR:
-		if (l == NULL)
-			return (EPERM);
-		if (kauth_authorize_network(l->l_cred, KAUTH_NETWORK_INTERFACE,
+		if (kauth_authorize_network(curlwp->l_cred, KAUTH_NETWORK_INTERFACE,
 		    KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, (void *)cmd,
 		    NULL) != 0)
 			return (EPERM);
@@ -643,7 +638,7 @@ in_purgeif(struct ifnet *ifp)		/* MUST b
  */
 static int
 in_lifaddr_ioctl(struct socket *so, u_long cmd, void *data,
-    struct ifnet *ifp, struct lwp *l)
+    struct ifnet *ifp)
 {
 	struct if_laddrreq *iflr = (struct if_laddrreq *)data;
 	struct ifaddr *ifa;
@@ -712,7 +707,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo
 		ifra.ifra_mask.sin_len = sizeof(struct sockaddr_in);
 		in_len2mask(&ifra.ifra_mask.sin_addr, iflr->prefixlen);
 
-		return in_control(so, SIOCAIFADDR, (void *)&ifra, ifp, l);
+		return in_control(so, SIOCAIFADDR, &ifra, ifp);
 	    }
 	case SIOCGLIFADDR:
 	case SIOCDLIFADDR:
@@ -798,8 +793,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo
 			memcpy(&ifra.ifra_dstaddr, &ia->ia_sockmask,
 				ia->ia_sockmask.sin_len);
 
-			return in_control(so, SIOCDIFADDR, (void *)&ifra,
-				ifp, l);
+			return in_control(so, SIOCDIFADDR, &ifra, ifp);
 		}
 	    }
 	}

Index: src/sys/netinet/in_var.h
diff -u src/sys/netinet/in_var.h:1.69 src/sys/netinet/in_var.h:1.70
--- src/sys/netinet/in_var.h:1.69	Thu Jun  5 23:48:16 2014
+++ src/sys/netinet/in_var.h	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_var.h,v 1.69 2014/06/05 23:48:16 rmind Exp $	*/
+/*	$NetBSD: in_var.h,v 1.70 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -247,8 +247,7 @@ void	in_purgemkludge(struct ifnet *);
 void	in_ifscrub(struct ifnet *, struct in_ifaddr *);
 void	in_setmaxmtu(void);
 const char *in_fmtaddr(struct in_addr);
-int	in_control(struct socket *, u_long, void *, struct ifnet *,
-	    struct lwp *);
+int	in_control(struct socket *, u_long, void *, struct ifnet *);
 void	in_purgeaddr(struct ifaddr *);
 void	in_purgeif(struct ifnet *);
 int	ipflow_fastforward(struct mbuf *);

Index: src/sys/netinet/raw_ip.c
diff -u src/sys/netinet/raw_ip.c:1.126 src/sys/netinet/raw_ip.c:1.127
--- src/sys/netinet/raw_ip.c:1.126	Mon Jun 23 17:18:45 2014
+++ src/sys/netinet/raw_ip.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: raw_ip.c,v 1.126 2014/06/23 17:18:45 rtr Exp $	*/
+/*	$NetBSD: raw_ip.c,v 1.127 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.126 2014/06/23 17:18:45 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.127 2014/07/01 05:49:18 rtr Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -567,10 +567,9 @@ rip_detach(struct socket *so)
 }
 
 static int
-rip_ioctl(struct socket *so, struct mbuf *m, struct mbuf *nam,
-    struct mbuf *ifp, struct lwp *l)
+rip_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
-	return in_control(so, (long)m, nam, (ifnet_t *)ifp, l);
+	return in_control(so, cmd, nam, ifp);
 }
 
 int

Index: src/sys/netinet/tcp_usrreq.c
diff -u src/sys/netinet/tcp_usrreq.c:1.179 src/sys/netinet/tcp_usrreq.c:1.180
--- src/sys/netinet/tcp_usrreq.c:1.179	Mon Jun 23 17:18:45 2014
+++ src/sys/netinet/tcp_usrreq.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_usrreq.c,v 1.179 2014/06/23 17:18:45 rtr Exp $	*/
+/*	$NetBSD: tcp_usrreq.c,v 1.180 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -99,7 +99,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.179 2014/06/23 17:18:45 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.180 2014/07/01 05:49:18 rtr Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -943,19 +943,16 @@ tcp_detach(struct socket *so)
 }
 
 static int
-tcp_ioctl(struct socket *so, struct mbuf *m, struct mbuf *nam,
-    struct mbuf *ifp, struct lwp *l)
+tcp_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
 	switch (so->so_proto->pr_domain->dom_family) {
 #ifdef INET
 	case PF_INET:
-		return in_control(so, (long)m, (void *)nam,
-		    (struct ifnet *)ifp, l);
+		return in_control(so, cmd, nam, ifp);
 #endif
 #ifdef INET6
 	case PF_INET6:
-		return in6_control(so, (long)m, (void *)nam,
-		    (struct ifnet *)ifp, l);
+		return in6_control(so, cmd, nam, ifp);
 #endif
 	default:
 		return EAFNOSUPPORT;

Index: src/sys/netinet/udp_usrreq.c
diff -u src/sys/netinet/udp_usrreq.c:1.201 src/sys/netinet/udp_usrreq.c:1.202
--- src/sys/netinet/udp_usrreq.c:1.201	Mon Jun 23 17:18:45 2014
+++ src/sys/netinet/udp_usrreq.c	Tue Jul  1 05:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp_usrreq.c,v 1.201 2014/06/23 17:18:45 rtr Exp $	*/
+/*	$NetBSD: udp_usrreq.c,v 1.202 2014/07/01 05:49:18 rtr Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.201 2014/06/23 17:18:45 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.202 2014/07/01 05:49:18 rtr Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -895,11 +895,9 @@ udp_detach(struct socket *so)
 }
 
 static int
-udp_ioctl(struct socket *so, struct mbuf *m, struct mbuf *nam,
-    struct mbuf *ifp, struct lwp *l)
+udp_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
-	return in_control(so, (long)m, (void *)nam,
-	    (struct ifnet *)ifp, l);
+	return in_control(so, cmd, nam, ifp);
 }
 
 static int

Index: src/sys/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.171 src/sys/netinet6/in6.c:1.172
--- src/sys/netinet6/in6.c:1.171	Fri Jun  6 01:02:47 2014
+++ src/sys/netinet6/in6.c	Tue Jul  1 05:49:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.171 2014/06/06 01:02:47 rmind Exp $	*/
+/*	$NetBSD: in6.c,v 1.172 2014/07/01 05:49:19 rtr Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.171 2014/06/06 01:02:47 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.172 2014/07/01 05:49:19 rtr Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -139,7 +139,7 @@ const struct sockaddr_in6 sa6_any = {siz
 				     0, 0, IN6ADDR_ANY_INIT, 0};
 
 static int in6_lifaddr_ioctl(struct socket *, u_long, void *,
-	struct ifnet *, struct lwp *);
+	struct ifnet *);
 static int in6_ifinit(struct ifnet *, struct in6_ifaddr *,
 	const struct sockaddr_in6 *, int);
 static void in6_unlink_ifa(struct in6_ifaddr *, struct ifnet *);
@@ -360,8 +360,7 @@ in6_mask2len(struct in6_addr *mask, u_ch
 #define ia62ifa(ia6)	(&((ia6)->ia_ifa))
 
 static int
-in6_control1(struct socket *so, u_long cmd, void *data, struct ifnet *ifp,
-    lwp_t *l)
+in6_control1(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
 {
 	struct	in6_ifreq *ifr = (struct in6_ifreq *)data;
 	struct	in6_ifaddr *ia = NULL;
@@ -385,7 +384,7 @@ in6_control1(struct socket *so, u_long c
 	case SIOCSIFADDRPREF:
 		if (ifp == NULL)
 			return EINVAL;
-		return ifaddrpref_ioctl(so, cmd, data, ifp, l);
+		return ifaddrpref_ioctl(so, cmd, data, ifp);
 	}
 
 	if (ifp == NULL)
@@ -428,7 +427,7 @@ in6_control1(struct socket *so, u_long c
 		/* Privileged. */
 		/* FALLTHROUGH */
 	case SIOCGLIFADDR:
-		return in6_lifaddr_ioctl(so, cmd, data, ifp, l);
+		return in6_lifaddr_ioctl(so, cmd, data, ifp);
 	}
 
 	/*
@@ -784,8 +783,7 @@ in6_control1(struct socket *so, u_long c
 }
 
 int
-in6_control(struct socket *so, u_long cmd, void *data, struct ifnet *ifp,
-    struct lwp *l)
+in6_control(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
 {
 	int error, s;
 
@@ -805,7 +803,7 @@ in6_control(struct socket *so, u_long cm
 	case OSIOCAIFADDR_IN6:
 #endif
 	case SIOCAIFADDR_IN6:
-		if (kauth_authorize_network(l->l_cred,
+		if (kauth_authorize_network(curlwp->l_cred,
 		    KAUTH_NETWORK_SOCKET,
 		    KAUTH_REQ_NETWORK_SOCKET_SETPRIV,
 		    so, NULL, NULL))
@@ -814,7 +812,7 @@ in6_control(struct socket *so, u_long cm
 	}
 
 	s = splnet();
-	error = in6_control1(so , cmd, data, ifp, l);
+	error = in6_control1(so , cmd, data, ifp);
 	splx(s);
 	return error;
 }
@@ -1508,7 +1506,7 @@ in6_purgeif(struct ifnet *ifp)
  */
 static int
 in6_lifaddr_ioctl(struct socket *so, u_long cmd, void *data, 
-	struct ifnet *ifp, struct lwp *l)
+	struct ifnet *ifp)
 {
 	struct in6_ifaddr *ia;
 	struct if_laddrreq *iflr = (struct if_laddrreq *)data;
@@ -1618,7 +1616,7 @@ in6_lifaddr_ioctl(struct socket *so, u_l
 		ifra.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
 		ifra.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
 		ifra.ifra_flags = iflr->flags & ~IFLR_PREFIX;
-		return in6_control(so, SIOCAIFADDR_IN6, &ifra, ifp, l);
+		return in6_control(so, SIOCAIFADDR_IN6, &ifra, ifp);
 	    }
 	case SIOCGLIFADDR:
 	case SIOCDLIFADDR:
@@ -1729,7 +1727,7 @@ in6_lifaddr_ioctl(struct socket *so, u_l
 			    ia->ia_prefixmask.sin6_len);
 
 			ifra.ifra_flags = ia->ia6_flags;
-			return in6_control(so, SIOCDIFADDR_IN6, &ifra, ifp, l);
+			return in6_control(so, SIOCDIFADDR_IN6, &ifra, ifp);
 		}
 	    }
 	}

Index: src/sys/netinet6/in6_var.h
diff -u src/sys/netinet6/in6_var.h:1.69 src/sys/netinet6/in6_var.h:1.70
--- src/sys/netinet6/in6_var.h:1.69	Thu Jun  5 23:48:16 2014
+++ src/sys/netinet6/in6_var.h	Tue Jul  1 05:49:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_var.h,v 1.69 2014/06/05 23:48:16 rmind Exp $	*/
+/*	$NetBSD: in6_var.h,v 1.70 2014/07/01 05:49:19 rtr Exp $	*/
 /*	$KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -680,8 +680,7 @@ struct in6_multi_mship *in6_joingroup(st
 	int *, int);
 int	in6_leavegroup(struct in6_multi_mship *);
 int	in6_mask2len(struct in6_addr *, u_char *);
-int	in6_control(struct socket *, u_long, void *, struct ifnet *,
-	struct lwp *);
+int	in6_control(struct socket *, u_long, void *, struct ifnet *);
 int	in6_update_ifa(struct ifnet *, struct in6_aliasreq *,
 	struct in6_ifaddr *, int);
 void	in6_purgeaddr(struct ifaddr *);

Index: src/sys/netinet6/raw_ip6.c
diff -u src/sys/netinet6/raw_ip6.c:1.120 src/sys/netinet6/raw_ip6.c:1.121
--- src/sys/netinet6/raw_ip6.c:1.120	Mon Jun 23 17:18:45 2014
+++ src/sys/netinet6/raw_ip6.c	Tue Jul  1 05:49:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: raw_ip6.c,v 1.120 2014/06/23 17:18:45 rtr Exp $	*/
+/*	$NetBSD: raw_ip6.c,v 1.121 2014/07/01 05:49:19 rtr Exp $	*/
 /*	$KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.120 2014/06/23 17:18:45 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.121 2014/07/01 05:49:19 rtr Exp $");
 
 #include "opt_ipsec.h"
 
@@ -645,11 +645,9 @@ rip6_detach(struct socket *so)
 }
 
 static int
-rip6_ioctl(struct socket *so, struct mbuf *m, 
-	struct mbuf *nam, struct mbuf *ifp, struct lwp *l)
+rip6_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
-	return in6_control(so, (u_long)m, (void *)nam,
-	    (struct ifnet *)ifp, l);
+	return in6_control(so, cmd, nam, ifp);
 }
 
 int

Index: src/sys/netinet6/udp6_usrreq.c
diff -u src/sys/netinet6/udp6_usrreq.c:1.100 src/sys/netinet6/udp6_usrreq.c:1.101
--- src/sys/netinet6/udp6_usrreq.c:1.100	Mon Jun 23 17:18:45 2014
+++ src/sys/netinet6/udp6_usrreq.c	Tue Jul  1 05:49:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp6_usrreq.c,v 1.100 2014/06/23 17:18:45 rtr Exp $	*/
+/*	$NetBSD: udp6_usrreq.c,v 1.101 2014/07/01 05:49:19 rtr Exp $	*/
 /*	$KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.100 2014/06/23 17:18:45 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.101 2014/07/01 05:49:19 rtr Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet_csum.h"
@@ -678,8 +678,7 @@ udp6_detach(struct socket *so)
 }
 
 static int
-udp6_ioctl(struct socket *so, struct mbuf *m, struct mbuf *addr6,
-    struct mbuf *ifp, struct lwp *l)
+udp6_ioctl(struct socket *so, u_long cmd, void *addr6, struct ifnet *ifp)
 {
 	/*
 	 * MAPPED_ADDR implementation info:
@@ -691,8 +690,7 @@ udp6_ioctl(struct socket *so, struct mbu
 	 *  So AF_INET socket need to be used to control AF_INET addrs,
 	 *  and AF_INET6 socket for AF_INET6 addrs.
 	 */
-	return in6_control(so, (u_long)m, (void *)addr6,
-			   (struct ifnet *)ifp, l);
+	return in6_control(so, cmd, addr6, ifp);
 }
 
 int

Index: src/sys/netipsec/keysock.c
diff -u src/sys/netipsec/keysock.c:1.28 src/sys/netipsec/keysock.c:1.29
--- src/sys/netipsec/keysock.c:1.28	Sun Jun 22 08:10:19 2014
+++ src/sys/netipsec/keysock.c	Tue Jul  1 05:49:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: keysock.c,v 1.28 2014/06/22 08:10:19 rtr Exp $	*/
+/*	$NetBSD: keysock.c,v 1.29 2014/07/01 05:49:19 rtr Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/keysock.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.28 2014/06/22 08:10:19 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.29 2014/07/01 05:49:19 rtr Exp $");
 
 #include "opt_ipsec.h"
 
@@ -485,8 +485,7 @@ key_detach(struct socket *so)
 }
 
 static int
-key_ioctl(struct socket *so, struct mbuf *m, struct mbuf *nam,
-    struct mbuf *control, struct lwp *l)
+key_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
 	return EOPNOTSUPP;
 }

Index: src/sys/netmpls/mpls_proto.c
diff -u src/sys/netmpls/mpls_proto.c:1.10 src/sys/netmpls/mpls_proto.c:1.11
--- src/sys/netmpls/mpls_proto.c:1.10	Sun Jun 22 08:10:19 2014
+++ src/sys/netmpls/mpls_proto.c	Tue Jul  1 05:49:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpls_proto.c,v 1.10 2014/06/22 08:10:19 rtr Exp $ */
+/*	$NetBSD: mpls_proto.c,v 1.11 2014/07/01 05:49:19 rtr Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpls_proto.c,v 1.10 2014/06/22 08:10:19 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpls_proto.c,v 1.11 2014/07/01 05:49:19 rtr Exp $");
 
 #include "opt_inet.h"
 #include "opt_mbuftrace.h"
@@ -95,8 +95,7 @@ mpls_detach(struct socket *so)
 }
 
 static int
-mpls_ioctl(struct socket *so, struct mbuf *m,
-    struct mbuf *nam, struct mbuf *control, struct lwp *l)
+mpls_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
 	return EOPNOTSUPP;
 }

Index: src/sys/netnatm/natm.c
diff -u src/sys/netnatm/natm.c:1.28 src/sys/netnatm/natm.c:1.29
--- src/sys/netnatm/natm.c:1.28	Sun Jun 22 08:10:19 2014
+++ src/sys/netnatm/natm.c	Tue Jul  1 05:49:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: natm.c,v 1.28 2014/06/22 08:10:19 rtr Exp $	*/
+/*	$NetBSD: natm.c,v 1.29 2014/07/01 05:49:19 rtr Exp $	*/
 
 /*
  * Copyright (c) 1996 Charles D. Cranor and Washington University.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: natm.c,v 1.28 2014/06/22 08:10:19 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: natm.c,v 1.29 2014/07/01 05:49:19 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -96,8 +96,7 @@ natm_detach(struct socket *so)
 }
 
 static int
-natm_ioctl(struct socket *so, struct mbuf *m, struct mbuf *nam,
-    struct mbuf *control, struct lwp *l)
+natm_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
   int error = 0;
 
@@ -107,7 +106,7 @@ natm_ioctl(struct socket *so, struct mbu
    * raw atm ioctl.   comes in as a SIOCRAWATM.   we convert it to
    * SIOCXRAWATM and pass it to the driver.
    */
-  if ((u_long)m == SIOCRAWATM) {
+  if (cmd == SIOCRAWATM) {
     if (npcb->npcb_ifp == NULL) {
       error = ENOTCONN;
       goto done;

Index: src/sys/rump/net/lib/libnetinet/netinet_component.c
diff -u src/sys/rump/net/lib/libnetinet/netinet_component.c:1.2 src/sys/rump/net/lib/libnetinet/netinet_component.c:1.3
--- src/sys/rump/net/lib/libnetinet/netinet_component.c:1.2	Thu Jun  5 23:48:17 2014
+++ src/sys/rump/net/lib/libnetinet/netinet_component.c	Tue Jul  1 05:49:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netinet_component.c,v 1.2 2014/06/05 23:48:17 rmind Exp $	*/
+/*	$NetBSD: netinet_component.c,v 1.3 2014/07/01 05:49:19 rtr Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netinet_component.c,v 1.2 2014/06/05 23:48:17 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netinet_component.c,v 1.3 2014/07/01 05:49:19 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/domain.h>
@@ -87,7 +87,7 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET_IFCFG)
 	sin->sin_len = sizeof(struct sockaddr_in);
 	sin->sin_addr.s_addr = inet_addr("127.255.255.255");
 
-	in_control(so, SIOCAIFADDR, &ia, lo0ifp, curlwp);
+	in_control(so, SIOCAIFADDR, &ia, lo0ifp);
 	if_up(lo0ifp);
 	soclose(so);
 }

Index: src/sys/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.41 src/sys/rump/net/lib/libsockin/sockin.c:1.42
--- src/sys/rump/net/lib/libsockin/sockin.c:1.41	Sun Jun 22 08:10:19 2014
+++ src/sys/rump/net/lib/libsockin/sockin.c	Tue Jul  1 05:49:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockin.c,v 1.41 2014/06/22 08:10:19 rtr Exp $	*/
+/*	$NetBSD: sockin.c,v 1.42 2014/07/01 05:49:19 rtr Exp $	*/
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.41 2014/06/22 08:10:19 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.42 2014/07/01 05:49:19 rtr Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -68,8 +68,7 @@ static int	sockin_do_init(void);
 static void	sockin_init(void);
 static int	sockin_attach(struct socket *, int);
 static void	sockin_detach(struct socket *);
-static int	sockin_ioctl(struct socket *, struct mbuf *, struct mbuf *,
-			     struct mbuf *control, struct lwp *);
+static int	sockin_ioctl(struct socket *, u_long, void *, struct ifnet *);
 static int	sockin_usrreq(struct socket *, int, struct mbuf *,
 			      struct mbuf *, struct mbuf *, struct lwp *);
 static int	sockin_ctloutput(int op, struct socket *, struct sockopt *);
@@ -453,8 +452,7 @@ sockin_detach(struct socket *so)
 }
 
 static int
-sockin_ioctl(struct socket *so, struct mbuf *m, struct mbuf *nam,
-	struct mbuf *control, struct lwp *l)
+sockin_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
 {
 	return ENOTTY;
 }

Index: src/sys/sys/protosw.h
diff -u src/sys/sys/protosw.h:1.48 src/sys/sys/protosw.h:1.49
--- src/sys/sys/protosw.h:1.48	Sun Jun 22 08:10:19 2014
+++ src/sys/sys/protosw.h	Tue Jul  1 05:49:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: protosw.h,v 1.48 2014/06/22 08:10:19 rtr Exp $	*/
+/*	$NetBSD: protosw.h,v 1.49 2014/07/01 05:49:19 rtr Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1993
@@ -58,6 +58,7 @@
  */
 
 struct mbuf;
+struct ifnet;
 struct sockaddr;
 struct socket;
 struct sockopt;
@@ -236,8 +237,7 @@ static const char * const prcorequests[]
 struct pr_usrreqs {
 	int	(*pr_attach)(struct socket *, int);
 	void	(*pr_detach)(struct socket *);
-	int	(*pr_ioctl)(struct socket *, struct mbuf *,
-	    struct mbuf *, struct mbuf *, struct lwp *);
+	int	(*pr_ioctl)(struct socket *, u_long, void *, struct ifnet *);
 	int	(*pr_generic)(struct socket *, int, struct mbuf *,
 	    struct mbuf *, struct mbuf *, struct lwp *);
 };
@@ -290,13 +290,12 @@ name##_detach_wrapper(struct socket *a)	
 	KERNEL_UNLOCK_ONE(NULL);			\
 }							\
 static int						\
-name##_ioctl_wrapper(struct socket *a,			\
-    struct mbuf *b, struct mbuf *c, struct mbuf *d,	\
-    struct lwp *e)					\
+name##_ioctl_wrapper(struct socket *a, u_long b,	\
+    void *c, struct ifnet *d)				\
 {							\
 	int rv;						\
 	KERNEL_LOCK(1, NULL);				\
-	rv = name##_ioctl(a, b, c, d, e);		\
+	rv = name##_ioctl(a, b, c, d);			\
 	KERNEL_UNLOCK_ONE(NULL);			\
 	return rv;					\
 }							\

Reply via email to