20 Commits

Author SHA1 Message Date
Gudmundur Bjarni Olafsson
3a49cff1f6 Fix txqueuelen being accidentally set to zero
TxQLen was unintentionally set to 0 due to a struct literal.

Signed-off-by: Gudmundur Bjarni Olafsson <gudmundur.bjarni@gmail.com>
2024-10-02 10:01:11 +02:00
Samuel Karp
eb49a034c4
ip: include peer name in error message
If makeVeth fails as a peer exists, the existing peer name should be
included in the error message.

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2024-04-26 15:49:08 -07:00
Matthieu MOREL
10ddd9e454
enable govet and unparam linters
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-04-11 12:07:04 +02:00
Matthieu MOREL
709e775b13 enable nonamedreturns linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-03-13 17:59:28 +01:00
Matthieu MOREL
d12b81dec5 ci(lint): setup golangci-lint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-03-01 06:55:40 +00:00
Michael Zappa
5d073d690c plugins: replace arping package with arp_notify
this replaces the arping package with the linux arp_notify feature.

Resolves: #588
Signed-off-by: Michael Zappa <Michael.Zappa@stateless.net>
2022-01-06 20:53:54 -07:00
edef
90c018566c Use crypto/rand.Read, not crypto.Reader.Read
The current code accidentally ignores partial reads, since it doesn't
check the return value of (io.Reader).Read.

What we actually want is io.ReadFull(rand.Reader, buf), which is
conveniently provided by rand.Read(buf).

Signed-off-by: edef <edef@edef.eu>
2021-09-17 13:30:14 +00:00
Dan Williams
a49f908168 ip: place veth peer in host namspace directly
Instead of moving the host side of the veth peer into the host
network namespace later, just create it in the host namespace
directly.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2021-07-21 09:59:11 -05:00
Dan Williams
f14ff6687a
Merge pull request #636 from EdDev/bridge-mac-specification
bridge: Add mac field to specify container iface mac
2021-06-30 10:57:09 -05:00
Edward Haas
a3cde17fc0 bridge: Add mac field to specify container iface mac
Controlling the mac address of the interface (veth peer) in the
container is useful for functionalities that depend on the mac address.
Examples range from dynamic IP allocations based on an identifier (the
mac) and up to firewall rules (e.g. no-mac-spoofing).

Enforcing a mac address at an early stage and not through a chained
plugin assures the configuration does not have wrong intermediate
configuration. This is especially critical when a dynamic IP may be
provided already in this period.
But it also has implications for future abilities that may land on the
bridge plugin, e.g. supporting no-mac-spoofing.

The field name used (`mac`) fits with other plugins which control the
mac address of the container interface.

The mac address may be specified through the following methods:
- CNI_ARGS
- Args
- RuntimeConfig [1]

The list is ordered by priority, from lowest to higher. The higher
priority method overrides any previous settings.
(e.g. if the mac is specified in RuntimeConfig, it will override any
specifications of the mac mentioned in CNI_ARGS or Args)

[1] To use RuntimeConfig, the network configuration should include the
`capabilities` field with `mac` specified (`"capabilities": {"mac": true}`).

Signed-off-by: Edward Haas <edwardh@redhat.com>
2021-06-29 10:50:19 +03:00
Edward Haas
272f15420d ip, link_linux: Remove unused SetHWAddrByIP function
Signed-off-by: Edward Haas <edwardh@redhat.com>
2021-06-07 15:59:41 +03:00
Casey Callendrello
219eb9e046 ptp, bridge: disable accept_ra on the host-side interface
The interface plugins should have absolute control over their addressing
and routing.

Signed-off-by: Casey Callendrello <cdc@redhat.com>
2020-05-12 15:54:23 +02:00
Bruce Ma
2ff84a481e pkg/ip: use type cast instead of untrusty error message
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2020-01-29 20:03:15 +08:00
Koonwah Chen
96bd10f679 Add pkg/ip/link_linux.go:SetupVethWithName to support the host-side veth
name configuration.
2019-06-26 10:24:40 -07:00
Koonwah Chen
545a77f4bb skip makeVeth retry if a vethPeerName is set. 2019-06-25 14:17:42 -07:00
Koonwah Chen
c204dbd47c update pkg/ip/link_linux.go:SetupVeth to support host-side veth name config. 2019-06-21 11:39:30 -07:00
Dan Williams
bb1e8d10a7
Merge pull request #143 from containernetworking/v0.7
Merge v0.7.1 fix into master
2018-04-12 09:21:42 -05:00
Casey Callendrello
00b072dd0b pkg/ip: re-fetch the created link to return creation-time parameters
Fixes: #140
2018-04-11 15:04:38 +02:00
Dan Williams
b16633bbe9 pkg/ip: add GetVethPeerIfindex() 2018-02-17 15:42:10 -08:00
Gabriel Rosenhouse
99f6be0319 Enable Windows CI (Appveyor)
- start list of linux_only plugins; ignore them when testing on Windows
- Isolate linux-only code by filename suffix
- Remove stub (NotImplemented) functions
- other misc. fixes for Windows compatibility
2017-11-10 08:09:29 -08:00