net: context: Set the local port correctly in accept
The local port was set to 0 for IPv6 when registering the connection handler. For IPv4, the code was not setting the port in local_addr struct. Change-Id: I82f0c08641a94d75d255ac306eca7bec6c332fba Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
a1c4f3fbd5
commit
137e4e7256
1 changed files with 3 additions and 2 deletions
|
@ -1520,7 +1520,7 @@ int net_context_accept(struct net_context *context,
|
|||
laddr = &local_addr;
|
||||
}
|
||||
|
||||
net_sin6(&local_addr)->sin6_port =
|
||||
net_sin6(&local_addr)->sin6_port = lport =
|
||||
net_sin6((struct sockaddr *)&context->local)->sin6_port;
|
||||
}
|
||||
#endif /* CONFIG_NET_IPV6 */
|
||||
|
@ -1534,7 +1534,8 @@ int net_context_accept(struct net_context *context,
|
|||
laddr = &local_addr;
|
||||
}
|
||||
|
||||
lport = net_sin((struct sockaddr *)&context->local)->sin_port;
|
||||
net_sin(&local_addr)->sin_port = lport =
|
||||
net_sin((struct sockaddr *)&context->local)->sin_port;
|
||||
}
|
||||
#endif /* CONFIG_NET_IPV4 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue