Page MenuHomeFreeBSD

D34154.id102310.diff
No OneTemporary

D34154.id102310.diff

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/ip_output.c
===================================================================
--- sys/netinet/ip_output.c
+++ sys/netinet/ip_output.c
@@ -1200,7 +1200,7 @@
switch (sopt->sopt_name) {
case IP_TOS:
- inp->inp_ip_tos = optval;
+ inp->inp_ip_tos = optval & ~IPTOS_ECN_MASK;
break;
case IP_TTL:
Index: sys/netinet/tcp_stacks/rack.c
===================================================================
--- sys/netinet/tcp_stacks/rack.c
+++ sys/netinet/tcp_stacks/rack.c
@@ -20475,7 +20475,7 @@
/*
* The DSCP codepoint has changed, update the fsb.
*/
- ip->ip_tos = rack->rc_inp->inp_ip_tos;
+ ip->ip_tos = rack->rc_inp->inp_ip_tos & ~IPTOS_ECN_MASK;
break;
case IP_TTL:
/*

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 23, 10:55 PM (39 m, 5 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35418697
Default Alt Text
D34154.id102310.diff (1 KB)

Event Timeline