Skip to content

Commit 177380e

Browse files
committed
net: shell: Fix the output of route command
Print route information by groupping them for each network interface like this: IPv6 routes for interface 0xa8007140 ==================================== IPv6 prefix : 2001:db8::212:4b00:0:3/128 neighbor : 0xa80065e0 link addr : 00:12:4B:00:00:00:00:03 IPv6 prefix : 2001:db8::212:4b00:0:1/128 neighbor : 0xa8006660 link addr : 00:12:4B:00:00:00:00:01 Signed-off-by: Jukka Rissanen <[email protected]>
1 parent fa7d584 commit 177380e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

subsys/net/ip/net_shell.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,17 +269,12 @@ static void route_cb(struct net_route_entry *entry, void *user_data)
269269
return;
270270
}
271271

272-
printk("IPv6 Route %p for interface %p\n", entry, iface);
273-
printk("==============================================\n");
274-
275272
printk("IPv6 prefix : %s/%d\n",
276273
net_sprint_ipv6_addr(&entry->addr),
277274
entry->prefix_len);
278275

279276
count = 0;
280277

281-
printk("Next hops :\n");
282-
283278
SYS_SLIST_FOR_EACH_CONTAINER(&entry->nexthop, nexthop_route, node) {
284279
struct net_linkaddr_storage *lladdr;
285280

@@ -311,6 +306,9 @@ static void iface_per_route_cb(struct net_if *iface, void *user_data)
311306
{
312307
ARG_UNUSED(user_data);
313308

309+
printk("IPv6 routes for interface %p\n", iface);
310+
printk("====================================\n");
311+
314312
net_route_foreach(route_cb, iface);
315313
}
316314
#endif /* CONFIG_NET_ROUTE */

0 commit comments

Comments
 (0)