diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2010-07-03 04:44:53 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2010-07-03 04:44:53 +0000 |
commit | 1df4f9d5fc0dabecca2ff9680db469442a1cfc73 (patch) | |
tree | f1096c33d9ee94872dc2030b23f093a1335185a3 /usr.sbin/traceroute | |
parent | a5a38a4c5ed836aeac420d462a2319bc2732aab9 (diff) |
Fix the naming of interfaces and variables for rdomains and rtables
and make it possible to bind sockets (including listening sockets!)
to rtables and not just rdomains. This changes the name of the
system calls, socket option, and ioctl. After building with this
you should remove the files /usr/share/man/cat2/[gs]etrdomain.0.
Since this removes the existing [gs]etrdomain() system calls, the
libc major is bumped.
Written by claudio@, criticized^Wcritiqued by me
Diffstat (limited to 'usr.sbin/traceroute')
-rw-r--r-- | usr.sbin/traceroute/traceroute.8 | 10 | ||||
-rw-r--r-- | usr.sbin/traceroute/traceroute.c | 19 |
2 files changed, 15 insertions, 14 deletions
diff --git a/usr.sbin/traceroute/traceroute.8 b/usr.sbin/traceroute/traceroute.8 index 022ef6dc3d2..fcc4a417446 100644 --- a/usr.sbin/traceroute/traceroute.8 +++ b/usr.sbin/traceroute/traceroute.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: traceroute.8,v 1.42 2009/07/06 06:50:03 jmc Exp $ +.\" $OpenBSD: traceroute.8,v 1.43 2010/07/03 04:44:52 guenther Exp $ .\" $NetBSD: traceroute.8,v 1.6 1995/10/12 03:05:50 mycroft Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 @@ -33,7 +33,7 @@ .\" .\" @(#)traceroute.8 8.1 (Berkeley) 6/6/93 .\" -.Dd $Mdocdate: July 6 2009 $ +.Dd $Mdocdate: July 3 2010 $ .Dt TRACEROUTE 8 .Os .Sh NAME @@ -51,7 +51,7 @@ .Op Fl q Ar nqueries .Op Fl s Ar src_addr .Op Fl t Ar tos -.Op Fl V Ar rdomain +.Op Fl V Ar rtable .Op Fl w Ar waittime .Ar host .Op Ar packetsize @@ -191,8 +191,8 @@ Useful values are probably (low delay) and .Ql -t 8 (high throughput). -.It Fl V Ar rdomain -Set the routing domain. +.It Fl V Ar rtable +Set the routing table to be used. The default is 0. .It Fl v Verbose output. diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c index 274ba3a7369..23ec4b3825f 100644 --- a/usr.sbin/traceroute/traceroute.c +++ b/usr.sbin/traceroute/traceroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traceroute.c,v 1.68 2009/10/27 23:59:57 deraadt Exp $ */ +/* $OpenBSD: traceroute.c,v 1.69 2010/07/03 04:44:52 guenther Exp $ */ /* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */ /*- @@ -295,7 +295,8 @@ main(int argc, char *argv[]) char *ep; const char *errstr; long l; - uid_t uid, rdomain; + uid_t uid; + u_int rtableid; if ((s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0) err(5, "icmp socket"); @@ -424,16 +425,16 @@ main(int argc, char *argv[]) verbose++; break; case 'V': - rdomain = (unsigned int)strtonum(optarg, 0, + rtableid = (unsigned int)strtonum(optarg, 0, RT_TABLEID_MAX, &errstr); if (errstr) - errx(1, "rdomain value is %s: %s", + errx(1, "rtable value is %s: %s", errstr, optarg); - if (setsockopt(sndsock, IPPROTO_IP, SO_RDOMAIN, - &rdomain, sizeof(rdomain)) == -1) + if (setsockopt(sndsock, IPPROTO_IP, SO_RTABLE, + &rtableid, sizeof(rtableid)) == -1) err(1, "setsockopt SO_RDOMAIN"); - if (setsockopt(s, IPPROTO_IP, SO_RDOMAIN, - &rdomain, sizeof(rdomain)) == -1) + if (setsockopt(s, IPPROTO_IP, SO_RTABLE, + &rtableid, sizeof(rtableid)) == -1) err(1, "setsockopt SO_RDOMAIN"); break; case 'w': @@ -1041,6 +1042,6 @@ usage(void) fprintf(stderr, "usage: %s [-cDdIlnrSv] [-f first_ttl] [-g gateway_addr] [-m max_ttl]\n" "\t[-P proto] [-p port] [-q nqueries] [-s src_addr] [-t tos]\n" - "\t[-V rdomain] [-w waittime] host [packetsize]\n", __progname); + "\t[-V rtable] [-w waittime] host [packetsize]\n", __progname); exit(1); } |