Commit 0f66e9c6 authored by Robert Lubos's avatar Robert Lubos Committed by Johan Hedberg
Browse files

net: context: Don't assert on address family mismatch



Providing a wrong address to the connect() call by the application is no
reason to assert, connect() should just return an error in such case.
Therefore remove the faulty assert and replace it with error log
instead.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent db02fdc8
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1358,10 +1358,8 @@ int net_context_connect(struct net_context *context,
	}

	if (addr->sa_family != net_context_get_family(context)) {
		NET_ASSERT(addr->sa_family == net_context_get_family(context),
			   "Family mismatch %d should be %d",
			   addr->sa_family,
			   net_context_get_family(context));
		NET_ERR("Address family %d does not match network context family %d",
			addr->sa_family, net_context_get_family(context));
		ret = -EINVAL;
		goto unlock;
	}