These commands show the route resolved for a specified destination, or
print out the entire routing table for a given address family (or all
families, if none is explicitly provided).
Details
- Reviewers
emaste markj - Group Reviewers
manpages - Commits
- rS352112: ddb(4): Add 'show route <dest>' and 'show routetable [<af>]'
db> show route 192.168.0.SSS Looking up route to destination '192.168.0.SSS' dst <192.168.0.0> gateway <on link> netmask <255.255.255.0> ifp <on link> ifa <192.168.0.CCC> flags UP,PINNED db> show route 8.8.8.8 Looking up route to destination '8.8.8.8' dst <0.0.0.0> gateway <192.168.0.GGG> netmask <0.0.0.0> ifp <on link> ifa <192.168.0.CCC> flags UP,GATEWAY,STATIC db> show route fe80::2 Looking up route to destination 'fe80::2' dst <fe80::> gateway <::1> netmask <ffc0::> ifp <on link> ifa <::1> flags UP,GATEWAY,REJECT,STATIC db> show route ::1 Looking up route to destination '::1' dst <::1> gateway <on link> netmask <NULL> ifp <on link> ifa <::1> flags UP,HOST,PINNED,LOCAL db> show routetable Route table for AF 2 (INET): dst <0.0.0.0> gateway <192.168.0.GGG> netmask <0.0.0.0> ifp <on link> ifa <192.168.0.CCC> flags UP,GATEWAY,STATIC dst <127.0.0.1> gateway <on link> netmask <NULL> ifp <on link> ifa <127.0.0.1> flags UP,HOST,PINNED,LOCAL dst <192.168.0.0> gateway <on link> netmask <255.255.255.0> ifp <on link> ifa <192.168.0.CCC> flags UP,PINNED dst <192.168.0.CCC> gateway <on link> netmask <NULL> ifp <on link> ifa <127.0.0.1> flags UP,HOST,STATIC,PINNED Route table for AF 28 (INET6): dst <::> gateway <::1> netmask <ffff:ffff:ffff:ffff:ffff:ffff::> ifp <on link> ifa <::1> flags UP,GATEWAY,REJECT,STATIC dst <::1> gateway <on link> netmask <NULL> ifp <on link> ifa <::1> flags UP,HOST,PINNED,LOCAL dst <::ffff:0.0.0.0> gateway <::1> netmask <ffff:ffff:ffff:ffff:ffff:ffff::> ifp <on link> ifa <::1> flags UP,GATEWAY,REJECT,STATIC dst <fe80::> gateway <::1> netmask <ffc0::> ifp <on link> ifa <::1> flags UP,GATEWAY,REJECT,STATIC dst <fe80:2::> gateway <on link> netmask <ffff:ffff:ffff:ffff::> ifp <on link> ifa <fe80:2::1> flags UP dst <fe80:2::1> gateway <on link> netmask <NULL> ifp <on link> ifa <fe80:2::1> flags UP,HOST,STATIC,PINNED,LOCAL dst <ff02::> gateway <::1> netmask <ffff::> ifp <on link> ifa <::1> flags UP,GATEWAY,REJECT,STATIC,MULTICAST db> show routetable 2 Route table for AF 2 (INET): dst <0.0.0.0> gateway <192.168.0.GGG> netmask <0.0.0.0> ifp <on link> ifa <192.168.0.CCC> flags UP,GATEWAY,STATIC dst <127.0.0.1> gateway <on link> netmask <NULL> ifp <on link> ifa <127.0.0.1> flags UP,HOST,PINNED,LOCAL dst <192.168.0.0> gateway <on link> netmask <255.255.255.0> ifp <on link> ifa <192.168.0.CCC> flags UP,PINNED dst <192.168.0.CCC> gateway <on link> netmask <NULL> ifp <on link> ifa <127.0.0.1> flags UP,HOST,STATIC,PINNED
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 26255 Build 24745: arc lint + arc unit
Event Timeline
Any objection in principle? Planning to review or ENOTIME? Suggestions for reviewers with free time and interest in this layer of the network stack?
I have no objection. I plan to review the pending diffs in the next day or so, but am swamped this week and not particularly qualified to review this particular one, so please don't wait on me if you're in a hurry.
Thanks. Yeah, I figure this one is fairly unobjectionable and low impact; I'd rather than your limited eyeball time on netgdb, when I can get it.
Overall LGTM
sys/net/rtsock.c | ||
---|---|---|
2068 | this seems a little odd/hackish to me, but not sure how better to represent this (omitting gateway for local, or something else) |
sys/net/rtsock.c | ||
---|---|---|
2068 | Sure. It seemed clearest to me to always print something for gateway, and this is reasonable for that column in this scenario. It might be nicer to look up the specific interface represented by the AF_LINK sockaddr, but that was more complicated and this met my needs for debugging debugnet. |