summaryrefslogtreecommitdiff
path: root/sbin/route
AgeCommit message (Collapse)Author
2018-10-15Trust the resolver to give us a sockaddr_in6 sized objectFlorian Obser
if we ask for AF_INET6. OK kn, deraadt
2018-08-31Dont print "default" for "0.0.0.0" if it is a host route.YASUOKA Masahiko
diff from asou at soum.co.jp ok claudio kn
2018-08-30Fix "route add 0.0.0.0/0 <gateway>" to work properly. Shift countYASUOKA Masahiko
beyonds the integer width results undefined behavior in C spec. Actually the count is masked by 0x1f on amd64. Found by asou at soum.co.jp ok claudio kn schwarze
2018-08-09Drop support for guessing an old-style class A, B, or C netmask fromIngo Schwarze
a bare dot-notation IP address by counting trailing zero octets. Instead, assume -host when neither -net nor -netmask nor -prefixlen is given. Error out when -net is requested but no netmask is specified. This removes the last use of the IN_CLASS* macros from this program. OK claudio@ kn@, and many agreed with the general direction during g2k18.
2018-07-17stop assuming prefix lengths, remove inet6_makenetandmask()kn
This removes any logic that implies IPv6 destination host addresses to be /64 subnets so they are taken as is. RFC 3587 deprecated this in 2003 and our manual page actually states: The route is assumed to be to a network if any of the following apply to destination: * [...] * it is an IPv6 address with a “/XX” suffix (where XX is the number of bits in the network portion of the address and is less than 128) * [...] If destination is a valid IP address or host name, it is presumed to be a route to a host. Stripping relevant code from `inet6_makenetandmask()' left the function as dummy wrapper around `prefixlen()', so zap it completely. Discussed with and positive feedback from many, OK benno henning
2018-07-14Document that route monitor also takes -T rtable as an argument.Sebastian Benoit
2018-07-14Make route monitor display changes in all routing domains by forcingSebastian Benoit
the route filter to set RTABLE_ANY. Previously only the routing table/rdomain of the route process was displayed (that being the kernel default). ok kn@ claudio@ and henning@
2018-07-13no longer interpret 0.192.168.4 in hosts(5) as 192.168.4/24Ingo Schwarze
OK phessler@ claudio@ benno@ kn@ "steh' nicht rum, committe das" henning@
2018-07-13Use "rtable" not "tableid" as argument name for rtablekn
Make rtable(4) usage documentation consistent with other programs. This is to have `man -k ar~rtable' show the full list without having to look for other variations of the same argument type. OK bluhm
2018-07-12RTM_CHGADDRATTR for route monitorFlorian Obser
OK phessler, benno, claudio
2018-07-11Use AF_UNSPEC not 0kn
2018-07-10Error out if -netmask/-prefixlen does not follow the destination parameterkn
Since the address string comes last, `-prefixlen 56 2001:db8::' silently installs a route for /64 since that's the currently implied prefix length. The manual page already states that these options must follow the destination parameter in order to have any effect. Discussed at length with many OK benno sthen bluhm jca
2018-07-09Kill fluff about how route(8) is of limited usefulnessJeremie Courreges-Anglas
Don't say that route(8) is mostly useful to set up a default route, which is almost a lie. What's more, I'm not sure new users struggling with route(8) should be pointed to ripd(8) (sic) or bgpd(8) as a solution to their problems. ok benno@ kn@
2018-07-01Retire support for unused RTM_LOCK messages, it's redundant w/ RTM_CHANGE.Martin Pieuchot
ok tb@, sthen@
2018-06-18Replace hardcoded constants with defineskn
OK mpi henning blum
2018-06-04Zap unused sockaddr.kn
OK bluhm deraadt jca
2018-05-01The -d flag should be a no-op in monitor mode since it does not modifyFlorian Obser
the routing table. However, if -d is provided route monitor lists all interfaces and their associated addresses and exits. This is confusing, unexpected and no longer needed (if ever). Make -d a proper no-op for route monitor and get rid of the interfaces function which didn't use the correct sysctl idiom anyway. OK benno
2018-05-01Sync p_rttables() to netstat(1) version. Pointed out by claudio andFlorian Obser
mpi. Remaining differences are pledge and priority handling which only route(8) has. While here switch flushroutes to get_sysctl() function. OK benno
2018-04-30* simplify code by no longer calling getnetbyname(3)Ingo Schwarze
* avoid double lookups for unresolvable names without -net * more fitting error message for unresolvable names after -net OK florian@
2018-04-30tableid is either initialized to the current routing table or to theFlorian Obser
one specified by the T flag. No need to pass a flag around if the tableid is valid. It always is. This code is now in sync between flushroutes() and p_rttables(). OK benno, no objection claudio
2018-04-30No need to get the whole routing table from the kernel if we areFlorian Obser
filtering by address family and / or priority; similar to what p_rttables() is doing. (At the time of writing we need to copy about 150MB for the whole table on a router that is in the default free zone). OK benno
2018-04-30Fix route monitor -AF filter.Florian Obser
While here make and to see that this is correct and not touching any global state make af a local variable and pass it around. Input & OK benno
2018-04-28remove references to /etc/networks; reminded by jmc@Ingo Schwarze
2018-04-28Improve / simplify pledges.Florian Obser
1) after schwarze@'s rampage (thanks!) we can drop rpath since asr is no longer opening /etc/networks behind our back 2) we have the "route" pledge for the NET_RT_DUMP sysctl so we can pledge earlier in main; flushroutes() and p_rttables() now tighten the pledge instead of being the first pledge 3) the pledge in monitor() was just a repeat of the main() pledge, it can go. OK schwarze, deraadt
2018-01-16Recycle IFF_NOTRAILERS into IFF_STATICARP and document ownerhsipMartin Pieuchot
of IFF* flags. inputs from jmc@, ok bluhm@, visa@
2017-10-18Typo, from Hiltjo Posthuma.Martin Pieuchot
2017-10-17Do not print an extra line if the 'get' command succeeds.Martin Pieuchot
Fix a regression introduced in previous.
2017-10-16Print the correct message and return an error code when no route entryMartin Pieuchot
matches the corresponding RTM_GET request. Based on a submission from Julien Dhaille, ok bluhm@
2017-09-06backout previous diff:Sebastian Benoit
autodetect AF when setting inet6 default route From Denis Fondras, thanks! ok phessler@ bluhm@ it breaks with ipv6 link-local routes, e.g. /sbin/route -inet6 default -ifp pppoe0 fe80::%pppoe0 found by jmc@ ok florian
2017-08-11new sentence, new line;Jason McIntyre
2017-08-10document use of del as short form for delete, from jcaSebastian Benoit
ok schwarze@
2017-08-10autodetect AF when setting inet6 default routeSebastian Benoit
From Denis Fondras, thanks! ok phessler@ bluhm@
2017-08-10allow "del" in addition to "delete"Sebastian Benoit
from Denis Fondras, positive feedback from sthen@ and deraadt@ ok jca@
2017-07-10zap depend ghost.Marc Espie
add a comment explaining why keywords.h is in the source tree even though it's exactly what keywords.sh generates, so that people don't try adding the generating rule again. okay millert@
2017-06-12destroy lint remnants.Marc Espie
okay millert@ deraadt@
2017-03-23Fix printf() incantation for non-NULL terminated string.Kenneth R Westerback
Pointed out by florian@. ok bluhm@
2017-03-21getnameinfo errors should go to stderr & should print what's going on.Florian Obser
Pointed out by & ok bluhm While here print prefixlen with %u, pointed out by bluhm, too.
2017-03-20show inet6 proposals in route monitorFlorian Obser
fine with krw@
2017-03-02Implement a new routing message RTM_PROPOSAL that communicatesKenneth R Westerback
information that can be used to configure an interface and related network components. ok bluhm@, ok for various older versions mpi@ florian@ claudio@
2017-01-23Zap some bad whitespace.Kenneth R Westerback
2017-01-19add hooks so we can query the current state of a BFD sessionPeter Hessler
bfd session details are visible with "route -n get 192.0.2.1 -bfd" OK mpi@ deraadt@ claudio@
2017-01-17In monitor mode, also print the interface mtu of RTM_IFINFO messages.Jeremie Courreges-Anglas
ok deraadt@ millert@ mpi@
2017-01-01Hyphenate compound adjectives 'up-to-date', 'out-of-date' and 'well-known'Theo Buehler
if they precede the noun and omit hyphens otherwise. ok tj
2016-12-13Print the correct netmask instead of /0 when flushing routes to networks.Martin Pieuchot
Issue reported by jsing@, ok stsp@
2016-09-24print a BFD route message.Peter Hessler
protected with #ifdef BFD while we still figure out some of the mechanisms. OK mpi@
2016-09-15Add RTM_INVALIDATE as a route message, to keep the kernel and userlandPeter Hessler
lists in sync. OK mpi@
2016-09-05Print route labels in double quotes since they can contain spaces in the name.Claudio Jeker
OK florian@
2016-09-04Make it possible to set the RTF_BFD flag in a change request. Also add aClaudio Jeker
nobfd option to turn it off again. While here also print the fmask in the rtmsg dump so it is possible to figure out why something happens (or not). OK phessler@
2016-09-03Add userland parts for BFD. Can't work if you don't have it enabled inPeter Hessler
the kernel. OK claudio@, henning@
2016-09-01Fix previous commit that displays all route flags with "route get".Alexander Bluhm
The successor of octal 027 is 030 and not 028. Found by regress/sbin/route/rttest20.ok test.