Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151432567
D34154.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D34154.diff
View Options
diff --git a/share/man/man4/ip.4 b/share/man/man4/ip.4
--- a/share/man/man4/ip.4
+++ b/share/man/man4/ip.4
@@ -90,10 +90,13 @@
.Ed
.Pp
.Dv IP_TOS
-and
+may be used to set the differential service codepoint (DSCP) and the
+explicit congestion notfication (ECN) codepoint.
+Setting the ECN codepoint - the two least significant bits - on a
+socket using a transport protocol implementing ECN has no effect.
+.Pp
.Dv IP_TTL
-may be used to set the type-of-service and time-to-live
-fields in the
+configures the time-to-live (TTL) field in the
.Tn IP
header for
.Dv SOCK_STREAM , SOCK_DGRAM ,
@@ -102,7 +105,7 @@
sockets.
For example,
.Bd -literal
-int tos = IPTOS_LOWDELAY; /* see <netinet/ip.h> */
+int tos = IPTOS_DSCP_EF; /* see <netinet/ip.h> */
setsockopt(s, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
int ttl = 60; /* max = 255 */
diff --git a/sys/netinet/ip.h b/sys/netinet/ip.h
--- a/sys/netinet/ip.h
+++ b/sys/netinet/ip.h
@@ -79,7 +79,7 @@
#define IPTOS_LOWDELAY 0x10
#define IPTOS_THROUGHPUT 0x08
#define IPTOS_RELIABILITY 0x04
-#define IPTOS_MINCOST 0x02
+#define IPTOS_MINCOST IPTOS_DSCP_CS0
/*
* Definitions for IP precedence (also in ip_tos) (deprecated).
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -82,6 +82,7 @@
#include <netinet/in_pcb.h>
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
+#include <netinet/ip.h>
#include <netinet/ip_var.h>
#ifdef INET6
#include <netinet/ip6.h>
@@ -1759,6 +1760,8 @@
case IPPROTO_IP:
switch (sopt->sopt_name) {
case IP_TOS:
+ inp->inp_ip_tos &= ~IPTOS_ECN_MASK;
+ break;
case IP_TTL:
/* Notify tcp stacks that care (e.g. RACK). */
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 9, 9:15 AM (14 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31148470
Default Alt Text
D34154.diff (1 KB)
Attached To
Mode
D34154: Disallow setting of ECN bits with setsockopt()
Attached
Detach File
Event Timeline
Log In to Comment