mirror of
https://gitee.com/openharmony/third_party_libnl
synced 2024-11-27 20:20:30 +00:00
lib/socket: in nl_socket_set_fd() always reset the local port
Even if the local port of @sk already equals to the port of
the file descriptor @fd, we want to release a possibly generated
port and set NL_OWN_PORT.
Fixes: 2d61e89037
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
ffe58f3203
commit
fa47237cf5
@ -686,12 +686,7 @@ no_so_protocol:
|
||||
so_protocol = protocol;
|
||||
}
|
||||
|
||||
if (sk->s_local.nl_pid != local.nl_pid) {
|
||||
/* the port id differs. The socket is using a port id not managed by
|
||||
* libnl, hence reset the local port id to release a possibly generated
|
||||
* port. */
|
||||
nl_socket_set_local_port (sk, local.nl_pid);
|
||||
}
|
||||
nl_socket_set_local_port (sk, local.nl_pid);
|
||||
sk->s_local = local;
|
||||
sk->s_fd = fd;
|
||||
sk->s_proto = so_protocol;
|
||||
|
Loading…
Reference in New Issue
Block a user