Skip to content

Commit

Permalink
lookup: Only display nexthop when specified
Browse files Browse the repository at this point in the history
Don't display for example 0.0.0.0 nexthop. This happens for the directly
connected routes.

Signed-off-by: Yutaro Hayakawa <[email protected]>
  • Loading branch information
YutaroHayakawa committed Sep 1, 2024
1 parent 90392e4 commit 870bd79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ type lookupOut struct {
func (out *lookupOut) String(queryAddr netip.Addr) string {
var s string
s += fmt.Sprintf("%s ", queryAddr.String())
if out.NextHop != queryAddr {
if out.NextHop != queryAddr && !out.NextHop.IsUnspecified() {
s += fmt.Sprintf("via %s ", out.NextHop)
}
if out.Iface != "" {
Expand Down

0 comments on commit 870bd79

Please sign in to comment.