net: Check that net context is unset based on IP protocol
Rather than checking whether the remote port is zero, use the IP protocol field. The remote port might be zero if all incoming connections will be accepted. Change-Id: Ia1f24ae94fab27c561267c7bbc0f709fe98ee7e8 Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com> Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
b993277436
commit
fa87944a08
1 changed files with 1 additions and 1 deletions
|
@ -119,7 +119,7 @@ struct net_context *net_context_get(enum ip_protocol ip_proto,
|
|||
}
|
||||
|
||||
for (i = 0; i < NET_MAX_CONTEXT; i++) {
|
||||
if (!contexts[i].tuple.remote_port) {
|
||||
if (!contexts[i].tuple.ip_proto) {
|
||||
contexts[i].tuple.ip_proto = ip_proto;
|
||||
contexts[i].tuple.remote_addr = (struct net_addr *)remote_addr;
|
||||
contexts[i].tuple.remote_port = remote_port;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue