net: sockets: fix conn_handler check in zsock_getsockname_ctx

The check was inverted, so a bound socket was detected as not bound.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
This commit is contained in:
Christian Taedcke 2020-06-15 17:00:05 +02:00 committed by Jukka Rissanen
parent cf72fe8fe9
commit 8ac2f96ca6

View file

@ -1599,7 +1599,7 @@ int zsock_getsockname_ctx(struct net_context *ctx, struct sockaddr *addr,
socklen_t newlen = 0;
/* If we don't have a connection handler, the socket is not bound */
if (ctx->conn_handler) {
if (!ctx->conn_handler) {
SET_ERRNO(-EINVAL);
}