summaryrefslogtreecommitdiff
path: root/sbin/route
AgeCommit message (Collapse)Author
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.
2016-09-01Display all route flags in "route get", "route show" and "netstat -r"Alexander Bluhm
output. Sort them according to the RTF_... defines in route.h. OK claudio@ mpi@
2016-08-31Remove unused RTF_MASK route flag.Alexander Bluhm
Requested by and OK mpi@
2016-08-26Add <time.h> for time() and ctime(); sort <net*/*.h>Philip Guenther
ok deraadt@
2016-07-13Introduce RTF_MULTICAST and flag corresponding IPv6 routes as suchMartin Pieuchot
instead of abusing RTF_CLONING. Fix a leak reporeted by Aaron Riekenberg on misc@, ok sthen@
2016-07-09only print one error, not multiple misleading messagesTed Unangst
2016-06-07per trending style, add continue to emtpy loop bodies.Ted Unangst
ok mglocker
2015-12-03Print the interface index which is part of the route msg header.Claudio Jeker
mpi@ and benno@ agree
2015-11-27After evaluating patches from Ricardo Mestre, it became obvious thatSebastian Benoit
route needs pledge("stdio rpath dns") in all cases. Looks best to me deraadt@
2015-11-20Replace hardcoded "0" with SHUT_RD; from Ricardo MestreJeremie Courreges-Anglas
2015-10-25route flush cannot pledge before sysctl for NET_RT_DUMP; defer the act.Theo de Raadt
issue spotted by matthieu
2015-10-24Removing xresolve from generating script has been forgotten.Alexander Bluhm
OK mpi@
2015-10-23route has 3 code paths: monitor (listening on route socket); showTheo de Raadt
(sysctl and then print), change (getsocket, then read/write on that). Refactor lightly and insert pledge "stdio rpath dns" in each case. ok claudio benno phessler
2015-09-11Remove RTF_XRESOLVE support.Martin Pieuchot
2015-07-18Make all commands accepting the "-priority" switch recognize aliasesMartin Pieuchot
for common priorities. ok deraadt@, claudio@
2015-07-18On systems with a full routing table (550k+), we often want to be able toPeter Hessler
look at the routes with a priority, or to display all routes that do not have a specific priority (normally, don't show bgp). We are intentionally not updating netstat -r yet, as we do not have a good flag to use. first version from, and OK benno@
2015-05-17nope, ioctl has not been used for a whileTheo de Raadt