From 870bd7979c0cf2c54387e6405e208e136476082c Mon Sep 17 00:00:00 2001 From: Yutaro Hayakawa Date: Sun, 1 Sep 2024 16:08:07 +0900 Subject: [PATCH] lookup: Only display nexthop when specified Don't display for example 0.0.0.0 nexthop. This happens for the directly connected routes. Signed-off-by: Yutaro Hayakawa --- cmd/lookup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lookup.go b/cmd/lookup.go index 1a367d7..f541fe4 100644 --- a/cmd/lookup.go +++ b/cmd/lookup.go @@ -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 != "" {