[posix] allow kernel to assign netlink socket port ID (#6835)

This commit fixes a potential bug that the netlink socket may fail to
bind due to port ID conflict.
This commit is contained in:
Simon Lin
2021-07-19 23:46:27 -07:00
committed by GitHub
parent 3a08490c56
commit 10632805b6
-1
View File
@@ -163,7 +163,6 @@ int CreateNetLinkSocket(void)
memset(&addr, 0, sizeof(addr));
addr.nl_family = AF_NETLINK;
addr.nl_groups = RTMGRP_LINK | RTMGRP_IPV6_IFADDR;
addr.nl_pid = getpid();
rval = bind(sock, reinterpret_cast<struct sockaddr *>(&addr), sizeof(addr));
VerifyOrDie(rval == 0, OT_EXIT_ERROR_ERRNO);