Commit Graph

9 Commits

Author SHA1 Message Date
Rob Murray e194da52b1 Fix SetSendTimeout/SetReceiveTimeout
They were implemented using SO_SNDTIMEO/SO_RCVTIMEO on the
socket descriptor - but that doesn't work now the socket is
non-blocking. Instead, set deadlines on the file read/write.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-09-04 15:52:52 -07:00
世界 6f57139475 Fix recvfrom goroutine leak 2024-08-23 12:41:44 -07:00
adrianc 2bbba08be2 Add ParseRouteAttrAsMap helper function
This will allow to parse nl attributes, returning a map
for easy access to each attribute.

Signed-off-by: adrianc <adrianc@nvidia.com>
2024-01-22 11:23:43 -08:00
Steven Falken dd687eb2f2 feat: add proc events support 2022-01-15 12:48:04 -06:00
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