File descriptor may leak in all libnl versions if pthreads are used.

Марк Коренберг socketpair at
Tue Jun 14 11:17:57 EDT 2011


sk->s_fd = socket(AF_NETLINK, SOCK_RAW, protocol);

should be changed to

sk->s_fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, protocol);

Note: SOCK_CLOEXEC should be checked in autotools via querying
fcntl(fd, F_GETFD) & FD_CLOEXEC)  after calling to socket() with

Segmentation fault

More information about the libnl mailing list