1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright 2019 Joyent, Inc.
* Copyright (c) 2016 by Delphix. All rights reserved.
* Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
* Copyright 2022 Oxide Computer Company
*/
#include <sys/types.h>
#include <sys/stream.h>
#define _SUN_TPI_VERSION 2
#include <sys/tihdr.h>
#include <sys/socket.h>
#include <sys/xti_xtiopt.h>
#include <sys/xti_inet.h>
#include <sys/policy.h>
#include <inet/cc.h>
#include <inet/common.h>
#include <netinet/ip6.h>
#include <inet/ip.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <inet/optcom.h>
#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.
*
* Note: This table contains options processed by both TCP and IP levels
* and is the superset of options that can be performed on a TCP over IP
* stack.
*/
opdes_t tcp_opt_arr[] = {
{ SO_LINGER, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0,
sizeof (struct linger), 0 },
{ SO_DEBUG, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ SO_KEEPALIVE, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ SO_DONTROUTE, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ SO_USELOOPBACK, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
},
{ SO_BROADCAST, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ SO_REUSEADDR, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ SO_OOBINLINE, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ SO_TYPE, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 },
{ SO_SNDBUF, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ SO_RCVBUF, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ SO_SNDTIMEO, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0,
sizeof (struct timeval), 0 },
{ SO_RCVTIMEO, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0,
sizeof (struct timeval), 0 },
{ SO_DGRAM_ERRIND, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
},
{ SO_SND_COPYAVOID, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ SO_ANON_MLP, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int),
0 },
{ SO_MAC_EXEMPT, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int),
0 },
{ SO_MAC_IMPLICIT, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int),
0 },
{ SO_ALLZONES, SOL_SOCKET, OA_R, OA_RW, OP_CONFIG, 0, sizeof (int),
0 },
{ SO_EXCLBIND, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ SO_DOMAIN, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 },
{ SO_PROTOTYPE, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 },
{ TCP_NODELAY, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
},
{ TCP_MAXSEG, IPPROTO_TCP, OA_R, OA_R, OP_NP, 0, sizeof (uint_t),
536 },
{ TCP_NOTIFY_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP,
OP_DEF_FN, sizeof (int), -1 /* not initialized */ },
{ TCP_ABORT_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP,
OP_DEF_FN, sizeof (int), -1 /* not initialized */ },
{ TCP_CONN_NOTIFY_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP,
OP_DEF_FN, sizeof (int), -1 /* not initialized */ },
{ TCP_CONN_ABORT_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP,
OP_DEF_FN, sizeof (int), -1 /* not initialized */ },
{ TCP_RECVDSTADDR, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int),
0 },
{ TCP_ANONPRIVBIND, IPPROTO_TCP, OA_R, OA_RW, OP_PRIVPORT, 0,
sizeof (int), 0 },
{ TCP_EXCLBIND, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
},
{ TCP_INIT_CWND, IPPROTO_TCP, OA_RW, OA_RW, OP_CONFIG, 0,
sizeof (int), 0 },
{ TCP_KEEPALIVE_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ TCP_KEEPIDLE, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ TCP_KEEPCNT, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ TCP_KEEPINTVL, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ TCP_KEEPALIVE_ABORT_THRESHOLD, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ TCP_CORK, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ TCP_QUICKACK, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ TCP_RTO_INITIAL, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (uint32_t), 0 },
{ TCP_RTO_MIN, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (uint32_t), 0 },
{ TCP_RTO_MAX, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (uint32_t), 0 },
{ TCP_LINGER2, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ TCP_CONGESTION, IPPROTO_TCP, OA_RW, OA_RW, OP_NP,
OP_VARLEN, CC_ALGO_NAME_MAX, 0 },
{ IP_OPTIONS, IPPROTO_IP, OA_RW, OA_RW, OP_NP,
(OP_VARLEN|OP_NODEFAULT),
IP_MAX_OPT_LENGTH + IP_ADDR_LEN, -1 /* not initialized */ },
{ T_IP_OPTIONS, IPPROTO_IP, OA_RW, OA_RW, OP_NP,
(OP_VARLEN|OP_NODEFAULT),
IP_MAX_OPT_LENGTH + IP_ADDR_LEN, -1 /* not initialized */ },
{ IP_TOS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ T_IP_TOS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ IP_TTL, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_DEF_FN,
sizeof (int), -1 /* not initialized */ },
{ IP_RECVTOS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ IP_SEC_OPT, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_NODEFAULT,
sizeof (ipsec_req_t), -1 /* not initialized */ },
{ IP_BOUND_IF, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 /* no ifindex */ },
{ IP_UNSPEC_SRC, IPPROTO_IP, OA_R, OA_RW, OP_RAW, 0,
sizeof (int), 0 },
{ IPV6_UNICAST_HOPS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, OP_DEF_FN,
sizeof (int), -1 /* not initialized */ },
{ IPV6_BOUND_IF, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 /* no ifindex */ },
{ IP_DONTFRAG, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
{ IP_NEXTHOP, IPPROTO_IP, OA_R, OA_RW, OP_CONFIG, 0,
sizeof (in_addr_t), -1 /* not initialized */ },
{ IPV6_UNSPEC_SRC, IPPROTO_IPV6, OA_R, OA_RW, OP_RAW, 0,
sizeof (int), 0 },
{ IPV6_PKTINFO, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
(OP_NODEFAULT|OP_VARLEN),
sizeof (struct in6_pktinfo), -1 /* not initialized */ },
{ IPV6_NEXTHOP, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
OP_NODEFAULT,
sizeof (sin6_t), -1 /* not initialized */ },
{ IPV6_HOPOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
(OP_VARLEN|OP_NODEFAULT), 255*8,
-1 /* not initialized */ },
{ IPV6_DSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
(OP_VARLEN|OP_NODEFAULT), 255*8,
-1 /* not initialized */ },
{ IPV6_RTHDRDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
(OP_VARLEN|OP_NODEFAULT), 255*8,
-1 /* not initialized */ },
{ IPV6_RTHDR, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
(OP_VARLEN|OP_NODEFAULT), 255*8,
-1 /* not initialized */ },
{ IPV6_TCLASS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
OP_NODEFAULT,
sizeof (int), -1 /* not initialized */ },
{ IPV6_PATHMTU, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
OP_NODEFAULT,
sizeof (struct ip6_mtuinfo), -1 /* not initialized */ },
{ IPV6_DONTFRAG, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ IPV6_USE_MIN_MTU, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ IPV6_V6ONLY, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
/* Enable receipt of ancillary data */
{ IPV6_RECVPKTINFO, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ IPV6_RECVHOPLIMIT, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ IPV6_RECVHOPOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ _OLD_IPV6_RECVDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ IPV6_RECVDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ IPV6_RECVRTHDR, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ IPV6_RECVRTHDRDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ IPV6_RECVTCLASS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (int), 0 },
{ IPV6_SEC_OPT, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, OP_NODEFAULT,
sizeof (ipsec_req_t), -1 /* not initialized */ },
{ IPV6_SRC_PREFERENCES, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
sizeof (uint32_t), IPV6_PREFER_SRC_DEFAULT },
};
/*
* Table of all supported levels
* Note: Some levels (e.g. XTI_GENERIC) may be valid but may not have
* any supported options so we need this info separately.
*
* This is needed only for topmost tpi providers and is used only by
* XTI interfaces.
*/
optlevel_t tcp_valid_levels_arr[] = {
XTI_GENERIC,
SOL_SOCKET,
IPPROTO_TCP,
IPPROTO_IP,
IPPROTO_IPV6
};
#define TCP_OPT_ARR_CNT A_CNT(tcp_opt_arr)
#define TCP_VALID_LEVELS_CNT A_CNT(tcp_valid_levels_arr)
uint_t tcp_max_optsize; /* initialized when TCP driver is loaded */
/*
* Initialize option database object for TCP
*
* This object represents database of options to search passed to
* {sock,tpi}optcom_req() interface routine to take care of option
* management and associated methods.
*/
optdb_obj_t tcp_opt_obj = {
tcp_opt_default, /* TCP default value function pointer */
tcp_tpi_opt_get, /* TCP get function pointer */
tcp_tpi_opt_set, /* TCP set function pointer */
TCP_OPT_ARR_CNT, /* TCP option database count of entries */
tcp_opt_arr, /* TCP option database */
TCP_VALID_LEVELS_CNT, /* TCP valid level count of entries */
tcp_valid_levels_arr /* TCP valid level array */
};
static int tcp_max_init_cwnd = TCP_MAX_INIT_CWND;
/*
* Some TCP options can be "set" by requesting them in the option
* buffer. This is needed for XTI feature test though we do not
* allow it in general. We interpret that this mechanism is more
* applicable to OSI protocols and need not be allowed in general.
* This routine filters out options for which it is not allowed (most)
* and lets through those (few) for which it is. [ The XTI interface
* test suite specifics will imply that any XTI_GENERIC level XTI_* if
* ever implemented will have to be allowed here ].
*/
static boolean_t
tcp_allow_connopt_set(int level, int name)
{
switch (level) {
case IPPROTO_TCP:
switch (name) {
case TCP_NODELAY:
return (B_TRUE);
default:
return (B_FALSE);
}
/*NOTREACHED*/
default:
return (B_FALSE);
}
/*NOTREACHED*/
}
/*
* This routine gets default values of certain options whose default
* values are maintained by protocol specific code
*/
/* ARGSUSED */
static int
tcp_opt_default(queue_t *q, int level, int name, uchar_t *ptr)
{
int32_t *i1 = (int32_t *)ptr;
tcp_stack_t *tcps = Q_TO_TCP(q)->tcp_tcps;
switch (level) {
case IPPROTO_TCP:
switch (name) {
case TCP_NOTIFY_THRESHOLD:
*i1 = tcps->tcps_ip_notify_interval;
break;
case TCP_ABORT_THRESHOLD:
*i1 = tcps->tcps_ip_abort_interval;
break;
case TCP_CONN_NOTIFY_THRESHOLD:
*i1 = tcps->tcps_ip_notify_cinterval;
break;
case TCP_CONN_ABORT_THRESHOLD:
*i1 = tcps->tcps_ip_abort_cinterval;
break;
default:
return (-1);
}
break;
case IPPROTO_IP:
switch (name) {
case IP_TTL:
*i1 = tcps->tcps_ipv4_ttl;
break;
default:
return (-1);
}
break;
case IPPROTO_IPV6:
switch (name) {
case IPV6_UNICAST_HOPS:
*i1 = tcps->tcps_ipv6_hoplimit;
break;
default:
return (-1);
}
break;
default:
return (-1);
}
return (sizeof (int));
}
/*
* TCP routine to get the values of options.
*/
int
tcp_opt_get(conn_t *connp, int level, int name, uchar_t *ptr)
{
int *i1 = (int *)ptr;
tcp_t *tcp = connp->conn_tcp;
conn_opt_arg_t coas;
int retval;
coas.coa_connp = connp;
coas.coa_ixa = connp->conn_ixa;
coas.coa_ipp = &connp->conn_xmit_ipp;
coas.coa_ancillary = B_FALSE;
coas.coa_changed = 0;
switch (level) {
case SOL_SOCKET:
switch (name) {
case SO_SND_COPYAVOID:
*i1 = tcp->tcp_snd_zcopy_on ?
SO_SND_COPYAVOID : 0;
return (sizeof (int));
case SO_ACCEPTCONN:
*i1 = (tcp->tcp_state == TCPS_LISTEN);
return (sizeof (int));
}
break;
case IPPROTO_TCP:
switch (name) {
case TCP_NODELAY:
*i1 = (tcp->tcp_naglim == 1) ? TCP_NODELAY : 0;
return (sizeof (int));
case TCP_MAXSEG:
*i1 = tcp->tcp_mss;
return (sizeof (int));
case TCP_NOTIFY_THRESHOLD:
*i1 = (int)tcp->tcp_first_timer_threshold;
return (sizeof (int));
case TCP_ABORT_THRESHOLD:
*i1 = tcp->tcp_second_timer_threshold;
return (sizeof (int));
case TCP_CONN_NOTIFY_THRESHOLD:
*i1 = tcp->tcp_first_ctimer_threshold;
return (sizeof (int));
case TCP_CONN_ABORT_THRESHOLD:
*i1 = tcp->tcp_second_ctimer_threshold;
return (sizeof (int));
case TCP_INIT_CWND:
*i1 = tcp->tcp_init_cwnd;
return (sizeof (int));
case TCP_KEEPALIVE_THRESHOLD:
*i1 = tcp->tcp_ka_interval;
return (sizeof (int));
/*
* TCP_KEEPIDLE expects value in seconds, but
* tcp_ka_interval is in milliseconds.
*/
case TCP_KEEPIDLE:
*i1 = tcp->tcp_ka_interval / 1000;
return (sizeof (int));
case TCP_KEEPCNT:
*i1 = tcp->tcp_ka_cnt;
return (sizeof (int));
/*
* TCP_KEEPINTVL expects value in seconds, but
* tcp_ka_rinterval is in milliseconds.
*/
case TCP_KEEPINTVL:
*i1 = tcp->tcp_ka_rinterval / 1000;
return (sizeof (int));
case TCP_KEEPALIVE_ABORT_THRESHOLD:
*i1 = tcp->tcp_ka_abort_thres;
return (sizeof (int));
case TCP_CONGESTION: {
size_t len = strlcpy((char *)ptr, CC_ALGO(tcp)->name,
CC_ALGO_NAME_MAX);
if (len >= CC_ALGO_NAME_MAX)
return (-1);
return (len + 1);
}
case TCP_CORK:
*i1 = tcp->tcp_cork;
return (sizeof (int));
case TCP_QUICKACK:
*i1 = tcp->tcp_quickack;
return (sizeof (int));
case TCP_RTO_INITIAL:
*i1 = tcp->tcp_rto_initial;
return (sizeof (uint32_t));
case TCP_RTO_MIN:
*i1 = tcp->tcp_rto_min;
return (sizeof (uint32_t));
case TCP_RTO_MAX:
*i1 = tcp->tcp_rto_max;
return (sizeof (uint32_t));
case TCP_LINGER2:
*i1 = tcp->tcp_fin_wait_2_flush_interval / SECONDS;
return (sizeof (int));
}
break;
case IPPROTO_IP:
if (connp->conn_family != AF_INET)
return (-1);
switch (name) {
case IP_OPTIONS:
case T_IP_OPTIONS:
/* Caller ensures enough space */
return (ip_opt_get_user(connp, ptr));
default:
break;
}
break;
case IPPROTO_IPV6:
/*
* IPPROTO_IPV6 options are only supported for sockets
* that are using IPv6 on the wire.
*/
if (connp->conn_ipversion != IPV6_VERSION) {
return (-1);
}
switch (name) {
case IPV6_PATHMTU:
if (tcp->tcp_state < TCPS_ESTABLISHED)
return (-1);
break;
}
break;
}
mutex_enter(&connp->conn_lock);
retval = conn_opt_get(&coas, level, name, ptr);
mutex_exit(&connp->conn_lock);
return (retval);
}
/*
* We declare as 'int' rather than 'void' to satisfy pfi_t arg requirements.
* Parameters are assumed to be verified by the caller.
*/
/* ARGSUSED */
int
tcp_opt_set(conn_t *connp, uint_t optset_context, int level, int name,
uint_t inlen, uchar_t *invalp, uint_t *outlenp, uchar_t *outvalp,
void *thisdg_attrs, cred_t *cr)
{
tcp_t *tcp = connp->conn_tcp;
int *i1 = (int *)invalp;
boolean_t onoff = (*i1 == 0) ? 0 : 1;
boolean_t checkonly;
int reterr;
tcp_stack_t *tcps = tcp->tcp_tcps;
conn_opt_arg_t coas;
uint32_t val = *((uint32_t *)invalp);
coas.coa_connp = connp;
coas.coa_ixa = connp->conn_ixa;
coas.coa_ipp = &connp->conn_xmit_ipp;
coas.coa_ancillary = B_FALSE;
coas.coa_changed = 0;
switch (optset_context) {
case SETFN_OPTCOM_CHECKONLY:
checkonly = B_TRUE;
/*
* Note: Implies T_CHECK semantics for T_OPTCOM_REQ
* inlen != 0 implies value supplied and
* we have to "pretend" to set it.
* inlen == 0 implies that there is no
* value part in T_CHECK request and just validation
* done elsewhere should be enough, we just return here.
*/
if (inlen == 0) {
*outlenp = 0;
return (0);
}
break;
case SETFN_OPTCOM_NEGOTIATE:
checkonly = B_FALSE;
break;
case SETFN_UD_NEGOTIATE: /* error on conn-oriented transports ? */
case SETFN_CONN_NEGOTIATE:
checkonly = B_FALSE;
/*
* Negotiating local and "association-related" options
* from other (T_CONN_REQ, T_CONN_RES,T_UNITDATA_REQ)
* primitives is allowed by XTI, but we choose
* to not implement this style negotiation for Internet
* protocols (We interpret it is a must for OSI world but
* optional for Internet protocols) for all options.
* [ Will do only for the few options that enable test
* suites that our XTI implementation of this feature
* works for transports that do allow it ]
*/
if (!tcp_allow_connopt_set(level, name)) {
*outlenp = 0;
return (EINVAL);
}
break;
default:
/*
* We should never get here
*/
*outlenp = 0;
return (EINVAL);
}
ASSERT((optset_context != SETFN_OPTCOM_CHECKONLY) ||
(optset_context == SETFN_OPTCOM_CHECKONLY && inlen != 0));
/*
* For TCP, we should have no ancillary data sent down
* (sendmsg isn't supported for SOCK_STREAM), so thisdg_attrs
* has to be zero.
*/
ASSERT(thisdg_attrs == NULL);
/*
* For fixed length options, no sanity check
* of passed in length is done. It is assumed *_optcom_req()
* routines do the right thing.
*/
switch (level) {
case SOL_SOCKET:
switch (name) {
case SO_KEEPALIVE:
if (checkonly) {
/* check only case */
break;
}
if (!onoff) {
if (connp->conn_keepalive) {
if (tcp->tcp_ka_tid != 0) {
(void) TCP_TIMER_CANCEL(tcp,
tcp->tcp_ka_tid);
tcp->tcp_ka_tid = 0;
}
connp->conn_keepalive = 0;
}
break;
}
if (!connp->conn_keepalive) {
/* Crank up the keepalive timer */
tcp->tcp_ka_last_intrvl = 0;
tcp->tcp_ka_tid = TCP_TIMER(tcp,
tcp_keepalive_timer, tcp->tcp_ka_interval);
connp->conn_keepalive = 1;
}
break;
case SO_SNDBUF: {
if (*i1 > tcps->tcps_max_buf) {
*outlenp = 0;
return (ENOBUFS);
}
if (checkonly)
break;
connp->conn_sndbuf = *i1;
if (tcps->tcps_snd_lowat_fraction != 0) {
connp->conn_sndlowat = connp->conn_sndbuf /
tcps->tcps_snd_lowat_fraction;
}
(void) tcp_maxpsz_set(tcp, B_TRUE);
/*
* If we are flow-controlled, recheck the condition.
* There are apps that increase SO_SNDBUF size when
* flow-controlled (EWOULDBLOCK), and expect the flow
* control condition to be lifted right away.
*/
mutex_enter(&tcp->tcp_non_sq_lock);
if (tcp->tcp_flow_stopped &&
TCP_UNSENT_BYTES(tcp) < connp->conn_sndbuf) {
tcp_clrqfull(tcp);
}
mutex_exit(&tcp->tcp_non_sq_lock);
*outlenp = inlen;
return (0);
}
case SO_RCVBUF:
if (*i1 > tcps->tcps_max_buf) {
*outlenp = 0;
return (ENOBUFS);
}
/* Silently ignore zero */
if (!checkonly && *i1 != 0) {
*i1 = MSS_ROUNDUP(*i1, tcp->tcp_mss);
(void) tcp_rwnd_set(tcp, *i1);
}
/*
* XXX should we return the rwnd here
* and tcp_opt_get ?
*/
*outlenp = inlen;
return (0);
case SO_SND_COPYAVOID:
if (!checkonly) {
if (tcp->tcp_loopback ||
(onoff != 1) || !tcp_zcopy_check(tcp)) {
*outlenp = 0;
return (EOPNOTSUPP);
}
tcp->tcp_snd_zcopy_aware = 1;
}
*outlenp = inlen;
return (0);
}
break;
case IPPROTO_TCP:
switch (name) {
case TCP_NODELAY:
if (!checkonly)
tcp->tcp_naglim = *i1 ? 1 : tcp->tcp_mss;
break;
case TCP_NOTIFY_THRESHOLD:
if (!checkonly)
tcp->tcp_first_timer_threshold = *i1;
break;
case TCP_ABORT_THRESHOLD:
if (!checkonly)
tcp->tcp_second_timer_threshold = *i1;
break;
case TCP_CONN_NOTIFY_THRESHOLD:
if (!checkonly)
tcp->tcp_first_ctimer_threshold = *i1;
break;
case TCP_CONN_ABORT_THRESHOLD:
if (!checkonly)
tcp->tcp_second_ctimer_threshold = *i1;
break;
case TCP_RECVDSTADDR:
if (tcp->tcp_state > TCPS_LISTEN) {
*outlenp = 0;
return (EOPNOTSUPP);
}
/* Setting done in conn_opt_set */
break;
case TCP_INIT_CWND:
if (checkonly)
break;
/*
* Only allow socket with network configuration
* privilege to set the initial cwnd to be larger
* than allowed by RFC 3390.
*/
if (val > MIN(4, MAX(2, 4380 / tcp->tcp_mss))) {
if ((reterr = secpolicy_ip_config(cr, B_TRUE))
!= 0) {
*outlenp = 0;
return (reterr);
}
if (val > tcp_max_init_cwnd) {
*outlenp = 0;
return (EINVAL);
}
}
tcp->tcp_init_cwnd = val;
/*
* If the socket is connected, AND no outbound data
* has been sent, reset the actual cwnd values.
*/
if (tcp->tcp_state == TCPS_ESTABLISHED &&
tcp->tcp_iss == tcp->tcp_snxt - 1) {
tcp->tcp_cwnd =
MIN(tcp->tcp_rwnd, val * tcp->tcp_mss);
}
break;
/*
* TCP_KEEPIDLE is in seconds but TCP_KEEPALIVE_THRESHOLD
* is in milliseconds. TCP_KEEPIDLE is introduced for
* compatibility with other Unix flavors.
* We can fall through TCP_KEEPALIVE_THRESHOLD logic after
* converting the input to milliseconds.
*/
case TCP_KEEPIDLE:
*i1 *= 1000;
/* FALLTHRU */
case TCP_KEEPALIVE_THRESHOLD:
if (checkonly)
break;
if (*i1 < tcps->tcps_keepalive_interval_low ||
*i1 > tcps->tcps_keepalive_interval_high) {
*outlenp = 0;
return (EINVAL);
}
if (*i1 != tcp->tcp_ka_interval) {
tcp->tcp_ka_interval = *i1;
/*
* Check if we need to restart the
* keepalive timer.
*/
if (tcp->tcp_ka_tid != 0) {
ASSERT(connp->conn_keepalive);
(void) TCP_TIMER_CANCEL(tcp,
tcp->tcp_ka_tid);
tcp->tcp_ka_last_intrvl = 0;
tcp->tcp_ka_tid = TCP_TIMER(tcp,
tcp_keepalive_timer,
tcp->tcp_ka_interval);
}
}
break;
/*
* tcp_ka_abort_thres = tcp_ka_rinterval * tcp_ka_cnt.
* So setting TCP_KEEPCNT or TCP_KEEPINTVL can affect all the
* three members - tcp_ka_abort_thres, tcp_ka_rinterval and
* tcp_ka_cnt.
*/
case TCP_KEEPCNT:
if (checkonly)
break;
if (*i1 == 0) {
return (EINVAL);
} else if (tcp->tcp_ka_rinterval == 0) {
/*
* When TCP_KEEPCNT is specified without first
* specifying a TCP_KEEPINTVL, we infer an
* interval based on a tunable specific to our
* stack: the tcp_keepalive_abort_interval.
* (Or the TCP_KEEPALIVE_ABORT_THRESHOLD, in
* the unlikely event that that has been set.)
* Given the abort interval's default value of
* 480 seconds, low TCP_KEEPCNT values can
* result in intervals that exceed the default
* maximum RTO of 60 seconds. Rather than
* fail in these cases, we (implicitly) clamp
* the interval at the maximum RTO; if the
* TCP_KEEPCNT is shortly followed by a
* TCP_KEEPINTVL (as we expect), the abort
* threshold will be recalculated correctly --
* and if a TCP_KEEPINTVL is not forthcoming,
* keep-alive will at least operate reasonably
* given the underconfigured state.
*/
uint32_t interval;
interval = tcp->tcp_ka_abort_thres / *i1;
if (interval < tcp->tcp_rto_min)
interval = tcp->tcp_rto_min;
if (interval > tcp->tcp_rto_max)
interval = tcp->tcp_rto_max;
tcp->tcp_ka_rinterval = interval;
} else {
if ((*i1 * tcp->tcp_ka_rinterval) <
tcps->tcps_keepalive_abort_interval_low ||
(*i1 * tcp->tcp_ka_rinterval) >
tcps->tcps_keepalive_abort_interval_high)
return (EINVAL);
tcp->tcp_ka_abort_thres =
(*i1 * tcp->tcp_ka_rinterval);
}
tcp->tcp_ka_cnt = *i1;
break;
case TCP_KEEPINTVL:
/*
* TCP_KEEPINTVL is specified in seconds, but
* tcp_ka_rinterval is in milliseconds.
*/
if (checkonly)
break;
if ((*i1 * 1000) < tcp->tcp_rto_min ||
(*i1 * 1000) > tcp->tcp_rto_max)
return (EINVAL);
if (tcp->tcp_ka_cnt == 0) {
tcp->tcp_ka_cnt =
tcp->tcp_ka_abort_thres / (*i1 * 1000);
} else {
if ((*i1 * tcp->tcp_ka_cnt * 1000) <
tcps->tcps_keepalive_abort_interval_low ||
(*i1 * tcp->tcp_ka_cnt * 1000) >
tcps->tcps_keepalive_abort_interval_high)
return (EINVAL);
tcp->tcp_ka_abort_thres =
(*i1 * tcp->tcp_ka_cnt * 1000);
}
tcp->tcp_ka_rinterval = *i1 * 1000;
break;
case TCP_KEEPALIVE_ABORT_THRESHOLD:
if (!checkonly) {
if (*i1 <
tcps->tcps_keepalive_abort_interval_low ||
*i1 >
tcps->tcps_keepalive_abort_interval_high) {
*outlenp = 0;
return (EINVAL);
}
tcp->tcp_ka_abort_thres = *i1;
tcp->tcp_ka_cnt = 0;
tcp->tcp_ka_rinterval = 0;
}
break;
case TCP_CONGESTION: {
struct cc_algo *algo;
if (checkonly) {
break;
}
/*
* Make sure the string is NUL-terminated. Some
* consumers pass only the number of characters
* in the string, and don't include the NUL
* terminator, so we set it for them.
*/
if (inlen < CC_ALGO_NAME_MAX) {
invalp[inlen] = '\0';
}
invalp[CC_ALGO_NAME_MAX - 1] = '\0';
if ((algo = cc_load_algo((char *)invalp)) == NULL) {
return (ENOENT);
}
if (CC_ALGO(tcp)->cb_destroy != NULL) {
CC_ALGO(tcp)->cb_destroy(&tcp->tcp_ccv);
}
CC_DATA(tcp) = NULL;
CC_ALGO(tcp) = algo;
if (CC_ALGO(tcp)->cb_init != NULL) {
VERIFY0(CC_ALGO(tcp)->cb_init(&tcp->tcp_ccv));
}
break;
}
case TCP_CORK:
if (!checkonly) {
/*
* if tcp->tcp_cork was set and is now
* being unset, we have to make sure that
* the remaining data gets sent out. Also
* unset tcp->tcp_cork so that tcp_wput_data()
* can send data even if it is less than mss
*/
if (tcp->tcp_cork && onoff == 0 &&
tcp->tcp_unsent > 0) {
tcp->tcp_cork = B_FALSE;
tcp_wput_data(tcp, NULL, B_FALSE);
}
tcp->tcp_cork = onoff;
}
break;
case TCP_QUICKACK:
if (!checkonly) {
tcp->tcp_quickack = onoff;
}
break;
case TCP_RTO_INITIAL:
if (checkonly || val == 0)
break;
/*
* Sanity checks
*
* The initial RTO should be bounded by the minimum
* and maximum RTO. And it should also be smaller
* than the connect attempt abort timeout. Otherwise,
* the connection won't be aborted in a period
* reasonably close to that timeout.
*/
if (val < tcp->tcp_rto_min || val > tcp->tcp_rto_max ||
val > tcp->tcp_second_ctimer_threshold ||
val < tcps->tcps_rexmit_interval_initial_low ||
val > tcps->tcps_rexmit_interval_initial_high) {
*outlenp = 0;
return (EINVAL);
}
tcp->tcp_rto_initial = val;
/*
* If TCP has not sent anything, need to re-calculate
* tcp_rto. Otherwise, this option change does not
* really affect anything.
*/
if (tcp->tcp_state >= TCPS_SYN_SENT)
break;
tcp->tcp_rtt_sa = MSEC2NSEC(tcp->tcp_rto_initial) << 2;
tcp->tcp_rtt_sd = MSEC2NSEC(tcp->tcp_rto_initial) >> 1;
tcp->tcp_rto = tcp_calculate_rto(tcp, tcps,
tcps->tcps_conn_grace_period);
break;
case TCP_RTO_MIN:
if (checkonly || val == 0)
break;
if (val < tcps->tcps_rexmit_interval_min_low ||
val > tcps->tcps_rexmit_interval_min_high ||
val > tcp->tcp_rto_max) {
*outlenp = 0;
return (EINVAL);
}
tcp->tcp_rto_min = val;
if (tcp->tcp_rto < val)
tcp->tcp_rto = val;
break;
case TCP_RTO_MAX:
if (checkonly || val == 0)
break;
/*
* Sanity checks
*
* The maximum RTO should not be larger than the
* connection abort timeout. Otherwise, the
* connection won't be aborted in a period reasonably
* close to that timeout.
*/
if (val < tcps->tcps_rexmit_interval_max_low ||
val > tcps->tcps_rexmit_interval_max_high ||
val < tcp->tcp_rto_min ||
val > tcp->tcp_second_timer_threshold) {
*outlenp = 0;
return (EINVAL);
}
tcp->tcp_rto_max = val;
if (tcp->tcp_rto > val)
tcp->tcp_rto = val;
break;
case TCP_LINGER2:
if (checkonly || *i1 == 0)
break;
/*
* Note that the option value's unit is second. And
* the value should be bigger than the private
* parameter tcp_fin_wait_2_flush_interval's lower
* bound and smaller than the current value of that
* parameter. It should be smaller than the current
* value to avoid an app setting TCP_LINGER2 to a big
* value, causing resource to be held up too long in
* FIN-WAIT-2 state.
*/
if (*i1 < 0 ||
tcps->tcps_fin_wait_2_flush_interval_low/SECONDS >
*i1 ||
tcps->tcps_fin_wait_2_flush_interval/SECONDS <
*i1) {
*outlenp = 0;
return (EINVAL);
}
tcp->tcp_fin_wait_2_flush_interval = *i1 * SECONDS;
break;
default:
break;
}
break;
case IPPROTO_IP:
if (connp->conn_family != AF_INET) {
*outlenp = 0;
return (EINVAL);
}
switch (name) {
case IP_SEC_OPT:
/*
* We should not allow policy setting after
* we start listening for connections.
*/
if (tcp->tcp_state == TCPS_LISTEN) {
return (EINVAL);
}
break;
case IP_RECVTOS:
if (!checkonly) {
/*
* Force it to be sent up with the next msg
* by setting it to a value which cannot
* appear in a packet (TOS is only 8-bits)
*/
tcp->tcp_recvtos = 0xffffffffU;
}
break;
}
break;
case IPPROTO_IPV6:
/*
* IPPROTO_IPV6 options are only supported for sockets
* that are using IPv6 on the wire.
*/
if (connp->conn_ipversion != IPV6_VERSION) {
*outlenp = 0;
return (EINVAL);
}
switch (name) {
case IPV6_RECVPKTINFO:
if (!checkonly) {
/* Force it to be sent up with the next msg */
tcp->tcp_recvifindex = 0;
}
break;
case IPV6_RECVTCLASS:
if (!checkonly) {
/* Force it to be sent up with the next msg */
tcp->tcp_recvtclass = 0xffffffffU;
}
break;
case IPV6_RECVHOPLIMIT:
if (!checkonly) {
/* Force it to be sent up with the next msg */
tcp->tcp_recvhops = 0xffffffffU;
}
break;
case IPV6_PKTINFO:
/* This is an extra check for TCP */
if (inlen == sizeof (struct in6_pktinfo)) {
struct in6_pktinfo *pkti;
pkti = (struct in6_pktinfo *)invalp;
/*
* RFC 3542 states that ipi6_addr must be
* the unspecified address when setting the
* IPV6_PKTINFO sticky socket option on a
* TCP socket.
*/
if (!IN6_IS_ADDR_UNSPECIFIED(&pkti->ipi6_addr))
return (EINVAL);
}
break;
case IPV6_SEC_OPT:
/*
* We should not allow policy setting after
* we start listening for connections.
*/
if (tcp->tcp_state == TCPS_LISTEN) {
return (EINVAL);
}
break;
}
break;
}
reterr = conn_opt_set(&coas, level, name, inlen, invalp,
checkonly, cr);
if (reterr != 0) {
*outlenp = 0;
return (reterr);
}
/*
* Common case of OK return with outval same as inval
*/
if (invalp != outvalp) {
/* don't trust bcopy for identical src/dst */
(void) bcopy(invalp, outvalp, inlen);
}
*outlenp = inlen;
if (coas.coa_changed & COA_HEADER_CHANGED) {
/* If we are connected we rebuilt the headers */
if (!IN6_IS_ADDR_UNSPECIFIED(&connp->conn_faddr_v6) &&
!IN6_IS_ADDR_V4MAPPED_ANY(&connp->conn_faddr_v6)) {
reterr = tcp_build_hdrs(tcp);
if (reterr != 0)
return (reterr);
}
}
if (coas.coa_changed & COA_ROUTE_CHANGED) {
in6_addr_t nexthop;
/*
* If we are connected we re-cache the information.
* We ignore errors to preserve BSD behavior.
* Note that we don't redo IPsec policy lookup here
* since the final destination (or source) didn't change.
*/
ip_attr_nexthop(&connp->conn_xmit_ipp, connp->conn_ixa,
&connp->conn_faddr_v6, &nexthop);
if (!IN6_IS_ADDR_UNSPECIFIED(&connp->conn_faddr_v6) &&
!IN6_IS_ADDR_V4MAPPED_ANY(&connp->conn_faddr_v6)) {
(void) ip_attr_connect(connp, connp->conn_ixa,
&connp->conn_laddr_v6, &connp->conn_faddr_v6,
&nexthop, connp->conn_fport, NULL, NULL,
IPDF_VERIFY_DST);
}
}
if ((coas.coa_changed & COA_SNDBUF_CHANGED) && !IPCL_IS_NONSTR(connp)) {
connp->conn_wq->q_hiwat = connp->conn_sndbuf;
}
if (coas.coa_changed & COA_WROFF_CHANGED) {
connp->conn_wroff = connp->conn_ht_iphc_allocated +
tcps->tcps_wroff_xtra;
(void) proto_set_tx_wroff(connp->conn_rq, connp,
connp->conn_wroff);
}
if (coas.coa_changed & COA_OOBINLINE_CHANGED) {
if (IPCL_IS_NONSTR(connp))
proto_set_rx_oob_opt(connp, onoff);
}
return (0);
}
|