[PATCH 2/3] libnetworking: Delete dead code

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jan 16 08:32:30 UTC 2015


The so_uid is always 0 in RTEMS.
---
 cpukit/libnetworking/kern/uipc_socket.c  | 1 -
 cpukit/libnetworking/kern/uipc_socket2.c | 1 -
 cpukit/libnetworking/netinet/in_pcb.c    | 7 -------
 cpukit/libnetworking/sys/socketvar.h     | 1 -
 4 files changed, 10 deletions(-)

diff --git a/cpukit/libnetworking/kern/uipc_socket.c b/cpukit/libnetworking/kern/uipc_socket.c
index 7a16f7e..7ed3ad0 100644
--- a/cpukit/libnetworking/kern/uipc_socket.c
+++ b/cpukit/libnetworking/kern/uipc_socket.c
@@ -79,7 +79,6 @@ socreate(int dom, struct socket **aso, int type, int proto,
 	TAILQ_INIT(&so->so_comp);
 	so->so_type = type;
 	so->so_state = SS_PRIV;
-	so->so_uid = 0;
 	so->so_proto = prp;
 	error = (*prp->pr_usrreqs->pru_attach)(so, proto);
 	if (error) {
diff --git a/cpukit/libnetworking/kern/uipc_socket2.c b/cpukit/libnetworking/kern/uipc_socket2.c
index f42b612..c2d18b1 100644
--- a/cpukit/libnetworking/kern/uipc_socket2.c
+++ b/cpukit/libnetworking/kern/uipc_socket2.c
@@ -226,7 +226,6 @@ sonewconn1(struct socket *head, int connstatus)
 	so->so_state = head->so_state | SS_NOFDREF;
 	so->so_proto = head->so_proto;
 	so->so_timeo = head->so_timeo;
-	so->so_uid = head->so_uid;
 	(void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
 	if (connstatus) {
 		TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
diff --git a/cpukit/libnetworking/netinet/in_pcb.c b/cpukit/libnetworking/netinet/in_pcb.c
index fe34fbb..c41e634 100644
--- a/cpukit/libnetworking/netinet/in_pcb.c
+++ b/cpukit/libnetworking/netinet/in_pcb.c
@@ -190,13 +190,6 @@ in_pcbbind(struct inpcb *inp, struct mbuf *nam)
 			if (ntohs(lport) < IPPORT_RESERVED &&
 			    (error = suser(p->p_ucred, &p->p_acflag)))
 				return (EACCES);
-			if (so->so_uid) {
-				t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr,
-				    0, sin->sin_addr, lport,
-				    INPLOOKUP_WILDCARD);
-				if (t && (so->so_uid != t->inp_socket->so_uid))
-					return (EADDRINUSE);
-			}
 			t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr, 0,
 			    sin->sin_addr, lport, wild);
 			if (t && (reuseport & t->inp_socket->so_options) == 0)
diff --git a/cpukit/libnetworking/sys/socketvar.h b/cpukit/libnetworking/sys/socketvar.h
index 829b61d..09bb2a5 100644
--- a/cpukit/libnetworking/sys/socketvar.h
+++ b/cpukit/libnetworking/sys/socketvar.h
@@ -103,7 +103,6 @@ struct socket {
 	caddr_t	so_tpcb;		/* Wisc. protocol control block XXX */
 	void	(*so_upcall)(struct socket *, void *arg, int);
 	void 	*so_upcallarg;		/* Arg for above */
-	uid_t	so_uid;			/* who opened the socket */
 };
 
 /*
-- 
1.8.4.5




More information about the devel mailing list