Use db_get_line() to overcome parser limitation.
Details
Details
- Reviewers
donner - Group Reviewers
network - Commits
- rS360630: Simplify address parsing in DDB show route command.
show route Usage: 'show route <address>' Currently accepts only IPv4 and IPv6 addresses db> show route 1.1.1.1 Looking up route to destination '1.1.1.1' dst <0.0.0.0> gateway <172.16.107.2> netmask <0.0.0.0> ifp <on link> ifa <172.16.107.128> flags UP,GATEWAY, STATIC db> show route 172.16.167.3 Looking up route to destination '172.16.187.3' dst <172.16.107.6> gateway <on link> netmask <255.255.255.0> ifp <on link> ifa <1?2.16.107.128> flags UP,PINNED db> show route :: Looking up route to destination '::' dst <::> gateway <::1> netmask <ffff:ffff:ffff :ffff:ffff :ffff::> ifp <on link> ifa <::1> flags UP,GATEWAY,REJECT, STATIC show route 1::1 Looking up route to destination '1::1' dst <::> gateway <fe86:3: :925c:44ff:fe5b:1c5b> netmask <::> ifp <on link> ifa <fe8@:3: :26c:29ff :fed4b:dbb0> flags UP,GATEWAY show route qqq Usage: 'show route <address>’ Currently accepts only IPv4 and IPv6 addresses db> show route a Usage: ‘show route <address>’ Currently accepts only IPv4 and IPv6 addresses db> show route a:: Looking up route to destination 'a::' dst <::> gateway <fe86:3: :925c:44ff:fe5b:1c5b> netmask <::> ifp <on link> ifa <fe80:3: :26c:29ff :fed4b:dbb0> flags UP,GATEWAY db>
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/net/route/route_ddb.c | ||
---|---|---|
241–242 ↗ | (On Diff #71270) | This is only for printing a canonized address? |
sys/net/route/route_ddb.c | ||
---|---|---|
241–242 ↗ | (On Diff #71270) | Yes. |
sys/net/route/route_ddb.c | ||
---|---|---|
222–225 ↗ | (On Diff #71270) | You are not handling all types of whitespace (i.e. \t); is inet_pton able to ignore this itself? |
sys/net/route/route_ddb.c | ||
---|---|---|
222–225 ↗ | (On Diff #71270) | No, inet_pton doesn't handle it. I've updated the implementation to use isspace(), though I'm not sure if '\t' is even supported by our debugger. |