542 Commits

Author SHA1 Message Date
Michael Wyrick
1324428a9a Ran go fmt so tests would pass
Signed-off-by: Michael Wyrick <Michael.Wyrick@caci.com>
2021-12-28 10:43:52 -05:00
Michael Wyrick
fd4c3350ae Fixed DHCP problem that broke when fast retry was added.
Signed-off-by: Michael Wyrick <Michael.Wyrick@caci.com>
2021-12-27 13:48:44 -05:00
Dan Williams
cc32993e9e
Merge pull request #670 from SilverBut/ipam-dhcp-more-options
dhcp ipam: support customizing dhcp options from CNI args
2021-12-15 10:50:52 -06:00
Dan Williams
b76849596f
Merge pull request #642 from Nordix/dpdk-ipam
host-device: add ipam support for dpdk device
2021-12-15 10:50:31 -06:00
SilverBut
c9d0423023 dhcp ipam: adjust retry mechanism
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
2021-11-28 06:41:53 +08:00
Matt Dupre
57e95c5dfe
Merge pull request #669 from containernetworking/jell/per_if_sysctl
Allow setting sysctls on a particular interface
2021-11-24 09:07:17 -08:00
Periyasamy Palanisamy
547a516c30 add ipam tests for dpdk device
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
2021-11-18 15:10:29 +01:00
Periyasamy Palanisamy
3033fd2e75 add ipam support for dpdk device
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
2021-11-17 21:08:08 +01:00
Ferenc Toth
d5a6569102 ipvlan: Send Gratuitous ARP after IPs are set
Signed-off-by: Ferenc Toth <ferenc.2.toth@nokia.com>
2021-11-16 14:32:57 +01:00
Matt Dupre
f1f128e3c9
Merge pull request #639 from EdDev/bridge-macspoofchk
bridge: Add macspoofchk support
2021-10-06 08:39:10 -07:00
SilverBut
27fdec5cb9 dhcp ipam: fix client id
First byte of client ID is type, instead of value. See this from
RFC2132:

   Code   Len   Type  Client-Identifier
   +-----+-----+-----+-----+-----+---
   |  61 |  n  |  t1 |  i1 |  i2 | ...
   +-----+-----+-----+-----+-----+---

Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
2021-10-03 05:57:27 +08:00
SilverBut
a1051f3bf1 dhcp ipam: rename inconsistent options among files
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
2021-10-02 23:49:59 +08:00
SilverBut
c627ea807c dhcp ipam: add more options capable for sending
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
2021-10-02 23:30:59 +08:00
SilverBut
4b216e9d9b dhcp ipam: add fast retry
Almost every first retry of DHCP will fail due to interface is not up. Add a
fast retry to reduce unnecessary latency.

Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
2021-10-02 23:04:24 +08:00
SilverBut
2bebd89aa2 dhcp ipam: support customizing dhcp options
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
2021-10-02 22:48:05 +08:00
SilverBut
be383cf30d dhcp ipam: truncate client id to 254 bytes
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
2021-10-02 22:41:05 +08:00
SilverBut
6d1f71e55a dhcp ipam: print error correctly without format string
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
2021-10-02 22:40:44 +08:00
SilverBut
24259e7d21 dhcp ipam: using full config to regular the code
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
2021-10-02 22:40:19 +08:00
Piotr Skamruk
c16cff9805 Allow setting sysctls on a particular interface
Signed-off-by: Piotr Skamruk <piotr.skamruk@gmail.com>
2021-10-01 18:09:40 +02:00
SilverBut
7cb3453c36 dhcp: remove implemented TODO
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
2021-09-30 13:10:45 +00:00
edef
ceb34eb2e6 Don't redundantly filepath.Clean the output of filepath.Join
filepath.Join is already specified to clean its output,
and the implementation indeed does so.

Signed-off-by: edef <edef@edef.eu>
2021-09-17 14:12:46 +00:00
Bruce Ma
a6b5412c55
Merge pull request #638 from maiqueb/fix-confusing-error-msg-invalid-cidr
Fix confusing error msg invalid cidr
2021-09-16 17:47:05 +08:00
Edward Haas
081ed44a1d bridge: Add macspoofchk support
The new macspoofchk field is added to the bridge plugin to support
anti-mac-spoofing.
When the parameter is enabled, traffic is limited to the mac addresses
of the container interface (the veth peer that is placed in the
container ns).
Any traffic that exits the pod is checked against the source mac address
that is expected. If the mac address is different, the frames are
dropped.

The implementation is using nftables and should only be used on nodes
that support it.

