Commit Graph

10 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
Bernardo Soares a4fcbb7aeb add support for bridge port neighbor suppression
this PR adds support for setting neigh_suppress attribute to a member port of a bridge
2023-09-21 20:24:56 -07:00
Robin Jarry 19c6398aa9 link: allow isolating bridge ports
This is the equivalent of:

	bridge link set dev <foo> isolated on|off

Add more bridge port netlink attributes Imported from
include/uapi/linux/if_link.h in Linux v6.3.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
2023-07-16 12:21:30 +02:00
Julian Kornberger aa5b058fc0 Simplify code 2018-10-30 10:31:46 -07:00
Ian Bishop 0e3b74dbe2 replace syscall with golang.org/x/sys/unix 2017-10-26 09:45:08 -07:00
David J. Wilder b71e0bb214 Add support for BR_PROXYARP and BR_PROXYARP_WIFI.
Bridge ports can be set to use the proxy arp features by calling
either LinkSetBrProxyArp() or LinkSetBrProxyArpWiFi().

Signed-off-by: David Wilder <wilder@us.ibm.com>
2017-04-22 12:52:14 -07:00
Martynas Pumputis 266f02d3a8 Parse IFLA_PROTINFO in LinkDeserialize
Extract and parse IFLA_PROTINFO fields from RTM_NEWLINK AF_BRIDGE
netlink messages.
2016-12-02 16:05:43 -08:00
Alessandro Boch f116a3048a Use package empty handle for pkg APIs (#117)
- Package methods only need an empty handle.
  Not a regular Handle with a couple of
  sockets creation/delete.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-09 16:55:00 -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
Vishvananda Ishaya 889b85d2e6 Move the linux specific code into protinfo_linux.go 2015-02-06 18:58:24 -08:00