Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jul 2018 10:03:33 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336023 - in head/sys: kern netinet
Message-ID:  <201807061003.w66A3X6Z082209@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Fri Jul  6 10:03:33 2018
New Revision: 336023
URL: https://svnweb.freebsd.org/changeset/base/336023

Log:
  Correct breakage on 32-bit platforms from r335979.

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/kern/uipc_socket.c
  head/sys/kern/uipc_usrreq.c
  head/sys/netinet/in_pcb.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Fri Jul  6 06:21:24 2018	(r336022)
+++ head/sys/kern/kern_descrip.c	Fri Jul  6 10:03:33 2018	(r336023)
@@ -3362,10 +3362,10 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS)
 			if ((fp = fdp->fd_ofiles[n].fde_file) == NULL)
 				continue;
 			xf.xf_fd = n;
-			xf.xf_file = (kvaddr_t)fp;
-			xf.xf_data = (kvaddr_t)fp->f_data;
-			xf.xf_vnode = (kvaddr_t)fp->f_vnode;
-			xf.xf_type = (kvaddr_t)fp->f_type;
+			xf.xf_file = (kvaddr_t)(uintptr_t)fp;
+			xf.xf_data = (kvaddr_t)(uintptr_t)fp->f_data;
+			xf.xf_vnode = (kvaddr_t)(uintptr_t)fp->f_vnode;
+			xf.xf_type = (kvaddr_t)(uintptr_t)fp->f_type;
 			xf.xf_count = fp->f_count;
 			xf.xf_msgcount = 0;
 			xf.xf_offset = foffset_get(fp);

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Fri Jul  6 06:21:24 2018	(r336022)
+++ head/sys/kern/uipc_socket.c	Fri Jul  6 10:03:33 2018	(r336023)
@@ -3985,12 +3985,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso)
 {
 
 	xso->xso_len = sizeof *xso;
-	xso->xso_so = (kvaddr_t)so;
+	xso->xso_so = (kvaddr_t)(uintptr_t)so;
 	xso->so_type = so->so_type;
 	xso->so_options = so->so_options;
 	xso->so_linger = so->so_linger;
 	xso->so_state = so->so_state;
-	xso->so_pcb = (kvaddr_t)so->so_pcb;
+	xso->so_pcb = (kvaddr_t)(uintptr_t)so->so_pcb;
 	xso->xso_protocol = so->so_proto->pr_protocol;
 	xso->xso_family = so->so_proto->pr_domain->dom_family;
 	xso->so_timeo = so->so_timeo;

Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c	Fri Jul  6 06:21:24 2018	(r336022)
+++ head/sys/kern/uipc_usrreq.c	Fri Jul  6 10:03:33 2018	(r336023)
@@ -1853,7 +1853,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS)
 
 		if (freeunp == 0 && unp->unp_gencnt <= gencnt) {
 			xu->xu_len = sizeof *xu;
-			xu->xu_unpp = (kvaddr_t)unp;
+			xu->xu_unpp = (kvaddr_t)(uintptr_t)unp;
 			/*
 			 * XXX - need more locking here to protect against
 			 * connect/disconnect races for SMP.
@@ -1870,10 +1870,12 @@ unp_pcblist(SYSCTL_HANDLER_ARGS)
 				      unp->unp_conn->unp_addr->sun_len);
 			else
 				bzero(&xu->xu_caddr, sizeof(xu->xu_caddr));
-			xu->unp_vnode = (kvaddr_t)unp->unp_vnode;
-			xu->unp_conn = (kvaddr_t)unp->unp_conn;
-			xu->xu_firstref = (kvaddr_t)LIST_FIRST(&unp->unp_refs);
-			xu->xu_nextref = (kvaddr_t)LIST_NEXT(unp, unp_reflink);
+			xu->unp_vnode = (kvaddr_t)(uintptr_t)unp->unp_vnode;
+			xu->unp_conn = (kvaddr_t)(uintptr_t)unp->unp_conn;
+			xu->xu_firstref =
+			    (kvaddr_t)(uintptr_t)LIST_FIRST(&unp->unp_refs);
+			xu->xu_nextref =
+			    (kvaddr_t)(uintptr_t)LIST_NEXT(unp, unp_reflink);
 			xu->unp_gencnt = unp->unp_gencnt;
 			sotoxsocket(unp->unp_socket, &xu->xu_socket);
 			UNP_PCB_UNLOCK(unp);

Modified: head/sys/netinet/in_pcb.c
==============================================================================
--- head/sys/netinet/in_pcb.c	Fri Jul  6 06:21:24 2018	(r336022)
+++ head/sys/netinet/in_pcb.c	Fri Jul  6 10:03:33 2018	(r336023)
@@ -2906,7 +2906,7 @@ in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb 
 		bzero(&xi->xi_socket, sizeof(struct xsocket));
 	bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo));
 	xi->inp_gencnt = inp->inp_gencnt;
-	xi->inp_ppcb = (kvaddr_t)inp->inp_ppcb;
+	xi->inp_ppcb = (kvaddr_t)(uintptr_t)inp->inp_ppcb;
 	xi->inp_flow = inp->inp_flow;
 	xi->inp_flowid = inp->inp_flowid;
 	xi->inp_flowtype = inp->inp_flowtype;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807061003.w66A3X6Z082209>