net: context: For bind debug logging, include context protocol.

It's not enough to know just network address and port number to
disambiguate an endpoint, protocol (TCP vs UDP, etc.) should be
known too. Without this patch, there is a confusing output from
e.g. echo_server if both TCP and UDP is enabled.

Jira: ZEP-1086

Change-Id: I247a2dfc87df634ceac3b8733d7349b1d6aca80c
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
Paul Sokolovsky 2017-03-12 19:15:51 +03:00 committed by Jukka Rissanen
commit c1ecd8c890

View file

@ -524,7 +524,9 @@ int net_context_bind(struct net_context *context, const struct sockaddr *addr,
}
}
NET_DBG("Context %p binding to [%s]:%d iface %p", context,
NET_DBG("Context %p binding to %s [%s]:%d iface %p",
context,
net_proto2str(net_context_get_ip_proto(context)),
net_sprint_ipv6_addr(ptr), ntohs(addr6->sin6_port),
iface);
@ -593,7 +595,9 @@ int net_context_bind(struct net_context *context, const struct sockaddr *addr,
}
}
NET_DBG("Context %p binding to %s:%d iface %p", context,
NET_DBG("Context %p binding to %s %s:%d iface %p",
context,
net_proto2str(net_context_get_ip_proto(context)),
net_sprint_ipv4_addr(ptr),
ntohs(addr4->sin_port), iface);