Commit Graph

5 Commits

Author SHA1 Message Date
Daniel Borkmann b1e9859792 netlink: enforce similar pid checks as in iproute2
iproute2's own netlink library asserts that the sockaddr sender pid
has to be the one of the kernel [0]. It also doesn't bail out on pid
mismatch but only skips the message instead. We've seen cases where
the latter had a pid 0; in such case we should skip to the next nl
message instead of hard bail out.

  [0] https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/lib/libnetlink.c
      rtnl_dump_filter_l(), __rtnl_talk_iov()

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-07-18 17:26:53 -07:00
Ian Bishop 0e3b74dbe2 replace syscall with golang.org/x/sys/unix 2017-10-26 09:45:08 -07:00
Flavio Crisciani ef2b2c42e6 Add test to cover recv on close leak
This test spawns a go routine that subscribe for some
events while the main thread will close the socket.
The go routine will returns after 5s when the timetout
on the recv fires and the fd is actually == -1

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-20 10:09:56 -07:00
Vishvananda Ishaya Abrams a1d6c19f19 Fix build issue on linux/s390x
Fixes issue #194
2017-02-19 15:32:03 -08:00
Vishvananda Ishaya 1a26b9f251 Move all low level calls into nl subpackage 2014-09-18 19:04:48 -07:00