diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2023-04-28 09:34:42 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2023-04-28 20:20:58 +0200 |
commit | 8142051a3b244f514ba05bc6b9a93efe45c0087f (patch) | |
tree | 1e3106efdf7e23ac3f2ac098357480856c777acf | |
parent | 0ea41eaa51314fca8fa9b9d89f449901e2f86bae (diff) | |
download | docker-8142051a3b244f514ba05bc6b9a93efe45c0087f.tar.gz |
libnetwork/osl: unify stubs for NeighOption
Use the same signature for all platforms, but stub the neigh type.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
-rw-r--r-- | libnetwork/osl/neigh_freebsd.go | 4 | ||||
-rw-r--r-- | libnetwork/osl/neigh_linux.go | 3 | ||||
-rw-r--r-- | libnetwork/osl/neigh_unsupported.go | 6 | ||||
-rw-r--r-- | libnetwork/osl/neigh_windows.go | 4 | ||||
-rw-r--r-- | libnetwork/osl/sandbox.go | 3 |
5 files changed, 9 insertions, 11 deletions
diff --git a/libnetwork/osl/neigh_freebsd.go b/libnetwork/osl/neigh_freebsd.go deleted file mode 100644 index 280f006396..0000000000 --- a/libnetwork/osl/neigh_freebsd.go +++ /dev/null @@ -1,4 +0,0 @@ -package osl - -// NeighOption is a function option type to set neighbor options -type NeighOption func() diff --git a/libnetwork/osl/neigh_linux.go b/libnetwork/osl/neigh_linux.go index 7105bf6dde..e46b12a89f 100644 --- a/libnetwork/osl/neigh_linux.go +++ b/libnetwork/osl/neigh_linux.go @@ -20,9 +20,6 @@ func (n NeighborSearchError) Error() string { return fmt.Sprintf("Search neighbor failed for IP %v, mac %v, present in db:%t", n.ip, n.mac, n.present) } -// NeighOption is a function option type to set interface options -type NeighOption func(nh *neigh) - type neigh struct { dstIP net.IP dstMac net.HardwareAddr diff --git a/libnetwork/osl/neigh_unsupported.go b/libnetwork/osl/neigh_unsupported.go new file mode 100644 index 0000000000..6d2f285698 --- /dev/null +++ b/libnetwork/osl/neigh_unsupported.go @@ -0,0 +1,6 @@ +//go:build !linux +// +build !linux + +package osl + +type neigh struct{} diff --git a/libnetwork/osl/neigh_windows.go b/libnetwork/osl/neigh_windows.go deleted file mode 100644 index 280f006396..0000000000 --- a/libnetwork/osl/neigh_windows.go +++ /dev/null @@ -1,4 +0,0 @@ -package osl - -// NeighOption is a function option type to set neighbor options -type NeighOption func() diff --git a/libnetwork/osl/sandbox.go b/libnetwork/osl/sandbox.go index f9448212c6..84833167e6 100644 --- a/libnetwork/osl/sandbox.go +++ b/libnetwork/osl/sandbox.go @@ -20,6 +20,9 @@ const ( // IfaceOption is a function option type to set interface options. type IfaceOption func(i *nwIface) +// NeighOption is a function option type to set neighbor options. +type NeighOption func(nh *neigh) + // Sandbox represents a network sandbox, identified by a specific key. It // holds a list of Interfaces, routes etc, and more can be added dynamically. type Sandbox interface { |