summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/sockfs/socktpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/fs/sockfs/socktpi.c')
-rw-r--r--usr/src/uts/common/fs/sockfs/socktpi.c199
1 files changed, 0 insertions, 199 deletions
diff --git a/usr/src/uts/common/fs/sockfs/socktpi.c b/usr/src/uts/common/fs/sockfs/socktpi.c
index b2a178fbcb..bfbd67ad81 100644
--- a/usr/src/uts/common/fs/sockfs/socktpi.c
+++ b/usr/src/uts/common/fs/sockfs/socktpi.c
@@ -5506,205 +5506,6 @@ sotpi_setsockopt(struct sonode *so, int level, int option_name,
so_lock_single(so); /* Set SOLOCKED */
mutex_exit(&so->so_lock);
- /*
- * For SOCKET or TCP level options, try to set it here itself
- * provided socket has not been popped and we know the tcp
- * structure (stored in so_priv).
- */
- if ((level == SOL_SOCKET || level == IPPROTO_TCP) &&
- (so->so_family == AF_INET || so->so_family == AF_INET6) &&
- (so->so_version == SOV_SOCKSTREAM) &&
- (so->so_proto_handle != NULL)) {
- tcp_t *tcp = (tcp_t *)so->so_proto_handle;
- boolean_t onoff;
-
-#define intvalue (*(int32_t *)optval)
-
- switch (level) {
- case SOL_SOCKET:
- switch (option_name) { /* Check length param */
- case SO_DEBUG:
- case SO_REUSEADDR:
- case SO_DONTROUTE:
- case SO_BROADCAST:
- case SO_USELOOPBACK:
- case SO_OOBINLINE:
- case SO_DGRAM_ERRIND:
- if (optlen != (t_uscalar_t)sizeof (int32_t)) {
- error = EINVAL;
- eprintsoline(so, error);
- mutex_enter(&so->so_lock);
- goto done2;
- }
- ASSERT(optval);
- onoff = intvalue != 0;
- handled = B_TRUE;
- break;
- case SO_SNDTIMEO:
- case SO_RCVTIMEO:
- if (get_udatamodel() == DATAMODEL_NONE ||
- get_udatamodel() == DATAMODEL_NATIVE) {
- if (optlen !=
- sizeof (struct timeval)) {
- error = EINVAL;
- eprintsoline(so, error);
- mutex_enter(&so->so_lock);
- goto done2;
- }
- } else {
- if (optlen !=
- sizeof (struct timeval32)) {
- error = EINVAL;
- eprintsoline(so, error);
- mutex_enter(&so->so_lock);
- goto done2;
- }
- }
- ASSERT(optval);
- handled = B_TRUE;
- break;
- case SO_LINGER:
- if (optlen !=
- (t_uscalar_t)sizeof (struct linger)) {
- error = EINVAL;
- eprintsoline(so, error);
- mutex_enter(&so->so_lock);
- goto done2;
- }
- ASSERT(optval);
- handled = B_TRUE;
- break;
- }
-
- switch (option_name) { /* Do actions */
- case SO_LINGER: {
- struct linger *lgr = (struct linger *)optval;
-
- if (lgr->l_onoff) {
- tcp->tcp_linger = 1;
- tcp->tcp_lingertime = lgr->l_linger;
- so->so_linger.l_onoff = SO_LINGER;
- so->so_options |= SO_LINGER;
- } else {
- tcp->tcp_linger = 0;
- tcp->tcp_lingertime = 0;
- so->so_linger.l_onoff = 0;
- so->so_options &= ~SO_LINGER;
- }
- so->so_linger.l_linger = lgr->l_linger;
- handled = B_TRUE;
- break;
- }
- case SO_SNDTIMEO:
- case SO_RCVTIMEO: {
- struct timeval tl;
- clock_t val;
-
- if (get_udatamodel() == DATAMODEL_NONE ||
- get_udatamodel() == DATAMODEL_NATIVE)
- bcopy(&tl, (struct timeval *)optval,
- sizeof (struct timeval));
- else
- TIMEVAL32_TO_TIMEVAL(&tl,
- (struct timeval32 *)optval);
- val = tl.tv_sec * 1000 * 1000 + tl.tv_usec;
- if (option_name == SO_RCVTIMEO)
- so->so_rcvtimeo = drv_usectohz(val);
- else
- so->so_sndtimeo = drv_usectohz(val);
- break;
- }
-
- case SO_DEBUG:
- tcp->tcp_debug = onoff;
-#ifdef SOCK_TEST
- if (intvalue & 2)
- sock_test_timelimit = 10 * hz;
- else
- sock_test_timelimit = 0;
-
- if (intvalue & 4)
- do_useracc = 0;
- else
- do_useracc = 1;
-#endif /* SOCK_TEST */
- break;
- case SO_DONTROUTE:
- /*
- * SO_DONTROUTE, SO_USELOOPBACK and
- * SO_BROADCAST are only of interest to IP.
- * We track them here only so
- * that we can report their current value.
- */
- tcp->tcp_dontroute = onoff;
- if (onoff)
- so->so_options |= option_name;
- else
- so->so_options &= ~option_name;
- break;
- case SO_USELOOPBACK:
- tcp->tcp_useloopback = onoff;
- if (onoff)
- so->so_options |= option_name;
- else
- so->so_options &= ~option_name;
- break;
- case SO_BROADCAST:
- tcp->tcp_broadcast = onoff;
- if (onoff)
- so->so_options |= option_name;
- else
- so->so_options &= ~option_name;
- break;
- case SO_REUSEADDR:
- tcp->tcp_reuseaddr = onoff;
- if (onoff)
- so->so_options |= option_name;
- else
- so->so_options &= ~option_name;
- break;
- case SO_OOBINLINE:
- tcp->tcp_oobinline = onoff;
- if (onoff)
- so->so_options |= option_name;
- else
- so->so_options &= ~option_name;
- break;
- case SO_DGRAM_ERRIND:
- tcp->tcp_dgram_errind = onoff;
- if (onoff)
- so->so_options |= option_name;
- else
- so->so_options &= ~option_name;
- break;
- }
- break;
- case IPPROTO_TCP:
- switch (option_name) {
- case TCP_NODELAY:
- if (optlen != (t_uscalar_t)sizeof (int32_t)) {
- error = EINVAL;
- eprintsoline(so, error);
- mutex_enter(&so->so_lock);
- goto done2;
- }
- ASSERT(optval);
- tcp->tcp_naglim = intvalue ? 1 : tcp->tcp_mss;
- handled = B_TRUE;
- break;
- }
- break;
- default:
- handled = B_FALSE;
- break;
- }
- }
-
- if (handled) {
- mutex_enter(&so->so_lock);
- goto done2;
- }
-
optmgmt_req.PRIM_type = T_SVR4_OPTMGMT_REQ;
optmgmt_req.MGMT_flags = T_NEGOTIATE;
optmgmt_req.OPT_length = (t_scalar_t)sizeof (oh) + optlen;