Skip to content
Snippets Groups Projects
Commit a080b190 authored by Yang Sun's avatar Yang Sun
Browse files

Add SOCK_CLOEXEC to NetlinkUtils.netlinkSocketForProto

Bug: 320420453

Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.netlink.NetlinkUtilsTest

Change-Id: I166a0d5185a18274ed82f739f289969c1f989b20
parent 71524f2b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment