Skip to content

Commit 1e98928

Browse files
committed
net: shell: Print connection information properly for AF_CAN
CANBUS socket information was just printing unknown information. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 0032f68 commit 1e98928

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/net/ip/net_shell.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,11 @@ static void conn_handler_cb(struct net_conn *conn, void *user_data)
935935
&net_sin(&conn->remote_addr)->sin_addr),
936936
ntohs(net_sin(&conn->remote_addr)->sin_port));
937937
} else
938+
#endif
939+
#ifdef CONFIG_NET_L2_CANBUS
940+
if (conn->local_addr.sa_family == AF_CAN) {
941+
snprintk(addr_local, sizeof(addr_local), "-");
942+
} else
938943
#endif
939944
if (conn->local_addr.sa_family == AF_UNSPEC) {
940945
snprintk(addr_local, sizeof(addr_local), "AF_UNSPEC");

0 commit comments

Comments
 (0)