Signed-off-by: Edward Haas <edwardh@redhat.com>
2021-09-14 12:46:15 +03:00
Casey Callendrello
ba48f8a659 plugins: fix bug where support for CNI version 0.4.0 or 1.0.0 was dropped
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2021-09-07 15:48:16 +02:00
Miguel Duarte Barroso
8ab23366fb static ipam: do not parse the CIDR twice
With this patch, when the IPs are provisioned via CNI args or via
`RuntimeConfig` the CIDR is only parsed once.

Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com>
2021-08-24 13:19:37 +02:00
Miguel Duarte Barroso
2052c30acd static ipam: improve error msgs when provisioning invalid CIDR
This commit addresses the scenarios when the invalid CIDR is
provisioned via:
- CNI_ARGS
- RuntimeConfig

Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com>
2021-08-24 13:05:44 +02:00
Takuya Noguchi
24b3fbc635 bridge: Fix typo in error message for promiscuous mode
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2021-08-09 09:46:38 +00: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
Miguel Duarte Barroso
a786b12b68 static ipam: decide wrong cidr error msg
Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com>
2021-06-25 11:24:56 +01:00
Miguel Duarte Barroso
0db5882a12 static ipam: stop wrapping net.ParseCIDR errors
Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com>
2021-06-25 11:24:56 +01:00
Miguel Duarte Barroso
5a408187d4 static ipam: show confusing error msg
Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com>
2021-06-25 11:24:54 +01:00
Casey Callendrello
77233dd79d plugins: remove flannel
Now that the flannel CNI plugin has been moved to
https://github.com/flannel-io/cni-plugin, we should remove it from here.

Signed-off-by: Casey Callendrello <cdc@redhat.com>
2021-06-02 17:38:32 +02:00
thxcode
4b180a9d9c refactor(win-bridge): netconf
- support v2 api
- unify v1 and v2 api

BREAKING CHANGE:
- remove `HcnPolicyArgs` field
- merge `HcnPolicyArgs` into `Policies` field

Signed-off-by: thxcode <thxcode0824@gmail.com>
2021-05-27 23:49:16 +08:00
thxcode
ec75bb8587 chore(win-bridge): text related
- format function names
- add/remove comments
- adjust message of error

Signed-off-by: thxcode <thxcode0824@gmail.com>
2021-05-27 23:14:11 +08:00
Dan Williams
6618a0aba8
Merge pull request #623 from anuragensemble/multi-ip-intf
Add multi IP support for SBR
2021-05-19 10:33:40 -05:00
Bruce Ma
af26bab500 host-local: support ip/prefix in env args and CNI args
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2021-05-17 21:12:45 +08:00
Anurag Dwivedi
f72aa98629 [sbr]: Use different tableID for every ipCfg
Check tableID not in use for every ipCfg

       This allows SBR plugin to accommodate for multi-ip interfaces

       Fixes #581

Signed-off-by: Anurag Dwivedi <anuragensemble1@gmail.com>
2021-05-15 19:33:58 +05:30
Casey Callendrello
d917ab6b0c
Merge pull request #599 from mars1024/feat/hostlocal-ips
host-local: support custom IPs allocation through runtime configuraton
2021-05-05 11:33:27 -04:00
Dan Williams
faf6d2629d
Merge pull request #626 from Luap99/tuning-mac
tuning: always update MAC in CNI result
2021-05-05 10:24:13 -05:00
Paul Holzinger
bdaaa20ef2 tuning: always update MAC in CNI result
Since the CNI Spec bump to v1.0 the tuning plugin no longer updates the
mac address in the cni result for 0.4.0 or below configs. I don't think
this ever worked when the cni result was converted to a different version.

A test has been added to ensure it is working for all spec versions.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-05-05 13:48:47 +02:00
Björn Svensson
820fee9c33 tuning: Add support of altering the allmulticast flag
This adds support to allow the tuning plugin to enable/disable the
allmulticast mode of the interface. When enabled it instructs the
network driver to retrieve all multicast packets from the network.

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
2021-04-28 10:20:04 +02:00
Anurag Dwivedi
f34c600ea4 [sbr]: Use different tableID for every ipCfg
Move default table routes which  match the ipCfg config

    This allows SBR plugin to accommodate for multi-ip interfaces

    Fixes #581

Signed-off-by: Anurag Dwivedi <anuragensemble1@gmail.com>
2021-04-27 12:34:30 +05:30
Casey Callendrello
b41052c547
Merge pull request #593 from thetechnick/ipam-static-nil-check-fix
Fix nil-pointer check
2021-04-14 18:00:42 +02:00
Nico Schieder
8f32968f73
Fix nil-pointer check
Signed-off-by: Nico Schieder <nschieder@redhat.com>
2021-04-13 13:42:23 +02:00
Bruce Ma
028fc2f219 host-local: support custom IPs allocation through runtime configuration
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2021-04-13 17:53:43 +08:00
Sebastiaan van Stijn
bc856372bb
go.mod: godbus/dbus/v5 v5.0.3, coreos/go-systemd v22.2.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-09 00:07:25 +02:00
Kavya
5b02c2ab70 Fix broken links to online docs in plugin READMEs
Signed-off-by: Kavya <kavya.g@ibm.com>
2021-03-25 13:07:33 +05:30
Bruce Ma
b811967444 remove redundant startRange in RangeIter due to overlap check on multi ranges
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2021-03-04 11:50:54 +08:00
Dan Williams
d385120175
Merge pull request #537 from dcbw/100
Port plugins to CNI 1.0.0 and increase old verison test coverage
2021-03-03 10:51:56 -06:00