Wifi-Hal: Set nl socket's local port with nl api

The nl library maintains one local port pool for nl sockets, one
port is occupied when new nl socket is allocated and it needs to
released, otherwise the nl socket allocation will fail since no
local port can be used in nl socket allocation.
Wifi hal sets own local port for nl socket directly without
calling api and causes leak.

BUG: 30350620
Change-Id: I4bb1fd2c352c73cc246a2ba7f837e395f022651f
diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp
index 2f78718..64c0143 100644
--- a/qcwcn/wifi_hal/wifi_hal.cpp
+++ b/qcwcn/wifi_hal/wifi_hal.cpp
@@ -97,15 +97,10 @@
 
 void wifi_socket_set_local_port(struct nl_sock *sock, uint32_t port)
 {
-    uint32_t pid = getpid() & 0x3FFFFF;
-
-    if (port == 0) {
-        sock->s_flags &= ~NL_OWN_PORT;
-    } else {
-        sock->s_flags |= NL_OWN_PORT;
-    }
-
-    sock->s_local.nl_pid = pid + (port << 22);
+    /* Release local port pool maintained by libnl and assign a own port
+     * identifier to the socket.
+     */
+    nl_socket_set_local_port(sock, ((uint32_t)getpid() & 0x3FFFFFU) | (port << 22));
 }
 
 static nl_sock * wifi_create_nl_socket(int port, int protocol)