summaryrefslogtreecommitdiff
path: root/sbin/route/show.c
AgeCommit message (Collapse)Author
2022-11-09ndp, route, netstat: adjust ipv6 address widthKlemens Nanni
It has been annoying me for too long that fully specififed GUAs (2001:0db8:3333:4444:5555:6666:7777:8888) mess up alignment. systat(1)'s netstat is the only view that has a big enough limit and thus never misaligns. Unify ndp(8), route(8) and netstat(1) views to always align nicely. Feedback OK claudio
2022-06-19There is no reason to print the RTF_DONE bit in the routing table output.Claudio Jeker
It is now set on all routes (and before it was never set). OK tb@ anton@
2021-01-30Don't print an empty line at the end of `route sourceaddr`Daniel Jakots
ok denis
2021-01-24Add missing __KAME__ markers.Florian Obser
OK claudio
2021-01-16Only recover the KAME embedded scope if the sin6_scope_id filed isClaudio Jeker
not initalized. If it is set assume that the scope was already recovered. This is required to get rid of all this scope madness in the long run. OK bluhm@ florian@
2020-10-29Add feature to force the selection of source IP addressdenis
Based/previous work on an idea from deraadt@ Input from claudio@, djm@, deraadt@, sthen@ OK deraadt@
2020-09-15"Route show" and "netstat -r" provide formatting for routing tables withpamela
sufficient space to display v4 addresses cleanly, but which truncate v6 addresses. The -n flag on each already provides additional column width for IPv6 addresses. Make this formatting the default. OK phessler kn
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-06-04Zap unused sockaddr.kn
OK bluhm deraadt jca
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-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
2016-12-13Print the correct netmask instead of /0 when flushing routes to networks.Martin Pieuchot
Issue reported by jsing@, ok stsp@
2016-09-05Print route labels in double quotes since they can contain spaces in the name.Claudio Jeker
OK florian@
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-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-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@
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-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-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-04-27route show does not need to filter unwanted af itself, the sysctl doesSebastian Benoit
that for us. approach seems sound deraadt@ ok claudio@ mpi@ henning@ phessler@
2015-02-06Remove route/netstat -f encap in favor of ipsecctl -s flow.Reyk Floeter
OK deraadt@
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-05-08Introduce two new route flags: RTF_LOCAL and RTF_BROADCAST.Martin Pieuchot
Nothing use them for the moment, but here is the plan: Since a route lookup is always necessary to output a packet it makes sense to store all the information regarding how the packet should be sent in the routing entry. This will save us some expensive lookups on address lists. But once we have all the information about our addresses in the routing table, we can even use it in the input path with the hope that the number of lookups in the forwarding case can be reduce to one. ok henning@, chris@
2014-04-17Sync show.c to what we have in netstat.c (at least steal some good idiomsClaudio Jeker
from there). OK sthen@ mpi@ jca@
2013-07-19Prep for WARNINGS=yes: add the prototypes that were missing, silencePhilip Guenther
a "signed vs unsigned in conditional" warning, and eliminate what looks like an unintentional variable shadowing. ok bluhm@
2013-03-21create realloc() loops around sysctl for array-based mibs, in programsTheo de Raadt
which want a "full" dump ok dlg
2012-12-04remove some unnecessary sys/mbuf.h inclusionsTheo de Raadt
2012-03-17remove IP_JUMBO, SO_JUMBO, and RTF_JUMBO.David Gwynne
no objection from mcbride@ krw@ markus@ deraadt@
2011-07-09rmove rotten netatalk bitsHenning Brauer
2010-10-11Make route(8) use the ROUTE_TABLEFILTER and change the code so thatClaudio Jeker
route(8) will default to the process rtableid. route -T 1 exec route add default 192.168.1.1 route -T 1 exec route -n show These commands will now operate outmatically on rtable 1 and not on rtable 0 as it was done before. OK henning@
2010-09-21Add '-label' to specify that you only want to see routes having theKenneth R Westerback
given label. No change to existing functionality. ok henning@ claudio@
2010-07-29Print a column with the routing label if "netstat -vr" or "routeAlexander Bluhm
-v show" are called with the -v switch. ok markus@
2010-05-19remove unused variablesCharles Longeau
ok claudio@ michele@
2010-03-23Add missing break, found while syncing with netstat/show.cClaudio Jeker
2010-03-23Print MPLS information in route -n get and do some cleanup in the show code.Claudio Jeker
OK michele@
2010-01-13netmask sockaddrs for the default route may set sa_len to 0 to indicateClaudio Jeker
a all zero mask. So check for this condition as well since else we read garbage that comes after the netmask sockaddr (which is the IFP normaly). Found by todd@, OK dlg@
2010-01-11"default" routes need a mask of 0 too.David Gwynne
from and ok claudio@
2009-08-07if buffers overlap; result will be undefined. ok claudio@, michele@Martynas Venckus
2009-06-27Mark MPLS routes with T (tagged) in route output.Michele Marchetto
suggested by dlg@, ok claudio@, laurent@, blambert@
2009-05-31Masking the priority with RTP_MASK is no longer needed in userland.Claudio Jeker
Kernel will do this now.
2009-05-23missed rtm_hdrlen conversion in one placeChris Cappuccio
ok claudio@
2009-04-28Sync with kernel changes.Michele Marchetto
Add support to route(8) for a new dummy operation to allow packets coming in with a particular label to leave the MPLS cloud and join ipv4/ipv6 stack. ok claudio@ laurent@
2009-02-03Reflect MPLS kernel changes. Operations are stored now in rt_mpls field.Michele Marchetto
ok claudio@ laurent@
2009-01-26Mark multipath routes with P in the show command flags. Bummer that bothClaudio Jeker
M and m were already taken. OK henning@
2009-01-08Reflect MPLS kernel changes.Michele Marchetto
ok claudio@
2008-12-15Reflect kernel changes. Labels are no more per link uniqueMichele Marchetto
and operations are now stored in rt_flags. This also simplify a lot the syntax. ok claudio@ laurent@
2008-12-12Use the hdrlen to skip over the header and to the sockaddrs instead of theClaudio Jeker
implied sizeof(struct rt_msghdr). Makes code more robust when userland and kernel are out of sync.