1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

1641 Commits

Author SHA1 Message Date
a0522546b8 addons: address: fix merge-indentation issue
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-10 17:30:27 +02:00
909ff39554 debian: changelog: new entry: 3.2.0
* Fix: Sonarqube issues
  * Fix: ifquery hangs indefinitely on ^C
  * Fix: Skipping admin down on deleted vlans
  * Fix: Merge existing MTU into new netlink object
  * Fix: scheduler: env variable not properly set for user commands (fixes #218)
  * Fix: ifquery-check: vlan-protocol for dotted interfaces
  * Fix: Down ops on vrf-slave should set the slave admin down
  * New: Allow bond creation without slaves
  * New: Add `--set-ring` option to ethtool
  * New: Openvswitch : add support for fakebridge
  * New: add support for systemd logging (--systemd)
  * New: Process hwaddress before processing ip addresses
  * New: Set protodown off on bond slave before bond is deleted
  * New: Make sure bond speed and slaves (swps) speed are matching

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
c8bda7739d nlcache: remove special SIGINT handling
capturing sigint was causing ifquery to hang indefinitely on ctrl-c

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
928186191c nlcache: merge existing MTU into new netlink object (vlan/vxlan) before caching
This patch fixes the gap in the vlan and vxlan code

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
a5db158bc1 ifupdownmain: skipping admin down on deleted vlans
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
2a53e1383d ifupdownmain: down ops on vrf-slave should set the slave admin down
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
86bd267c63 addons: address: process hwaddress before processing ip addresses
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
aa656ad315 lib: nlcache: merge existing MTU into new netlink object before caching
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
e5e64b25fe SONAR: mstpctl: Merge if statement with the enclosing one
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
a0ff28e527 sonarlink: remove unused variable
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
75dea8b906 addons: bond: set protodown off on bond slave before bond is deleted
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
530e3a0b79 SONAR: addons: bond: Merge if statements with the enclosing ones
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
81348c3266 addons: bond: ignore exception raised during bond-slave speed check
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
921757c390 addons: bond: make sure bond speed and slaves (swps) speed are matching
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
421e9573b5 SONAR: fix iface.py: Import only needed names or import the module and then use its members.
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
4afb9b238f addons: bond: allow bond creation without slaves
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
17485c78a4 SONAR: addressvirtual: print exception message in exception handler
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
4a973d4066 SONAR: addressvirtual: Merge if statement with the enclosing one
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
2b8aedc960 SONAR: addressvirtual: Rename method "addr_metric_support"
Rename method "addr_metric_support" to prevent any misunderstanding/clash
with field "ADDR_METRIC_SUPPORT" defined on line 80

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
e8b9d3ab5d sonarlink: use opposite operator != instead of 'not'
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
c30ed567a8 SONAR: addons: address: Merge if statement with the enclosing one
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
a51aad8d60 add support for systemd logging
New CLI option: --systemd
will enabled journalctl logging when ifupdown2 is run in a systemd context

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
7c8627f876 SONAR: Specify an exception class to catch or reraise the exception
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-05-04 13:21:55 +02:00
9796acc7f3 Merge pull request #256 from tomvil/feat/ethtool_set_ring_max_value
addons: Allow to set `max` value in `--set-ring` option
2023-05-03 20:25:58 +02:00
080fc71a2f Merge pull request #258 from aderumier/vlanprotocol-query-check
vlan: query_check: check vlan-protocol for not dotted interface
2023-04-20 14:01:39 +02:00
3fee068a67 vlan: query_check: check vlan-protocol for not dotted interface
/etc/network/interfaces
-----------------------
auto eth0.100
iface eth0.100
        vlan-protocol 802.1ad

current
-------
ifquery -a -c

auto eth0.100
iface eth0.100                                                      [pass]

new
---
ifquery -a -c

auto eth0.100
iface eth0.100                                                      [pass]
        vlan-protocol 802.1ad                                       [pass]
2023-04-20 11:57:19 +02:00
70bd0e86e7 addons: Allow to set max value in --set-ring option
This makes some automation cases much easier

```
auto eth0
iface eth0 inet dhcp
  ring-rx max
  ring-tx max

Ring parameters for eth0:
Pre-set maximums:
RX:		4096
RX Mini:	n/a
RX Jumbo:	n/a
TX:		4096
Current hardware settings:
RX:		4096
RX Mini:	n/a
RX Jumbo:	n/a
TX:		4096
```

Signed-off-by: tomvil <tomas.vilemaitis@gmail.com>
2023-04-11 15:07:41 +03:00
5876ad8a0e Merge pull request #255 from tomvil/master
addons: Add `--set-ring` option to ethtool
2023-03-30 18:45:02 +02:00
7b80e01ff0 remove extra line from ethtool.py 2023-03-27 19:25:31 +03:00
8c35c09ddd addons: Add --set-ring option to ethtool
example:
```
auto eth0
iface eth0 inet dhcp
  ring-tx 1024
  ring-rx 1024
```

Signed-off-by: Tomas Vilemaitis
2023-03-27 18:46:58 +03:00
a49b5d2682 scheduler: env variable not properly set for user commands
Fixes #218

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-01-25 15:37:07 +01:00
a1bf8ffe5a Merge pull request #246 from aderumier/ovsfakebridge2
addons: openvswitch : add support for fakebridge.
2022-09-02 12:44:05 +02:00
39b395b1fd addons: openvswitch : add support for fakebridge.
Fake bridge are are ovsbridge child of a parent bridge with a specific vlan tag.

```
auto br-parent
iface br-parent inet manual
        ovs_type OVSBridge

auto br-fakev10
iface br-fakev10 inet manual
        ovs_type OVSBridge
        ovs_bridge br-parent
        ovs_options br-parent 10

```
2022-09-01 23:44:14 +02:00
1d6a726e5a Merge pull request #242 from talber-nvidia/fix-empty-output-from-subprocess
Fix the return value of utils._execute_subprocess
2022-07-06 19:20:37 +02:00
eee38e73c3 Fix the return value of utils._execute_subprocess
If the output of the subprocess is empty, then an empty <bytes> object
is returned (b''), and not decoded into an empty <string> object.
This may result in errors such as:
    info[109734]: executing /bin/ip -6 addr show eth0
    networking[109734]: error: eth0: cannot use a string pattern on a
        bytes-like object
    error[109734]: eth0: cannot use a string pattern on a bytes-like object
2022-07-06 18:36:38 +03:00
605d6e0962 Merge pull request #239 from sohorx/fix/distutils_dependency
distutils: fix dependency and lib replacement
2022-05-31 15:30:39 +02:00
95e4669536 Merge branch 'master' into fix/distutils_dependency 2022-05-31 15:30:16 +02:00
2558bf4fad Merge pull request #238 from sohorx/fix/gvgen_dependency
gvgen: fix module dependency
2022-05-31 15:28:20 +02:00
793fb44ab0 distutils: fix dependency and lib replacement
As of now, the distutils is deprecated with removal planned for
python 3.12.

The recommended way is to use setuptools which is an enhanced
alternative to distutils maintained by the python packaging authority.

This commit replace with setuptools the distutil import inserted in the
8126ef0c00eb8e2faae2cf1ca9fbaf25c10582cd commit.

This commit also update the debian control runtime dependency.

distutils: https://docs.python.org/3/library/distutils.html
setuptools: https://setuptools.pypa.io/en/latest/
2022-05-31 14:57:12 +02:00
b4cfbc67bf gvgen: fix module dependency
gvgen module require the six module from python3-six package.

This new dependency is only necessary for python2/python3 cross
compatibility on dict.iteritems() (py2) vs dict.items() (py3).

ifupdown2 does not support python2 so we could replace every iteritems
occurrences to it's python3 format but this means the gvgen module will
diff from upstream.

The simplest way is to make ifupdown depends on python3-six.
2022-05-31 10:59:43 +02:00
6bcb49088b Merge pull request #237 from svenauhagen/bugfix/bondarpcheck
addons: bond: fix ifquery for IFLA_BOND_ARP_IP_TARGET
2022-05-28 14:02:49 +02:00
10ddf286f3 sonar: lib: nlcache: catch exception only once
Catch this exception only once;
it is already handled by a previous except clause

Ticket: #3035926

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-28 12:14:33 +02:00
dee2c49d58 update contact info and copyright dates
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-28 11:40:16 +02:00
a98b38984c graph: fix GvGen import
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 15:00:33 +02:00
b0a7a8bb3e graph: import gvgen class into ifupdown2 package
python2's ifupdown2 used python-gvgen to output the dependency graph in dot
format. There's not python3 version of that package available in debian.
Resulting in: error: main exception: name 'GvGen' is not defined

The package is in fact a single class that is already compatible with python3
According to the license (MIT) we can pull in the code in our own tree.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 15:00:05 +02:00
70263054b3 addons: tunnel: support non-disruptive config change
Current design destroys existing tunnel when a config
change is detected. This behaviour causes traffic loss.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 14:54:41 +02:00
46be384512 addons: bridge: skip bridge mac check and force mac-set on bridge creation
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 14:33:56 +02:00
6861404b8e addons: bridge: fix bridge/vxlan learning sync mechanism
Old code was a bit messy and all over the place. This
resulted in a loophole breaking sync between bridge-learning
and vxlan-learning. This patch simplifies the existing code
and fixes the bug.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 14:30:35 +02:00
ab287bc42c addons: bridge: fix sync between bridge-learning and vxlan-learning
if not specified by the user vxlan brport learning is controlled by the
bridge_vxlan_port_learning policy (on by default).

4.4 introduced vxlan-learning off via policy. The syncing code between
bridge-learning and vxlan-learning was incomplete and was written at the
time when we didn't have a default vxlan-learning policy. This patch fixes
the sync-ing gap and makes sure vxlan-learning is sync'd with bridge-learning
which wasn't always the case before.

for every vxlan brport BRPORT_LEARNING is turned on

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 14:29:56 +02:00
1ac64c41d7 addons: bond: set IFLA_MASTER when updating bond settings
On bond creation and update, ifupdown2 directly caches the netlink
object sent to the kernel. If the bond already exists it overrides
the existing cached object. If the existing bond was enslaved to a
bridge, some bridge vlan data would get purged because the new
netlink object didn't have the IFLA_MASTER attribute (thus tricking
the cache into thinking that the bond got unslaved from the bridge).

Here is a snippet of the bond013 /en/i config in the first topology:

    auto bond013
    iface bond013
        bond-slaves swp1s3
        es-sys-mac 44:38:39:FF:00:02
        bridge-vids 101-144
        bond-lacp-bypass-allow yes
        mstpctl-portadminedge yes
        mstpctl-bpduguard yes

And here in the second topology:

    auto bond013
    iface bond013
          bond-slaves swp1s3
          es-sys-mac 44:38:39:FF:00:01
          bridge-vids 201-210
          bond-lacp-bypass-allow yes
          mstpctl-portadminedge yes
          mstpctl-bpduguard yes

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-05-27 14:21:06 +02:00