Add SOCK_CLOEXEC to NetlinkUtils.netlinkSocketForProto
Bug: 320420453 Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.netlink.NetlinkUtilsTest Change-Id: I166a0d5185a18274ed82f739f289969c1f989b20
This commit is contained in:
parent
71524f2bf0
commit
a080b1900a
1 changed files with 1 additions and 1 deletions
|
|
@ -229,7 +229,7 @@ public class NetlinkUtils {
|
|||
* @throws ErrnoException if the FileDescriptor not connect to be created successfully
|
||||
*/
|
||||
public static FileDescriptor netlinkSocketForProto(int nlProto) throws ErrnoException {
|
||||
final FileDescriptor fd = Os.socket(AF_NETLINK, SOCK_DGRAM, nlProto);
|
||||
final FileDescriptor fd = Os.socket(AF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, nlProto);
|
||||
Os.setsockoptInt(fd, SOL_SOCKET, SO_RCVBUF, SOCKET_RECV_BUFSIZE);
|
||||
return fd;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue