Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F155141659
D34154.id102329.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.id102329.diff
View Options
Index: share/man/man4/ip.4
===================================================================
--- share/man/man4/ip.4
+++ share/man/man4/ip.4
@@ -92,8 +92,8 @@
.Dv IP_TOS
and
.Dv IP_TTL
-may be used to set the type-of-service and time-to-live
-fields in the
+may be used to set the differential service codepoint (DSCP) and
+time-to-live (TTL) fields in the
.Tn IP
header for
.Dv SOCK_STREAM , SOCK_DGRAM ,
@@ -102,8 +102,8 @@
sockets.
For example,
.Bd -literal
-int tos = IPTOS_LOWDELAY; /* see <netinet/ip.h> */
-setsockopt(s, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
+int dscp = IPTOS_DSCP_EF; /* see <netinet/ip.h> */
+setsockopt(s, IPPROTO_IP, IP_TOS, &dscp, sizeof(dscp));
int ttl = 60; /* max = 255 */
setsockopt(s, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
Index: sys/netinet/ip.h
===================================================================
--- sys/netinet/ip.h
+++ 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).
Index: sys/netinet/tcp_usrreq.c
===================================================================
--- sys/netinet/tcp_usrreq.c
+++ 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
Sat, May 2, 3:53 PM (20 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32625178
Default Alt Text
D34154.id102329.diff (1 KB)
Attached To
Mode
D34154: Disallow setting of ECN bits with setsockopt()
Attached
Detach File
Event Timeline
Log In to Comment