Commit Graph

7 Commits

Author SHA1 Message Date
Rob Murray 084abd93d3 Add ErrDumpInterrupted
Add a specific error to report that a netlink response had
NLM_F_DUMP_INTR set, indicating that the set of results may be
incomplete or inconsistent.

unix.EINTR was previously returned (with no results) when the
NLM_F_DUMP_INTR flag was set. Now, errors.Is(err, unix.EINTR) will
still work. But, this will be a breaking change for any code that's
checking for equality with unix.EINTR.

Return results with ErrDumpInterrupted. Results may be incomplete
or inconsistent, but give the caller the option of using them.

Look for NLM_F_DUMP_INTR in more places:
- linkSubscribeAt, neighSubscribeAt, routeSubscribeAt
  - can do an initial dump, which may report inconsistent results
  -> if there's an error callback, call it with ErrDumpInterrupted
- socketDiagXDPExecutor
  - makes an NLM_F_DUMP request, without using Execute()
  -> give it the same behaviour as functions that do use Execute()

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-09-22 00:00:40 -07:00
Date Huang 0cd15d9a7a bridge: add/del vlan range
Signed-off-by: Date Huang <tjjh89017@hotmail.com>
2024-03-04 10:45:37 -08:00
callmehollow 91b013f9ed code simplification 2018-11-19 16:40:56 -08:00
Julian Kornberger e137ed6e2c Replace nl.NewRtAttrChild with method on struct 2018-10-30 10:31:19 -07:00
Tobias Klauser 5236321576 Use IFLA_* constants from x/sys/unix
The IFLA_* constants in in x/sys/unix were updated to Linux 4.15 in
golang/sys@88d2dcc510, so use these instead of locally duplicating
them.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-02-23 09:35:37 -08:00
Ian Bishop 0e3b74dbe2 replace syscall with golang.org/x/sys/unix 2017-10-26 09:45:08 -07:00
Chun Chen 7593cff56f Add bridge vlan support 2017-06-13 11:04:51 -07:00