Print this page
13175 Add support for IP_RECVTOS
13182 CMSG_ macros should have man pages
Change-ID: I784aa36cfd3c17e3cccbf1fd329fa7e69b663ef9
@@ -21,10 +21,11 @@
/*
* 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.
*/
#include <sys/types.h>
#include <sys/stream.h>
#define _SUN_TPI_VERSION 2
@@ -154,10 +155,11 @@
{ 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,
@@ -1030,10 +1032,20 @@
*/
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