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:
parent
cf72fe8fe9
commit
8ac2f96ca6
1 changed files with 1 additions and 1 deletions
|
@ -1599,7 +1599,7 @@ int zsock_getsockname_ctx(struct net_context *ctx, struct sockaddr *addr,
|
||||||
socklen_t newlen = 0;
|
socklen_t newlen = 0;
|
||||||
|
|
||||||
/* If we don't have a connection handler, the socket is not bound */
|
/* If we don't have a connection handler, the socket is not bound */
|
||||||
if (ctx->conn_handler) {
|
if (!ctx->conn_handler) {
|
||||||
SET_ERRNO(-EINVAL);
|
SET_ERRNO(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue