Commit Graph

219 Commits

Author SHA1 Message Date
itojun b95181fc9b NI_WITHSCOPEID was not picked up by IETF standardization process. 2004-11-16 05:59:32 +00:00
itojun ba67da06a5 bump buffer size for any_ntoa(), for huge sa_len 2004-05-15 14:13:36 +00:00
itojun 7340ad20ce 2-byte read overrun for unknown sockaddr. from openbsd
XXX out[64], is it safe?  what if sa_len > 23?
2004-05-15 13:41:09 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00
itojun d3e55680aa correct typo. PR misc/22944 2003-10-02 00:09:06 +00:00
itojun 83ddaf1cbf print prefixlen on -show 2003-10-01 06:24:19 +00:00
cube 5041ba1a4c Remove a comment that referred to a non-committed part of the patch I
submitted for bin/17613. Ok'd by mrg@.
2003-09-16 09:34:48 +00:00
agc 276d62f603 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22308, verified by myself.
2003-08-07 10:04:22 +00:00
wiz 7539e84445 Bump date for flushall description. 2003-08-07 09:46:17 +00:00
jrf ce22377a7e This is an updated submitted patch originally written by Jim Rees
and sent in by Greg Hudson as seen in PR misc/3227. Basically what it
does is adds a flushall option which deletes all but localhost routes.
This is done by andoring in a flag called doall (1 means do all routes
including gateway, 0 means do a regular flush). I have seen some
platforms that do this. I tested it out on ipv4 only, it works as
advertised. Commit was approved by christos@.
2003-07-19 01:36:47 +00:00
christos 072bca2c13 PR/21856: Robert Elz: Changes to route(8) to allow /n instead of -prefixlen
for INET6
2003-06-11 15:45:20 +00:00
itojun 627957eb53 permit foo/bar notation, like "route add 10.0.0.0/8 127.0.0.1".
originally by provos
2003-06-03 04:41:42 +00:00
itojun 9cbeabfe77 strlcpy [a few mistakes found] 2003-05-17 23:02:28 +00:00
jrf 6867af7aad This addresses PR 17613 when certain methods of adding routes would
muck up the routing tables. The patch was submitted by Quentin Garnier
<netbsd@quatriemek.com> and tweaked a little after it was reviewed
by Christos Zoulas <christos@netbsd.org>. Final change/commit approved
by Christos.
2003-04-21 13:42:50 +00:00
jrf dee179a37f Made a note in the code about the -d and -d options brought up in
PR 18674. Thanks to Chris Jones for pointing it out.
2003-04-03 02:39:50 +00:00
wiz a9f7f104b6 Split .Nm with other macro arguments on two lines. 2003-02-25 07:53:39 +00:00
itojun e33246f5c7 correct prefixlen handling for IPv4. 2002-10-18 00:21:23 +00:00
itojun 3c30f46849 Make prefixlen check to make sure its argument is present before deref
from openbsd
2002-10-18 00:16:25 +00:00
wiz 09cbac4e7f New sentence, new line. From Robert Elz. 2002-10-03 15:41:44 +00:00
grant 6742cb1812 sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:36:17 +00:00
itojun d24b68cd4f permit DNS names to address portion. they will be considered as RTF_HOST
if specified as destination (as there's no getnetbyname in IPv6).
2002-06-10 21:18:53 +00:00
itojun a1662dac72 if we're unsure about prefixlen, don't say "128". 2002-06-05 22:11:28 +00:00
itojun 65829ef6aa more correct ion to RTF_HOST handling. 2002-06-05 22:10:44 +00:00
itojun fff7bbceef do not have -prefixlen 128 on RTF_HOST.
From: Dawid Szymanski <dawszy@arhea.net>
2002-06-04 22:20:00 +00:00
itojun e534b69c1d raise RTF_HOST if destination is a host (/128). from ume 2002-05-20 23:01:32 +00:00
christos 69da3546f5 PR/15672: Love: route monitor missing info 2002-02-21 15:44:25 +00:00
hubertf 85cc2d10d5 the modifiers (-inet6, ...) do not only affect the behaviour of "flush",
but at least also of "get", so make the wording a bit more general.
2002-02-08 13:32:32 +00:00
ross dc5571b22e Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:21:55 +00:00
wiz 7dd6e69db4 Punctuation fix, sort sections, sort SEE ALSO. 2001-11-16 12:08:49 +00:00
christos 4c4a8c2fb6 Make route exit with a non-zero error code when operations to the routing
socket fails. eg, running route add 1.2.3.4 5.6.7.8 as non root.
2001-11-15 21:25:08 +00:00
lukem fd87fe6aaa fix -Wshadow warnings 2001-11-02 03:51:48 +00:00
atatat cdc6282274 Provide a short output format for the get command that only prints the
address corresponding to RTA_GATEWAY, or nothing if it doesn't exist.
Modify the exit value of route depending on this, so that one can do
stuff like:

#!/bin/sh
gw=`route -sn get default 2>/dev/null`
if [ -z "$gw" ]; then
	echo no default route
	exit 1
fi
ping -w1 -c1 $gw >/dev/null 2>&1
if ! route -sn get $gw >/dev/null; then
	echo default gateway not responding
	exit 1
fi
echo default gateway is at $gw
2001-10-24 18:40:16 +00:00
atatat 2e4d1a174e Print a R on reject routes to indicate that they're not normal routes,
and check netmask (or prefix) length as well as the destination
address when determining if a route is a "default" or not.  This means
that the output from 'route show' will no longer say:

	Internet6:
	Destination       Gateway            Flags
	default           localhost          UG
	default           localhost          UG

but instead

	Internet6:
	Destination       Gateway            Flags
	::/104            localhost          UGR
	::/96             localhost          UGR

which makes much more sense.
2001-10-24 16:05:06 +00:00
christos b77fb2a456 PR/14286: reed@reedmedia.net: Explain default. 2001-10-18 13:42:32 +00:00
bjh21 6ef5a92fbb When dumping the routing table, use getnameinfo() to print link-layer
addresses rather than doing it ourselves and falling back to link_ntoa().
2001-10-06 18:32:45 +00:00
itojun d615372573 off-by-one error in -prefixlen arg validation (do not permit 129 on IPv6) 2001-07-20 08:31:55 +00:00
itojun 507c97b62e make prefixlen work on IPv4 too 2001-07-20 08:28:25 +00:00
bad 4cda42fdd0 The way pmsg_addrs() is used requires that it always prints a newline and
flushes stdout before returning.

Previously the decoded output for a message was stuck in stdio buffers until
the next arrived.
2001-07-16 17:22:07 +00:00
wiz d12a675883 Fix Nd and some whitespace and punctuation. 2001-06-05 12:44:43 +00:00
wiz 73f545bb5b Drop arguments of .Os. 2001-06-05 11:22:41 +00:00
manu e0e227f2a3 Added a few examples and a reference to sysctl to enable IP forwarding
Approved by Christos
2001-04-27 19:33:06 +00:00
cgd 8a986b2e96 convert to use getprogname() 2001-02-19 22:48:57 +00:00
christos 55692aa513 remove nested externs. 2001-02-04 21:09:07 +00:00
itojun 08087050ed support -cloned command line flag.
i don't think anyone ever going to use it.
2001-01-27 04:53:13 +00:00
itojun 6a04f28b13 regen 2001-01-27 04:51:25 +00:00
itojun 16595a06cf add a keyword, cloned 2001-01-27 04:51:17 +00:00
itojun fee00b1a78 mark cloned routes with RTF_CLONED. present it with netstat -r by "c".
let static routes overwrite cloned routes, as cloned routes can come back again
if necessary.  behavior same as freebsd/bsdi, code partially from bsdi42.
(NRL rt->rt_parent was not added)
should fix PR 11916 and maybe some other PRs with ARP behavior.

recompilation of usr.sbin/route6d is suggested.
2001-01-27 04:49:31 +00:00
itojun ad678343e6 support RTF_BLACKHOLE.
XXX route show is total duplicate of netstat -r, we need to either remove
route show, or share the same source code, otherwise maintenance cost
bites (and is biting) us
2001-01-27 04:26:49 +00:00
itojun d9196c1881 remove use of uninitialized route (struct ortentry).
it seems that the bug was born during 4.3reno -> 4.4Lite1 transition.
2001-01-27 03:20:29 +00:00
is 9979da6cbb Format string cleanups by Bill Sommerfeld. 2000-10-10 20:24:49 +00:00
itojun d72739fb8a on "route monitor", print RTM_IFANNOUNCE, RTM_IFINFO (new #), and others. 2000-10-10 09:35:05 +00:00
sommerfeld 16bad8ee40 Allow INET6 to be used with SMALL without undefined symbols 2000-05-04 18:29:34 +00:00
itojun 9de652ed48 use scoped notation for link-local multicast too. 2000-04-20 12:25:08 +00:00
itojun bfbec7cf43 support extended scoped address notation (fe80::1%de0).
it hides implementation detail (embedded ifid) from the users.
2000-04-20 12:08:50 +00:00
itojun f816cfa0ca don't make "-prefixlen 64" a default in -inet6 case. the past behavior
was not compatible with past practice ("route get" did not work right).

sync with recent KAME.
1999-12-03 05:43:00 +00:00
drochner 85cbf55d16 Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
1999-11-09 15:06:30 +00:00
sommerfeld a5e1bf5368 Display local address associated with route (if any) in "route get". 1999-11-01 13:32:38 +00:00
itojun 0a69640f14 remove false fix for routing socket align issue. 1999-09-03 04:17:19 +00:00
itojun 65b4964f1e fix alignment issue in routing socket data, on 64bit arch (i.e. alpha).
sockaddrs are packed with ROUNDUP() in sys/net/rtsock.c so userland
programs needs to follow that.

PR: 8179
1999-09-03 03:47:39 +00:00
itojun 9e2ce6114e tweak IPv6 case so that "route show" does not truncate numeric IPv6 address.
PR: 7955
1999-07-17 06:51:27 +00:00
itojun d4aa58bc6c avoid using constants, use #define'd values. 1999-07-12 20:46:15 +00:00
mjacob dd514ad75e Incorrect integration. ctime takes a time_t value, not a long. 1999-07-06 23:15:48 +00:00
itojun 9a6abc8c5d s/CFLAGS/CPPFLAGS/ for -D and -I. 1999-07-03 06:26:25 +00:00
itojun d211125175 IPv6-ready route command (-inet6 and -prefixlen are added) 1999-07-02 15:29:02 +00:00
mycroft 68d6f4bf44 Remove spurious .ne's. 1999-03-24 06:27:49 +00:00
bgrayson f4609c553d Typo fixed 1999-03-04 03:03:15 +00:00
lukem a9db50e608 * implement -f; flush all routes before executing command
* reset af to 0 in flushroutes() and newroute()
* cleanup -DSMALL:
-   `flush' and AF_APPLETALK is supported (the latter had partial support)
-   AF_NS, AF_ISO, and AF_CCITT are not supported at all (rather than being
-   partially unsupported).
1998-10-23 05:36:42 +00:00
mycroft 519d858510 __AUDIT__ cleanup. 1998-07-28 19:22:54 +00:00
mycroft 0db548a927 const poisoning. 1998-07-26 14:57:56 +00:00
fair 3d7afc6d03 fix bad .Xr references 1998-04-29 09:49:10 +00:00
kleink 7dac38df65 Need <time.h> for time() prototype. 1998-04-01 15:14:25 +00:00
ross a7c69aab3f 64-bit sweep, "route -v show" was spinning forever. 1998-02-05 21:09:46 +00:00
kleink 5f9598407c Recognize AF_APPLETALK as "AppleTalk". 1997-12-01 17:03:24 +00:00
christos e65e7d8dd2 Use {warn,err}{,x}(3) instead of printf's 1997-11-16 17:03:11 +00:00
christos e230a48b57 CFLAGS->CPPFLAGS 1997-10-10 19:47:50 +00:00
enami 2481ddf882 Don't declare optind. 1997-10-01 02:22:54 +00:00
lukem 5e45f6e836 resolve conflicts from lite-2 import 1997-09-16 07:04:17 +00:00
lukem b0670720e5 wrap line @ 80 columns 1997-09-15 09:34:58 +00:00
lukem c9d9a2a11e * cleanup for WARNS=1
* use .Nm correctly
* deprecate register
* getopt returns -1 not EOF
1997-09-15 09:15:26 +00:00
thorpej 1f0fddb7d1 Fix uninitialized pointer botch when attempting to flush an already
empty routing table.  From Matthias Scheler <tron@lyssa.owl.de>, in
PR #4074.
1997-09-02 00:30:49 +00:00
mikel 788dcf907f fix numerous tyops and use some -mdoc macros to advantage 1997-08-27 06:38:06 +00:00
mikel d110bb9714 comment out xref to XNSrouted(8) 1997-07-10 04:14:32 +00:00
mycroft cc4a1553a1 Eliminate bogus redefinitions of standard targets. 1997-05-09 07:50:03 +00:00
thorpej 186a8bd2e4 Don't SEGV if a qualifier is passed without an argument. From
Geoff Wing <mason@primenet.com.au>, fixes PR #2700.
1997-04-27 16:58:22 +00:00
mrg 1dcbfad4c0 be safe with buffers. 1997-04-21 11:42:11 +00:00
mrg 0ebc8c3756 KNF. be safe with buffers. 1997-04-21 11:40:13 +00:00
christos d9349e61e1 - Add netatalk bits
- Add prototypes
- Fix printf formats
1997-04-03 02:35:46 +00:00
carrel 533cb559da Remove uid checks since the kernel now handles this and route(1) is no
longer setuid.
Document the "Permission denied" msg in the man page since this is
_slightly_ less clear than route(1)'s old error msg.
1997-02-22 21:22:24 +00:00
thorpej c7e33aad6c Now that non-superuser can open the routing socket, this program no
longer needs to be setuid-root.  Superuser status is required to
alter the routing table, but is enforced by the kernel.
1997-02-22 03:49:31 +00:00
cgd d9842e70b9 declare the keywords structure 'extern' in keywords.h, to avoid a common defn. 1996-12-16 19:53:02 +00:00
gwr 6b2707d575 Note that distrib/utils/x_route uses these files. 1996-11-15 19:10:38 +00:00
gwr 786940dfb1 Remove comment that was no longer applicable. 1996-11-15 18:57:21 +00:00
gwr 13410f03ee As discussed some time ago, add a "show" sub-command.
Also allow compilation with -DSMALL to ommit support for
non-essential protocols (i.e. when built into a ramdisk).
Use a less hack-ish way to generate keywords.[ch] and just
check in the result (helps ../../distrib/utils/x_route).
1996-11-15 18:45:23 +00:00
gwr a54521537f As discussed some time ago, add a "show" sub-command.
Also allow compilation with -DSMALL to ommit support for
non-essential protocols (i.e. when built into a ramdisk).
Use a less hack-ish way to generate keywords.[ch] and just
check in the result (helps ../../distrib/utils/x_route).
1996-11-15 18:01:36 +00:00
cgd 4d54b9c567 check returns of inet_addr() and inet_network() against INADDR_NONE,
not -1, per the manual page.  on 64-bit systems like the alpha, -1 will
never equal (unsigned long)INADDR_NONE.
1996-04-15 18:27:05 +00:00
pk d7fa0b22af Produce less output on -q as promised by the man page (John Hawkinson; PR#998). 1996-01-07 00:07:23 +00:00
cgd 555d4b510e slightly clean rcs ids, etc. 1995-04-23 10:33:03 +00:00
mycroft 6f98502ae2 Interface-specific routes can be static. 1995-04-20 20:52:46 +00:00
mycroft 22ecc6ab1a Implement the document `-llinfo' flag. 1995-04-20 17:39:17 +00:00
cgd 5bc2528656 route.o, not route, depends on keywords.h. from jhawk@mit.edu; pr 978 1995-04-19 09:08:28 +00:00
mycroft 5b613aff01 Remove extra `break;'. 1995-04-18 03:14:18 +00:00
cgd 0114e805ce convert to new RCS Id conventions; reduce my headache 1995-03-18 14:54:19 +00:00
cgd b35dc8dfe1 kill some extraneous equal signs. 1994-12-24 11:07:28 +00:00
cgd 06e2955ff1 specify man pages the new way. 1994-12-22 10:44:04 +00:00
mycroft 4922d725cf Remove some more uses of obsolete functions. 1994-09-23 23:48:10 +00:00
mycroft ea7b5d4ec6 Eliminate uses of some obsolete functions. 1994-09-23 14:26:58 +00:00
cgd cca0652a0f don't need that 'all' line. 1994-05-20 08:58:22 +00:00
cgd 62561b3dc7 need dep. first 1994-05-13 21:24:15 +00:00
mycroft 4c8599d370 Clean up import. 1994-05-13 08:02:16 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
mycroft dfb9caab49 Add RCS indentifiers. 1993-08-01 07:32:48 +00:00
mycroft 1fb80e5b34 Add RCS identifiers. 1993-08-01 05:26:30 +00:00
mycroft 62d8a597f9 Reenable building keywords.h dynamically. 1993-04-25 07:50:56 +00:00
mycroft 2c35f5c582 Compile X.25, OSI, and NS code. 1993-04-25 07:26:40 +00:00
mycroft db1e3ba015 Cleanup for GCC 2. 1993-04-18 19:02:31 +00:00
cgd 06be60083d changed "Id" to "Header" for rcsids 1993-03-23 00:22:59 +00:00
cgd 346aa5dd48 added rcs ids to all files 1993-03-22 08:04:00 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00