OpenBSD CVS

CVS log for src/sbin/route/show.c


[BACK] Up to [local] / src / sbin / route

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.122 / (download) - annotate - [select for diffs], Wed Mar 15 08:42:14 2023 UTC (14 months, 2 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.121: +20 -12 lines
Diff to previous 1.121 (colored)

Make route sourceaddr always print the used addresses for inet and inet6.
Print 'default' if no sourceaddr is set and the default algorithm is used.
With and OK kn@ deraadt@

Revision 1.121 / (download) - annotate - [select for diffs], Wed Nov 9 18:00:02 2022 UTC (18 months, 3 weeks ago) by kn
Branch: MAIN
Changes since 1.120: +5 -4 lines
Diff to previous 1.120 (colored)

ndp, route, netstat: adjust ipv6 address width

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

Revision 1.120 / (download) - annotate - [select for diffs], Sun Jun 19 13:59:22 2022 UTC (23 months, 1 week ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.119: +1 -2 lines
Diff to previous 1.119 (colored)

There is no reason to print the RTF_DONE bit in the routing table output.
It is now set on all routes (and before it was never set).
OK tb@ anton@

Revision 1.119 / (download) - annotate - [select for diffs], Sat Jan 30 22:00:06 2021 UTC (3 years, 4 months ago) by danj
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.118: +1 -2 lines
Diff to previous 1.118 (colored)

Don't print an empty line at the end of `route sourceaddr`

ok denis

Revision 1.118 / (download) - annotate - [select for diffs], Sun Jan 24 08:58:50 2021 UTC (3 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.117: +5 -1 lines
Diff to previous 1.117 (colored)

Add missing __KAME__ markers.
OK claudio

Revision 1.117 / (download) - annotate - [select for diffs], Sat Jan 16 17:41:20 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.116: +4 -3 lines
Diff to previous 1.116 (colored)

Only recover the KAME embedded scope if the sin6_scope_id filed is
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@

Revision 1.116 / (download) - annotate - [select for diffs], Thu Oct 29 21:15:26 2020 UTC (3 years, 7 months ago) by denis
Branch: MAIN
Changes since 1.115: +51 -1 lines
Diff to previous 1.115 (colored)

Add feature to force the selection of source IP address

Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@

OK deraadt@

Revision 1.115 / (download) - annotate - [select for diffs], Tue Sep 15 20:28:27 2020 UTC (3 years, 8 months ago) by pamela
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.114: +10 -18 lines
Diff to previous 1.114 (colored)

"Route show" and "netstat -r" provide formatting for routing tables with
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

Revision 1.114 / (download) - annotate - [select for diffs], Fri Aug 31 15:18:02 2018 UTC (5 years, 9 months ago) by yasuoka
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.113: +1 -3 lines
Diff to previous 1.113 (colored)

Dont print "default" for "0.0.0.0" if it is a host route.
diff from asou at soum.co.jp

ok claudio kn

Revision 1.113 / (download) - annotate - [select for diffs], Mon Jun 4 19:17:37 2018 UTC (5 years, 11 months ago) by kn
Branch: MAIN
Changes since 1.112: +1 -3 lines
Diff to previous 1.112 (colored)

Zap unused sockaddr.

OK bluhm deraadt jca

Revision 1.112 / (download) - annotate - [select for diffs], Tue May 1 18:13:21 2018 UTC (6 years, 1 month ago) by florian
Branch: MAIN
Changes since 1.111: +29 -19 lines
Diff to previous 1.111 (colored)

Sync p_rttables() to netstat(1) version. Pointed out by claudio and
mpi.

Remaining differences are pledge and priority handling which only
route(8) has.

While here switch flushroutes to get_sysctl() function.
OK benno

Revision 1.111 / (download) - annotate - [select for diffs], Mon Apr 30 15:06:18 2018 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.110: +6 -9 lines
Diff to previous 1.110 (colored)

* simplify code by no longer calling getnetbyname(3)
* avoid double lookups for unresolvable names without -net
* more fitting error message for unresolvable names after -net
OK florian@

Revision 1.110 / (download) - annotate - [select for diffs], Mon Apr 30 10:32:02 2018 UTC (6 years, 1 month ago) by florian
Branch: MAIN
Changes since 1.109: +6 -10 lines
Diff to previous 1.109 (colored)

tableid is either initialized to the current routing table or to the
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

Revision 1.109 / (download) - annotate - [select for diffs], Sat Apr 28 18:53:12 2018 UTC (6 years, 1 month ago) by florian
Branch: MAIN
Changes since 1.108: +2 -2 lines
Diff to previous 1.108 (colored)

Improve / simplify pledges.

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

Revision 1.108 / (download) - annotate - [select for diffs], Tue Dec 13 08:40:54 2016 UTC (7 years, 5 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.107: +2 -3 lines
Diff to previous 1.107 (colored)

Print the correct netmask instead of /0 when flushing routes to networks.

Issue reported by jsing@, ok stsp@

Revision 1.107 / (download) - annotate - [select for diffs], Mon Sep 5 14:23:38 2016 UTC (7 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.106: +4 -5 lines
Diff to previous 1.106 (colored)

Print route labels in double quotes since they can contain spaces in the name.
OK florian@

Revision 1.106 / (download) - annotate - [select for diffs], Sat Sep 3 14:23:14 2016 UTC (7 years, 8 months ago) by phessler
Branch: MAIN
Changes since 1.105: +2 -1 lines
Diff to previous 1.105 (colored)

Add userland parts for BFD.  Can't work if you don't have it enabled in
the kernel.

OK claudio@, henning@

Revision 1.105 / (download) - annotate - [select for diffs], Thu Sep 1 09:41:34 2016 UTC (7 years, 9 months ago) by bluhm
Branch: MAIN
Changes since 1.104: +7 -5 lines
Diff to previous 1.104 (colored)

Display all route flags in "route get", "route show" and "netstat -r"
output.  Sort them according to the RTF_... defines in route.h.
OK claudio@ mpi@

Revision 1.104 / (download) - annotate - [select for diffs], Wed Jul 13 08:40:46 2016 UTC (7 years, 10 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.103: +2 -2 lines
Diff to previous 1.103 (colored)

Introduce RTF_MULTICAST and flag corresponding IPv6 routes as such
instead of abusing RTF_CLONING.

Fix a leak reporeted by Aaron Riekenberg on misc@, ok sthen@

Revision 1.103 / (download) - annotate - [select for diffs], Fri Nov 27 16:26:52 2015 UTC (8 years, 6 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.102: +3 -8 lines
Diff to previous 1.102 (colored)

After evaluating patches from Ricardo Mestre, it became obvious that
route needs pledge("stdio rpath dns") in all cases.
Looks best to me deraadt@

Revision 1.102 / (download) - annotate - [select for diffs], Fri Oct 23 15:03:25 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.101: +9 -1 lines
Diff to previous 1.101 (colored)

route has 3 code paths: monitor (listening on route socket); show
(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

Revision 1.101 / (download) - annotate - [select for diffs], Fri Sep 11 20:08:40 2015 UTC (8 years, 8 months ago) by mpi
Branch: MAIN
Changes since 1.100: +1 -2 lines
Diff to previous 1.100 (colored)

Remove RTF_XRESOLVE support.

Revision 1.100 / (download) - annotate - [select for diffs], Sat Jul 18 00:05:02 2015 UTC (8 years, 10 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.99: +3 -3 lines
Diff to previous 1.99 (colored)

On systems with a full routing table (550k+), we often want to be able to
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@

Revision 1.99 / (download) - annotate - [select for diffs], Mon Apr 27 09:51:58 2015 UTC (9 years, 1 month ago) by benno
Branch: MAIN
Changes since 1.98: +1 -3 lines
Diff to previous 1.98 (colored)

route show does not need to filter unwanted af itself, the sysctl does
that for us.
approach seems sound deraadt@
ok claudio@ mpi@ henning@ phessler@

Revision 1.98 / (download) - annotate - [select for diffs], Fri Feb 6 03:22:00 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.97: +1 -232 lines
Diff to previous 1.97 (colored)

Remove route/netstat -f encap in favor of ipsecctl -s flow.

OK deraadt@

Revision 1.97 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:00 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.96: +4 -4 lines
Diff to previous 1.96 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
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)

Revision 1.96 / (download) - annotate - [select for diffs], Thu May 8 09:28:08 2014 UTC (10 years ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.95: +3 -1 lines
Diff to previous 1.95 (colored)

Introduce two new route flags: RTF_LOCAL and RTF_BROADCAST.

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@

Revision 1.95 / (download) - annotate - [select for diffs], Thu Apr 17 15:35:35 2014 UTC (10 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.94: +16 -18 lines
Diff to previous 1.94 (colored)

Sync show.c to what we have in netstat.c (at least steal some good idioms
from there). OK sthen@ mpi@ jca@

Revision 1.94 / (download) - annotate - [select for diffs], Fri Jul 19 20:10:23 2013 UTC (10 years, 10 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.93: +6 -3 lines
Diff to previous 1.93 (colored)

Prep for WARNINGS=yes: add the prototypes that were missing, silence
a "signed vs unsigned in conditional" warning, and eliminate what
looks like an unintentional variable shadowing.

ok bluhm@

Revision 1.93 / (download) - annotate - [select for diffs], Thu Mar 21 04:43:17 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.92: +13 -7 lines
Diff to previous 1.92 (colored)

create realloc() loops around sysctl for array-based mibs, in programs
which want a "full" dump
ok dlg

Revision 1.92 / (download) - annotate - [select for diffs], Tue Dec 4 02:30:33 2012 UTC (11 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.91: +1 -2 lines
Diff to previous 1.91 (colored)

remove some unnecessary sys/mbuf.h inclusions

Revision 1.91 / (download) - annotate - [select for diffs], Sat Mar 17 10:16:40 2012 UTC (12 years, 2 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.90: +1 -2 lines
Diff to previous 1.90 (colored)

remove IP_JUMBO, SO_JUMBO, and RTF_JUMBO.

no objection from mcbride@ krw@ markus@ deraadt@

Revision 1.90 / (download) - annotate - [select for diffs], Sat Jul 9 00:45:40 2011 UTC (12 years, 10 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.89: +1 -4 lines
Diff to previous 1.89 (colored)

rmove rotten netatalk bits

Revision 1.89 / (download) - annotate - [select for diffs], Mon Oct 11 11:45:00 2010 UTC (13 years, 7 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.88: +10 -6 lines
Diff to previous 1.88 (colored)

Make route(8) use the ROUTE_TABLEFILTER and change the code so that
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@

Revision 1.88 / (download) - annotate - [select for diffs], Tue Sep 21 10:58:23 2010 UTC (13 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.87: +14 -1 lines
Diff to previous 1.87 (colored)

Add '-label' to specify that you only want to see routes having the
given label. No change to existing functionality.

ok henning@ claudio@

Revision 1.87 / (download) - annotate - [select for diffs], Thu Jul 29 16:35:40 2010 UTC (13 years, 10 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.86: +10 -3 lines
Diff to previous 1.86 (colored)

Print a column with the routing label if "netstat -vr" or "route
-v show" are called with the -v switch.
ok markus@

Revision 1.86 / (download) - annotate - [select for diffs], Wed May 19 13:07:15 2010 UTC (14 years ago) by chl
Branch: MAIN
Changes since 1.85: +1 -3 lines
Diff to previous 1.85 (colored)

remove unused variables

ok claudio@ michele@

Revision 1.85 / (download) - annotate - [select for diffs], Tue Mar 23 15:08:51 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.84: +2 -1 lines
Diff to previous 1.84 (colored)

Add missing break, found while syncing with netstat/show.c

Revision 1.84 / (download) - annotate - [select for diffs], Tue Mar 23 15:01:50 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.83: +23 -42 lines
Diff to previous 1.83 (colored)

Print MPLS information in route -n get and do some cleanup in the show code.
OK michele@

Revision 1.83 / (download) - annotate - [select for diffs], Wed Jan 13 23:49:06 2010 UTC (14 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.82: +2 -2 lines
Diff to previous 1.82 (colored)

netmask sockaddrs for the default route may set sa_len to 0 to indicate
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@

Revision 1.82 / (download) - annotate - [select for diffs], Mon Jan 11 08:26:29 2010 UTC (14 years, 4 months ago) by dlg
Branch: MAIN
Changes since 1.81: +1 -1 lines
Diff to previous 1.81 (colored)

"default" routes need a mask of 0 too.

from and ok claudio@

Revision 1.81 / (download) - annotate - [select for diffs], Fri Aug 7 09:09:31 2009 UTC (14 years, 9 months ago) by martynas
Branch: MAIN
Changes since 1.80: +4 -4 lines
Diff to previous 1.80 (colored)

if buffers overlap;  result will be undefined.  ok claudio@, michele@

Revision 1.80 / (download) - annotate - [select for diffs], Sat Jun 27 11:35:57 2009 UTC (14 years, 11 months ago) by michele
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.79: +2 -1 lines
Diff to previous 1.79 (colored)

Mark MPLS routes with T (tagged) in route output.

suggested by dlg@, ok claudio@, laurent@, blambert@

Revision 1.79 / (download) - annotate - [select for diffs], Sun May 31 18:02:28 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

Masking the priority with RTP_MASK is no longer needed in userland.
Kernel will do this now.

Revision 1.78 / (download) - annotate - [select for diffs], Sat May 23 16:44:12 2009 UTC (15 years ago) by chris
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

missed rtm_hdrlen conversion in one place

ok claudio@

Revision 1.77 / (download) - annotate - [select for diffs], Tue Apr 28 12:09:35 2009 UTC (15 years, 1 month ago) by michele
Branch: MAIN
Changes since 1.76: +4 -2 lines
Diff to previous 1.76 (colored)

Sync with kernel changes.
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@

Revision 1.76 / (download) - annotate - [select for diffs], Tue Feb 3 16:44:15 2009 UTC (15 years, 4 months ago) by michele
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.75: +2 -2 lines
Diff to previous 1.75 (colored)

Reflect MPLS kernel changes. Operations are stored now in rt_mpls field.

ok claudio@ laurent@

Revision 1.75 / (download) - annotate - [select for diffs], Mon Jan 26 17:18:47 2009 UTC (15 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.74: +2 -1 lines
Diff to previous 1.74 (colored)

Mark multipath routes with P in the show command flags. Bummer that both
M and m were already taken. OK henning@

Revision 1.74 / (download) - annotate - [select for diffs], Thu Jan 8 12:52:36 2009 UTC (15 years, 4 months ago) by michele
Branch: MAIN
Changes since 1.73: +43 -22 lines
Diff to previous 1.73 (colored)

Reflect MPLS kernel changes.

ok claudio@

Revision 1.73 / (download) - annotate - [select for diffs], Mon Dec 15 16:14:57 2008 UTC (15 years, 5 months ago) by michele
Branch: MAIN
Changes since 1.72: +19 -10 lines
Diff to previous 1.72 (colored)

Reflect kernel changes. Labels are no more per link unique
and operations are now stored in rt_flags.
This also simplify a lot the syntax.

ok claudio@ laurent@

Revision 1.72 / (download) - annotate - [select for diffs], Fri Dec 12 20:26:30 2008 UTC (15 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

Use the hdrlen to skip over the header and to the sockaddrs instead of the
implied sizeof(struct rt_msghdr). Makes code more robust when userland and
kernel are out of sync.

Revision 1.71 / (download) - annotate - [select for diffs], Mon Sep 15 20:12:11 2008 UTC (15 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

Mask rtm->rtm_priority with RTP_MASK before printing so that the priority is
correctly shown even if the route is flagged RTP_DOWN. OK henning@

Revision 1.70 / (download) - annotate - [select for diffs], Sun May 25 17:57:42 2008 UTC (16 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.69: +1 -2 lines
Diff to previous 1.69 (colored)

do not need sys/protosw.h

Revision 1.69 / (download) - annotate - [select for diffs], Thu May 8 07:10:51 2008 UTC (16 years ago) by claudio
Branch: MAIN
Changes since 1.68: +2 -2 lines
Diff to previous 1.68 (colored)

space

Revision 1.68 / (download) - annotate - [select for diffs], Thu May 8 06:13:09 2008 UTC (16 years ago) by norby
Branch: MAIN
Changes since 1.67: +8 -9 lines
Diff to previous 1.67 (colored)

Fix fallout from the route priority thing.

Don't display out label interface in the second column.

ok claudio@

Revision 1.67 / (download) - annotate - [select for diffs], Thu May 8 05:41:59 2008 UTC (16 years ago) by norby
Branch: MAIN
Changes since 1.66: +3 -2 lines
Diff to previous 1.66 (colored)

Don't display the outlabel and interface for POP operations.

ok claudio@

Revision 1.66 / (download) - annotate - [select for diffs], Wed May 7 06:06:25 2008 UTC (16 years ago) by claudio
Branch: MAIN
Changes since 1.65: +9 -7 lines
Diff to previous 1.65 (colored)

Add support to show and modify rtm_priority.

Revision 1.65 / (download) - annotate - [select for diffs], Tue May 6 03:44:14 2008 UTC (16 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.64: +5 -3 lines
Diff to previous 1.64 (colored)

Labels in the sockaddr are stored like on the wire so shift and byte swap
them. This makes route lookups work again. OK norby@

Revision 1.64 / (download) - annotate - [select for diffs], Tue May 6 03:39:09 2008 UTC (16 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.63: +2 -3 lines
Diff to previous 1.63 (colored)

Minor cleanup. OK norby@

Revision 1.63 / (download) - annotate - [select for diffs], Wed Apr 30 12:43:23 2008 UTC (16 years, 1 month ago) by norby
Branch: MAIN
Changes since 1.62: +23 -2 lines
Diff to previous 1.62 (colored)

Correct MPLS output of route -n show.

ok claudio@

Revision 1.62 / (download) - annotate - [select for diffs], Mon Apr 28 11:36:14 2008 UTC (16 years, 1 month ago) by norby
Branch: MAIN
Changes since 1.61: +68 -10 lines
Diff to previous 1.61 (colored)

It is now possible to enter static MPLS routes into the kernel.

It is still not possible to set the desired opration for an entry.

ok claudio@ laurent@ dlg@

Revision 1.61 / (download) - annotate - [select for diffs], Wed Sep 5 20:30:21 2007 UTC (16 years, 9 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored)

Correct the format strings after the recent rt_metrics changes.
rmx_pksent is not u_int64_t all others are just u_int.
This is almost the same as in usr.bin/netstat.

Revision 1.60 / (download) - annotate - [select for diffs], Tue Jul 24 20:22:23 2007 UTC (16 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.59: +6 -10 lines
Diff to previous 1.59 (colored)

Sync closer to netstat/show.c this removes also the unneeded variable
noticed by Igor Zinovik.

Revision 1.59 / (download) - annotate - [select for diffs], Sat Jul 21 15:43:01 2007 UTC (16 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.58: +3 -1 lines
Diff to previous 1.58 (colored)

Check the rtm_version before trying to print an entry. If the rtmsg has a
different version skip it and don't try to print it. Solves a SIGSEGV I have
triggered with one of my scarier diffs.  OK henning@

Revision 1.58 / (download) - annotate - [select for diffs], Mon Jun 4 12:23:44 2007 UTC (17 years ago) by henning
Branch: MAIN
Changes since 1.57: +1 -63 lines
Diff to previous 1.57 (colored)

remove IPX, agreed by many
libc and kernel side awaiting a libc major bump to piggyback to

Revision 1.57 / (download) - annotate - [select for diffs], Fri Mar 23 16:02:26 2007 UTC (17 years, 2 months ago) by pyr
Branch: MAIN
Changes since 1.56: +6 -2 lines
Diff to previous 1.56 (colored)

Add a new flag -F to netstat restricting route display in conjuction
with -r to routes in the same address family as the destination.
ok henning@, claudio@

Revision 1.56 / (download) - annotate - [select for diffs], Fri Dec 29 10:04:36 2006 UTC (17 years, 5 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

Route warns about a illegal prefixlen when a default inet6 route is present.
Need to typecast the sizeof() to int so that the compare works. Having a
negativ lim is OK.  Reported by Björn Ketelaars. OK deraadt@

Revision 1.55 / (download) - annotate - [select for diffs], Fri Nov 17 01:11:23 2006 UTC (17 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.54: +5 -3 lines
Diff to previous 1.54 (colored)

change semantics of ff01::/16 to interface local multicast
(to sync up with more recent IPv6 spec)

ok from: deraadt mcbride

Revision 1.54 / (download) - annotate - [select for diffs], Fri Jun 16 17:46:43 2006 UTC (17 years, 11 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.53: +7 -5 lines
Diff to previous 1.53 (colored)

make route show work on secondary tables, using the just committed
extension to the syctl NET_RT_DUMP interface, claudio ok

Revision 1.53 / (download) - annotate - [select for diffs], Tue May 30 19:42:58 2006 UTC (18 years ago) by todd
Branch: MAIN
Changes since 1.52: +10 -9 lines
Diff to previous 1.52 (colored)

this fixes a crash observed by Naddy on amd64, and permits the src/dst ip's to
be visible .. when IPv6 sa flows are present
ok claudio@

Revision 1.52 / (download) - annotate - [select for diffs], Sat May 27 18:26:45 2006 UTC (18 years ago) by claudio
Branch: MAIN
Changes since 1.51: +9 -11 lines
Diff to previous 1.51 (colored)

Kill unused Aflag support that sneeked in via netstat code.

Revision 1.51 / (download) - annotate - [select for diffs], Sat May 27 18:20:59 2006 UTC (18 years ago) by claudio
Branch: MAIN
Changes since 1.50: +6 -2 lines
Diff to previous 1.50 (colored)

Do not print an error in case of ENOPROTOOPT. Install medias do not have
IPSec support and so will print a "route: spd-sysctl-estimate: Protocol not
available" on upgrades. Requested and ok deraadt@

Revision 1.50 / (download) - annotate - [select for diffs], Fri Mar 31 15:56:25 2006 UTC (18 years, 2 months ago) by hshoexer
Branch: MAIN
Changes since 1.49: +18 -3 lines
Diff to previous 1.49 (colored)

Be careful when accessing the external destination address, as it is not set
for bypass and deny flows.
Also display acquire/dontacquire flows.

ok henning@

Revision 1.49 / (download) - annotate - [select for diffs], Thu Mar 30 13:58:30 2006 UTC (18 years, 2 months ago) by hshoexer
Branch: MAIN
Changes since 1.48: +4 -4 lines
Diff to previous 1.48 (colored)

Print the "Encap" heading only when the sadb is not empty.
Fix identation (was off by one space).

both requested and ok markus@

Revision 1.48 / (download) - annotate - [select for diffs], Thu Mar 30 12:11:37 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.47: +4 -1 lines
Diff to previous 1.47 (colored)

If an address family is specified do not print IPSec "routes". Additionally
add a -encap option to show only the IPSec part. OK hshoexer@, henning@

Revision 1.47 / (download) - annotate - [select for diffs], Thu Mar 30 09:57:35 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.46: +15 -16 lines
Diff to previous 1.46 (colored)

Minor cleanup and start using rmx_refcnt to show the refcount instead of 0.
OK henning@

Revision 1.46 / (download) - annotate - [select for diffs], Wed Mar 29 20:21:45 2006 UTC (18 years, 2 months ago) by hshoexer
Branch: MAIN
Changes since 1.45: +209 -2 lines
Diff to previous 1.45 (colored)

Use sysctl to get information about encap routes (aka ipsec).  Now
you see something actually useful...

requested by and ok henning@

Revision 1.45 / (download) - annotate - [select for diffs], Thu Mar 23 13:38:27 2006 UTC (18 years, 2 months ago) by mcbride
Branch: MAIN
Changes since 1.44: +2 -1 lines
Diff to previous 1.44 (colored)

Fix pretty-print of carp link addresses by making them print like IFT_ETHER.

Diff from jon@abccomm.com

Revision 1.44 / (download) - annotate - [select for diffs], Wed Feb 1 19:00:22 2006 UTC (18 years, 4 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

double semicolon; from Daniel Matic in PR 4929

Revision 1.43 / (download) - annotate - [select for diffs], Fri May 27 04:55:27 2005 UTC (19 years ago) by mcbride
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.42: +2 -1 lines
Diff to previous 1.42 (colored)

Experimental support for opportunitic use of jumbograms where only some hosts
on the local network support them.

This adds a new socket option, SO_JUMBO, and a new route flag,
RTF_JUMBO. If _both_ the socket option is set and the route for the host
has RTF_JUMBO set, ip_output will fragment the packet to the largest
possible size for the link, ignoring the card's MTU.

The semantics of this feature will be evolving rapidly; talk to us
if you intend to use it.

ok deraadt@ marius@

Revision 1.42 / (download) - annotate - [select for diffs], Wed Mar 30 05:40:55 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.41: +7 -15 lines
Diff to previous 1.41 (colored)

more bitrot bites the dust

Revision 1.41 / (download) - annotate - [select for diffs], Wed Mar 30 05:34:30 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.40: +8 -34 lines
Diff to previous 1.40 (colored)

unconditionalize INET6 support, no binary change

Revision 1.40 / (download) - annotate - [select for diffs], Fri Feb 18 04:00:21 2005 UTC (19 years, 3 months ago) by jaredy
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.39: +47 -50 lines
Diff to previous 1.39 (colored)

ansi, knf, and other style nits; ok henning

Revision 1.39 / (download) - annotate - [select for diffs], Wed Nov 17 01:47:20 2004 UTC (19 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.38: +2 -10 lines
Diff to previous 1.38 (colored)

remove NI_WITHSCOPEID (which is not standard)

Revision 1.38 / (download) - annotate - [select for diffs], Thu Oct 14 15:20:56 2004 UTC (19 years, 7 months ago) by jaredy
Branch: MAIN
Changes since 1.37: +11 -8 lines
Diff to previous 1.37 (colored)

avoid collision of variable "err" with err()
use errx() after strlcpy if out of space
style nits/knf

ok henning hshoexer

Revision 1.37 / (download) - annotate - [select for diffs], Fri Sep 24 01:24:30 2004 UTC (19 years, 8 months ago) by jaredy
Branch: MAIN
Changes since 1.36: +10 -15 lines
Diff to previous 1.36 (colored)

kill homegrown quit(); use err()/errx() instead
make other error messages consistent
sync usage

ok henning

Revision 1.36 / (download) - annotate - [select for diffs], Wed Sep 22 01:07:10 2004 UTC (19 years, 8 months ago) by jaredy
Branch: MAIN
Changes since 1.35: +14 -33 lines
Diff to previous 1.35 (colored)

remove -S, -src, -srcmask, and other source routing stuff.  ok henning

Revision 1.35 / (download) - annotate - [select for diffs], Tue Sep 21 02:45:52 2004 UTC (19 years, 8 months ago) by jaredy
Branch: MAIN
Changes since 1.34: +12 -2 lines
Diff to previous 1.34 (colored)

print route labels in monitor mode.  ok henning

Revision 1.34 / (download) - annotate - [select for diffs], Wed Sep 15 23:41:42 2004 UTC (19 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.33: +2 -14 lines
Diff to previous 1.33 (colored)

unused functions

Revision 1.33 / (download) - annotate - [select for diffs], Mon Jul 5 02:19:03 2004 UTC (19 years, 11 months ago) by pvalchev
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

fix warning: extra tokens at end of #undef; ok henning

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jun 25 01:26:01 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.31: +2 -69 lines
Diff to previous 1.31 (colored)

remove netiso and netns code

Revision 1.31 / (download) - annotate - [select for diffs], Wed Jun 16 11:47:35 2004 UTC (19 years, 11 months ago) by cedric
Branch: MAIN
Changes since 1.30: +5 -5 lines
Diff to previous 1.30 (colored)

Fix -S flag with new show code. ok claudio@

Revision 1.30 / (download) - annotate - [select for diffs], Tue Jun 15 17:10:32 2004 UTC (19 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.29: +7 -6 lines
Diff to previous 1.29 (colored)

Cleanup last commit here:
- pass netname4() a struct sockaddr_in * and check it for NULL
- netname6() already deals with NULL mask so remove unneeded check in netname()
OK deraadt@

Revision 1.29 / (download) - annotate - [select for diffs], Tue Jun 15 16:55:38 2004 UTC (19 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.28: +4 -4 lines
Diff to previous 1.28 (colored)

do not crash on 'route flush'

Revision 1.28 / (download) - annotate - [select for diffs], Sat Jun 12 09:40:49 2004 UTC (19 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.27: +586 -216 lines
Diff to previous 1.27 (colored)

Make route show output similar to netstat -r output.
OK cedric@ millert@

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jun 6 17:08:23 2004 UTC (20 years ago) by cedric
Branch: MAIN
Changes since 1.26: +34 -13 lines
Diff to previous 1.26 (colored)

add new "-src" and "-srcmask" modifiers to make it possible to add a source
selector part to the routing table entry. complements existing "-dst" and
"-dstmask". typical use:

   route add -src 20.20.20.22 20.20.20.21
   route add -src 192.168.1.0/24 -dst 192.168.2.0/24 20.20.20.21

useful for example to implement symetrical routing on multihomed boxes,
or to better select which packets to send to gif/tun/... tunnels.
new '-S' flag similar to netstat one. ok deraadt@ mcbride@

Revision 1.26 / (download) - annotate - [select for diffs], Tue Aug 26 08:33:12 2003 UTC (20 years, 9 months ago) by itojun
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.25: +5 -3 lines
Diff to previous 1.25 (colored)

mark cloned route with RTF_CLONED.  remove RTF_CLONED route when clone parent
disappers.  deraadt ok

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jul 2 21:44:58 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.24: +3 -2 lines
Diff to previous 1.24 (colored)

missing protos

Revision 1.24 / (download) - annotate - [select for diffs], Thu Jun 26 16:35:21 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.23: +3 -5 lines
Diff to previous 1.23 (colored)

ansi and protos

Revision 1.23 / (download) - annotate - [select for diffs], Mon Jun 2 20:06:16 2003 UTC (21 years ago) by millert
Branch: MAIN
Changes since 1.22: +3 -7 lines
Diff to previous 1.22 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Mar 13 09:09:27 2003 UTC (21 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.21: +47 -24 lines
Diff to previous 1.21 (colored)

lots of sprintf -> snprintf and strcpy -> strlcpy; checked by tedu

Revision 1.21 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:37 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.20: +10 -10 lines
Diff to previous 1.20 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Jul 7 18:26:20 2001 UTC (22 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.19: +6 -3 lines
Diff to previous 1.19 (colored)

major -Wall cleanup, almost complete

Revision 1.19 / (download) - annotate - [select for diffs], Wed Nov 15 01:45:48 2000 UTC (23 years, 6 months ago) by angelos
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.18: +42 -3 lines
Diff to previous 1.18 (colored)

Accept -inet/-inet6 etc. in route show command.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Sep 24 01:02:24 2000 UTC (23 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.17: +13 -13 lines
Diff to previous 1.17 (colored)

If the route add/delete fails exit w/ 1 instead of 0
Remove register decls and make return foo vs. return (foo) consistent.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jul 27 20:12:25 2000 UTC (23 years, 10 months ago) by angelos
Branch: MAIN
Changes since 1.16: +3 -97 lines
Diff to previous 1.16 (colored)

Don't show or delete IPsec flows with the route command -- this was a
kludge to begin with, and it's about time we get rid of it.

Revision 1.16 / (download) - annotate - [select for diffs], Fri Jan 14 19:59:17 2000 UTC (24 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.15: +3 -2 lines
Diff to previous 1.15 (colored)

show blackhole flag; ura@hiru.aoba.yokohama.jp

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jan 10 01:35:06 2000 UTC (24 years, 4 months ago) by angelos
Branch: MAIN
Changes since 1.14: +19 -11 lines
Diff to previous 1.14 (colored)

Handle wildcard case better.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jan 10 01:04:20 2000 UTC (24 years, 4 months ago) by angelos
Branch: MAIN
Changes since 1.13: +24 -7 lines
Diff to previous 1.13 (colored)

Change format of IPsec flows (yet again).

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jan 10 00:54:35 2000 UTC (24 years, 4 months ago) by angelos
Branch: MAIN
Changes since 1.12: +9 -8 lines
Diff to previous 1.12 (colored)

Fix printing SAs.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jan 9 23:00:13 2000 UTC (24 years, 4 months ago) by angelos
Branch: MAIN
Changes since 1.11: +5 -5 lines
Diff to previous 1.11 (colored)

Transport ports are in network order.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Dec 20 07:45:09 1999 UTC (24 years, 5 months ago) by angelos
Branch: MAIN
Changes since 1.10: +41 -29 lines
Diff to previous 1.10 (colored)

Add support for printing IPv6 addresses in IPsec flows. Formatting is
just plain ugly, given the possible length variances of addresses now;
a better display method is needed.

Also, netmasks are no longer printed for either IPv4 or IPv6 IPsec
flows (they are not printed in the other protocols display either).

Revision 1.10 / (download) - annotate - [select for diffs], Wed Dec 8 07:55:54 1999 UTC (24 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.9: +22 -2 lines
Diff to previous 1.9 (colored)

ipv6 support from KAME (needs no libc upgrade).  regen keywords.[ch].

Revision 1.9 / (download) - annotate - [select for diffs], Wed Sep 22 05:10:04 1999 UTC (24 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.8: +7 -5 lines
Diff to previous 1.8 (colored)

routing interface sends aligned to long word boundaries; itojun

Revision 1.8 / (download) - annotate - [select for diffs], Wed Feb 24 22:56:02 1999 UTC (25 years, 3 months ago) by angelos
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.7: +7 -7 lines
Diff to previous 1.7 (colored)

Grok PF_KEY.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Sep 21 08:31:46 1998 UTC (25 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.6: +19 -14 lines
Diff to previous 1.6 (colored)

bad sysctl(), malloc(0), and memory leaks fixes

Revision 1.6 / (download) - annotate - [select for diffs], Thu Jul 9 01:32:12 1998 UTC (25 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +5 -5 lines
Diff to previous 1.5 (colored)

indent

Revision 1.5 / (download) - annotate - [select for diffs], Mon Dec 8 03:55:25 1997 UTC (26 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.4: +5 -2 lines
Diff to previous 1.4 (colored)

start at appletalk...

Revision 1.4 / (download) - annotate - [select for diffs], Thu Oct 2 02:10:57 1997 UTC (26 years, 8 months ago) by angelos
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.3: +59 -3 lines
Diff to previous 1.3 (colored)

Sync "route show" with "netstat -rn".

Revision 1.3 / (download) - annotate - [select for diffs], Tue Aug 26 13:50:44 1997 UTC (26 years, 9 months ago) by niklas
Branch: MAIN
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored)

$OpenBSD$

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jun 24 03:15:23 1997 UTC (26 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored)

Fix "route show" on alpha.  Some parts from Theo.

Revision 1.1 / (download) - annotate - [select for diffs], Sat Dec 14 17:23:55 1996 UTC (27 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1

merge netbsd changes for show command
yet more buf oflows (provided by netbsd!)
an attempt at 64 bit cleanliness
-Wall

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.