and sent in by Greg Hudson as seen in PR misc/3227. Basically what it
does is adds a flushall option which deletes all but localhost routes.
This is done by andoring in a flag called doall (1 means do all routes
including gateway, 0 means do a regular flush). I have seen some
platforms that do this. I tested it out on ipv4 only, it works as
advertised. Commit was approved by christos@.
address corresponding to RTA_GATEWAY, or nothing if it doesn't exist.
Modify the exit value of route depending on this, so that one can do
stuff like:
#!/bin/sh
gw=`route -sn get default 2>/dev/null`
if [ -z "$gw" ]; then
echo no default route
exit 1
fi
ping -w1 -c1 $gw >/dev/null 2>&1
if ! route -sn get $gw >/dev/null; then
echo default gateway not responding
exit 1
fi
echo default gateway is at $gw
* 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).