Commit Graph

12 Commits

Author SHA1 Message Date
张祖建 b8aac10bba fix staticcheck issues 2021-09-21 09:10:48 -05:00
TheDiveO 626202eca8 Provide handle Close() and deprecate Delete() 2021-09-18 09:03:48 -07:00
Ian Bishop 0e3b74dbe2 replace syscall with golang.org/x/sys/unix 2017-10-26 09:45:08 -07:00
Vincent Bernat 808afc82b2 handle: ability for force receive buffer size
This uses `SO_RCVBUFFORCE` instead of `SO_RCVBUF`. This requires to be
root and Linux 2.6.14.
2017-10-20 10:10:50 -07:00
Vincent Bernat ef84ebb87b handle: get/set receive buffer size
When receiving a lot of route changes (10,000 routes are enough), the
default receive buffer size (value of
`/proc/sys/net/core/rmem_default`) is too small and we get a `ENOBUF`
error. A user may want to increase the buffer size up to the value of
`/proc/sys/net/core/rmem_max` (by default, this is the same value). A
`SetSocketReceiveBufferSize()` function is provided to this
destination.

Possible improvements:

 1. automatically increase receive buffer size in higher level
    functions until we hit a maximum (get an error and/or the current
    value is smaller than expected)

 2. accept a "force" argument to use `SO_RCVBUFFORCE` to increase the
    value over `rmem_max` value
2017-10-20 10:10:50 -07:00
Aithal dedc638a06 Fix compilation errors for non linux platforms.
The go get command and make both fail when executed on
non-linux platforms. Modified it so that there are no
compilation errors when developing in such an
environment.
2017-02-20 12:00:54 -08:00
Sebastien Boving dbc72376c8 Properly skip tests which require root.
All these tests currently fail with 'Operation not permitted' when run as
non-root.
2017-02-06 09:09:57 -08:00
Alessandro Boch 17ea11b5a1 Allow setting socket timeout on Handle
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-15 11:01:07 -08:00
Alessandro Boch 734d02c3e2 Allow to specify netlink families for Handle (#143)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-20 09:25:15 -07:00
Alessandro Boch b824519a9a Serialize Handle's sockets access (#124)
- So that the same handle can be used
  by multiple threads

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-18 10:21:46 -07:00
Alessandro Boch cb0b035c41 Provide method to query for specific policy (#115)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-09 16:52:35 -07:00
Alessandro Boch 14f41c27fa Provide netlink handle (#104)
- Ties to a netlink socket. All client requests
  will re-use same socket. Socket released at
  handle deletion.
- Also network namespace can be specified during
  handle creation. Socket will be opened on the
  specified network namespace.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-08 11:35:49 -07:00