--- old/usr/src/uts/common/inet/tcp/tcp_opt_data.c	2012-08-08 12:51:10.737666225 +0000
+++ new/usr/src/uts/common/inet/tcp/tcp_opt_data.c	2012-08-08 12:51:10.770874243 +0000
@@ -42,6 +42,8 @@
 #include <inet/proto_set.h>
 #include <inet/tcp_impl.h>
 
+static int	tcp_opt_default(queue_t *, int, int, uchar_t *);
+
 /*
  * Table of all known options handled on a TCP protocol stack.
  *
@@ -306,7 +308,7 @@
  * values are maintained by protocol specific code
  */
 /* ARGSUSED */
-int
+static int
 tcp_opt_default(queue_t *q, int level, int name, uchar_t *ptr)
 {
 	int32_t	*i1 = (int32_t *)ptr;
--- old/usr/src/uts/common/inet/tcp/tcp_socket.c	2012-08-08 12:51:11.265055794 +0000
+++ new/usr/src/uts/common/inet/tcp/tcp_socket.c	2012-08-08 12:51:11.282194553 +0000
@@ -54,12 +54,16 @@
 static int	tcp_listen(sock_lower_handle_t, int, cred_t *);
 static int	tcp_connect(sock_lower_handle_t, const struct sockaddr *,
 		    socklen_t, sock_connid_t *, cred_t *);
+static int	tcp_getpeername(sock_lower_handle_t, struct sockaddr *,
+		    socklen_t *, cred_t *);
+static int	tcp_getsockname(sock_lower_handle_t, struct sockaddr *,
+		    socklen_t *, cred_t *);
 static int	tcp_getsockopt(sock_lower_handle_t, int, int, void *,
 		    socklen_t *, cred_t *);
 static int	tcp_setsockopt(sock_lower_handle_t, int, int, const void *,
 		    socklen_t, cred_t *);
 static int	tcp_sendmsg(sock_lower_handle_t, mblk_t *, struct nmsghdr *,
-		    cred_t *cr);
+		    cred_t *);
 static int	tcp_shutdown(sock_lower_handle_t, int, cred_t *);
 static void	tcp_clr_flowctrl(sock_lower_handle_t);
 static int	tcp_ioctl(sock_lower_handle_t, int, intptr_t, int, int32_t *,
@@ -131,6 +135,9 @@
 	conn_t *lconnp, *econnp;
 	tcp_t *listener, *eager;
 
+	/* All Solaris components should pass a cred for this operation. */
+	ASSERT(cr != NULL);
+
 	/*
 	 * KSSL can move a socket from one listener to another, in which
 	 * case `lproto_handle' points to the new listener. To ensure that
@@ -334,7 +341,7 @@
 }
 
 /* ARGSUSED3 */
-int
+static int
 tcp_getpeername(sock_lower_handle_t proto_handle, struct sockaddr *addr,
     socklen_t *addrlenp, cred_t *cr)
 {
@@ -352,7 +359,7 @@
 }
 
 /* ARGSUSED3 */
-int
+static int
 tcp_getsockname(sock_lower_handle_t proto_handle, struct sockaddr *addr,
     socklen_t *addrlenp, cred_t *cr)
 {
@@ -377,6 +384,9 @@
 
 	ASSERT(connp->conn_upper_handle != NULL);
 
+	/* All Solaris components should pass a cred for this operation. */
+	ASSERT(cr != NULL);
+
 	error = proto_opt_check(level, option_name, *optlen, &max_optbuf_len,
 	    tcp_opt_obj.odb_opt_des_arr,
 	    tcp_opt_obj.odb_opt_arr_cnt,
@@ -424,6 +434,10 @@
 	int		error;
 
 	ASSERT(connp->conn_upper_handle != NULL);
+
+	/* All Solaris components should pass a cred for this operation. */
+	ASSERT(cr != NULL);
+
 	/*
 	 * Entering the squeue synchronously can result in a context switch,
 	 * which can cause a rather sever performance degradation. So we try to
@@ -752,6 +766,7 @@
 {
 	conn_t		*connp;
 	boolean_t	isv6 = family == AF_INET6;
+
 	if (type != SOCK_STREAM || (family != AF_INET && family != AF_INET6) ||
 	    (proto != 0 && proto != IPPROTO_TCP)) {
 		*errorp = EPROTONOSUPPORT;
@@ -765,7 +780,7 @@
 
 	/*
 	 * Put the ref for TCP. Ref for IP was already put
-	 * by ipcl_conn_create. Also Make the conn_t globally
+	 * by ipcl_conn_create. Also make the conn_t globally
 	 * visible to walkers
 	 */
 	mutex_enter(&connp->conn_lock);
--- old/usr/src/uts/common/inet/tcp/tcp_stats.c	2012-08-08 12:51:11.643956959 +0000
+++ new/usr/src/uts/common/inet/tcp/tcp_stats.c	2012-08-08 12:51:11.659548462 +0000
@@ -36,8 +36,9 @@
 #include <inet/kstatcom.h>
 #include <inet/snmpcom.h>
 
-static int	tcp_kstat_update(kstat_t *kp, int rw);
-static int	tcp_kstat2_update(kstat_t *kp, int rw);
+static int	tcp_snmp_state(tcp_t *);
+static int	tcp_kstat_update(kstat_t *, int);
+static int	tcp_kstat2_update(kstat_t *, int);
 static void	tcp_sum_mib(tcp_stack_t *, mib2_tcp_t *);
 
 static void	tcp_add_mib(mib2_tcp_t *, mib2_tcp_t *);
@@ -801,7 +802,7 @@
  * To add stats from one mib2_tcp_t to another.  Static fields are not added.
  * The caller should set them up propertly.
  */
-void
+static void
 tcp_add_mib(mib2_tcp_t *from, mib2_tcp_t *to)
 {
 	to->tcpActiveOpens += from->tcpActiveOpens;
--- old/usr/src/uts/common/inet/tcp_impl.h	2012-08-08 12:51:12.019009803 +0000
+++ new/usr/src/uts/common/inet/tcp_impl.h	2012-08-08 12:51:12.032480142 +0000
@@ -546,10 +546,6 @@
 extern void	tcp_eager_cleanup(tcp_t *, boolean_t);
 extern void	tcp_eager_kill(void *, mblk_t *, void *, ip_recv_attr_t *);
 extern void	tcp_eager_unlink(tcp_t *);
-extern int	tcp_getpeername(sock_lower_handle_t, struct sockaddr *,
-		    socklen_t *, cred_t *);
-extern int	tcp_getsockname(sock_lower_handle_t, struct sockaddr *,
-		    socklen_t *, cred_t *);
 extern void	tcp_init_values(tcp_t *, tcp_t *);
 extern void	tcp_ipsec_cleanup(tcp_t *);
 extern int	tcp_maxpsz_set(tcp_t *, boolean_t);
@@ -679,7 +675,6 @@
 /*
  * TCP option processing related functions in tcp_opt_data.c
  */
-extern int	tcp_opt_default(queue_t *, t_scalar_t, t_scalar_t, uchar_t *);
 extern int	tcp_opt_get(conn_t *, int, int, uchar_t *);
 extern int	tcp_opt_set(conn_t *, uint_t, int, int, uint_t, uchar_t *,
 		    uint_t *, uchar_t *, void *, cred_t *);
--- old/usr/src/uts/common/inet/tcp_stats.h	2012-08-08 12:51:12.398331726 +0000
+++ new/usr/src/uts/common/inet/tcp_stats.h	2012-08-08 12:51:12.413030219 +0000
@@ -48,7 +48,7 @@
  *
  * TCP_DBGSTAT(name) does atomic increment of a named stat counter. It is
  * supposed to be used for DEBUG purposes and may be used on a hot path.
- * These counters are only available in a debugged kerel.  They are grouped
+ * These counters are only available in a debugged kernel.  They are grouped
  * under the TCP_DEBUG_COUNTER C pre-processor condition.
  *
  * Both TCP_STAT and TCP_DBGSTAT counters are available using kstat
