Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145216808
D26410.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D26410.diff
View Options
Index: head/usr.sbin/traceroute6/traceroute6.8
===================================================================
--- head/usr.sbin/traceroute6/traceroute6.8
+++ head/usr.sbin/traceroute6/traceroute6.8
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 16, 2019
+.Dd September 13, 2020
.Dt TRACEROUTE6 8
.Os
.\"
@@ -61,6 +61,9 @@
.Op Fl s Ar src
.Ek
.Bk -words
+.Op Fl t Ar tclass
+.Ek
+.Bk -words
.Op Fl w Ar waittime
.Ek
.Bk -words
@@ -148,6 +151,13 @@
.Ar datalen
is up to 28, probe packets consist of a SHUTDOWN-ACK chunk possibly bundled
with a PAD chunk. For larger probe packets, an INIT chunk is used.
+.It Fl t Ar tclass
+.Ar tclass
+specifies the
+.Em traffic class
+used when sending probe packets.
+The value must be a decimal integer in the range 0 to 255.
+The default is 0.
.It Fl T
Use TCP segments for the probes.
.It Fl U
Index: head/usr.sbin/traceroute6/traceroute6.c
===================================================================
--- head/usr.sbin/traceroute6/traceroute6.c
+++ head/usr.sbin/traceroute6/traceroute6.c
@@ -346,6 +346,7 @@
static u_int16_t srcport;
static u_int16_t port = 32768+666; /* start udp dest port # for probe packets */
static u_int16_t ident;
+static int tclass = -1;
static int options; /* socket options */
static int verbose;
static int waittime = 5; /* time to wait for response (in seconds) */
@@ -364,7 +365,7 @@
int ch, i, on = 1, seq, rcvcmsglen, error;
struct addrinfo hints, *res;
static u_char *rcvcmsgbuf;
- u_long probe, hops, lport;
+ u_long probe, hops, lport, ltclass;
struct hostent *hp;
size_t size, minlen;
uid_t uid;
@@ -414,7 +415,7 @@
seq = 0;
ident = htons(getpid() & 0xffff); /* same as ping6 */
- while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:STUvw:")) != -1)
+ while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:St:TUvw:")) != -1)
switch (ch) {
case 'a':
as_path = 1;
@@ -531,6 +532,17 @@
case 'S':
useproto = IPPROTO_SCTP;
break;
+ case 't':
+ ep = NULL;
+ errno = 0;
+ ltclass = strtoul(optarg, &ep, 0);
+ if (errno || !*optarg || *ep || ltclass > 255) {
+ fprintf(stderr,
+ "traceroute6: invalid traffic class.\n");
+ exit(1);
+ }
+ tclass = (int)ltclass;
+ break;
case 'T':
useproto = IPPROTO_TCP;
break;
@@ -595,6 +607,13 @@
exit(1);
}
+ if (tclass != -1) {
+ if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_TCLASS, &tclass,
+ sizeof(int)) == -1) {
+ perror("setsockopt(IPV6_TCLASS)");
+ exit(7);
+ }
+ }
if (argc < 1 || argc > 2)
usage();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 18, 5:15 AM (14 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28838296
Default Alt Text
D26410.diff (2 KB)
Attached To
Mode
D26410: Allow specifying the traffic class when using traceroute6
Attached
Detach File
Event Timeline
Log In to Comment