and -host flags, which is useful for displaying/flushing ARP entries:
# route -n show -inet -llinfo -host
Routing table
Internet:
Destination Gateway Flags
169.254.1.119 link#1 UH
169.254.230.110 00:02:6f:21:e6:6e UH
# route -n flush -inet -llinfo -host
169.254.1.119 done
169.254.230.110 0.2.6f.21.e6.6e done
169.254.237.70 done
# route -n show -inet -llinfo -host
Routing table
#
This will help me address bin/11079, "dhclient may require arp and sed".
Extract common code from flushroutes() and show(), creating
parse_show_opts().
While I'm here, make small cosmetic changes to flushroutes().
+ style (KNF).
. don't cast NULL
. white space clean up
+ use consistent format for error messages.
+ plug memory leaks and avoid malloc(0).
+ verbose message should display even when routing table is empty
(flushroutes).
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.
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.
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
* 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).
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).