net: ip: set local address family during TCP connect
When calling net_context_connect, the local address family is never set prior to calling net_tcp_register. This generates an error: "Local address family not set." (-EINVAL) Let's set the local address family prior to this call. Change-Id: Ic5f2edf684d14f9bb77019c49c95e5524a406417 Signed-off-by: Michael Scott <michael.scott@linaro.org>
This commit is contained in:
parent
a2464d049f
commit
c306844583
1 changed files with 2 additions and 0 deletions
|
@ -1008,6 +1008,7 @@ int net_context_connect(struct net_context *context,
|
|||
rport = addr6->sin6_port;
|
||||
|
||||
net_sin6_ptr(&context->local)->sin6_family = AF_INET6;
|
||||
net_sin6(&local_addr)->sin6_family = AF_INET6;
|
||||
net_sin6(&local_addr)->sin6_port = lport =
|
||||
net_sin6((struct sockaddr *)&context->local)->sin6_port;
|
||||
|
||||
|
@ -1050,6 +1051,7 @@ int net_context_connect(struct net_context *context,
|
|||
rport = addr4->sin_port;
|
||||
|
||||
net_sin_ptr(&context->local)->sin_family = AF_INET;
|
||||
net_sin(&local_addr)->sin_family = AF_INET;
|
||||
net_sin(&local_addr)->sin_port = lport =
|
||||
net_sin((struct sockaddr *)&context->local)->sin_port;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue