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

1661 Commits

Author SHA1 Message Date
ccc6ac8fa5 debian: postinst: source /etc/network/interfaces.d/ in generated config 2023-12-08 11:07:57 -07:00
989508a237 Merge pull request #283 from aderumier/vxlanfix
addons: vxlan: fix compare between remote-ips and old_remote_ips
2023-11-21 12:22:22 +01:00
08f8a21577 addons: vxlan: fix compare between remote-ips and old_remote_ips
fix regression from
35a4278ffb

remote-ips can be None (with evpn for example) but old_remote_ips is an empty list.
So the condition is always matching
2023-11-20 13:42:40 +01:00
10b9cf6d90 Merge pull request #271 from vincentbernat/fix/vnifilter
addons: vxlan: fix VNI filter on single VXLAN device
2023-09-04 22:55:41 +02:00
1707ffa1ce addons: vxlan: fix VNI filter on single VXLAN device
In af8d5db22b10909ff06032f1a2acc2f745d1f65b, the transformation of
`vnis` (list) to `vnisd` (dictionary) left a reference to `vnis` which
is now undefined. We just remove the line as the conversion from range
to ints is done earlier in the function.

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
2023-09-04 18:36:51 +02:00
2dd6ab123d Merge pull request #267 from aderumier/traceback
scheduler: import traceback
2023-06-26 11:26:05 +02:00
4b674a4c72 scheduler: import traceback
if a script in /etc/network/ifup.d/ is segfaulting,

on config loading (ifup -a), ifupdown2 is stopping

ifup -a
"
info: executing2 /etc/network/if-up.d/postfix
debug: lo: up : running script /etc/network/if-up.d/resolved
info: executing2 /etc/network/if-up.d/resolved
error: name 'traceback' is not defined
debug: saving state ..
info: exit status 1
"

with this fix:

debug: lo: up : running script /etc/network/if-up.d/resolved
info: executing2 /etc/network/if-up.d/resolved
  File "/usr/share/ifupdown2/ifupdown/scheduler.py", line 325, in run_iface_list
    cls.run_iface_graph(ifupdownobj, ifacename, ops, parent,
  File "/usr/share/ifupdown2/ifupdown/scheduler.py", line 315, in run_iface_graph
    cls.run_iface_list_ops(ifupdownobj, ifaceobjs, ops)
  File "/usr/share/ifupdown2/ifupdown/scheduler.py", line 188, in run_iface_list_ops
    cls.run_iface_op(ifupdownobj, ifaceobj, op,
  File "/usr/share/ifupdown2/ifupdown/scheduler.py", line 150, in run_iface_op
    ifupdownobj.log_error('%s: %s %s' % (ifacename, op, str(e)))
  File "/usr/share/ifupdown2/ifupdown/ifupdownmain.py", line 226, in log_error
    raise Exception(str)
error: lo : lo: up cmd '/etc/network/if-up.d/resolved' failed: returned -11
debug: vmbr0: found dependents ['bond0']
debug: bond0: found dependents ['enp65s0d1', 'enp65s0']
info: enp65s0d1: running ops ...
...
...
2023-06-26 11:14:26 +02:00
7e87bec996 Merge pull request #266 from aderumier/rxvlanfilter2
addons: ethtool: add rx-vlan-filter
2023-06-23 13:53:15 +02:00
d09833f93b addons: ethtool: add rx-vlan-filter
some nic like mellanox connectx don't work well with
vlan aware bridge && rx-vlan-filter.
(They are limited in number of vlans in hardware filtering,
and break with big number of vlans like bridge-vids 2-4096)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2023-06-23 09:23:08 +02:00
bc8dfef493 Merge pull request #263 from sohorx/fixes/process-interfaces
fix networkinterfaces processes
2023-06-20 22:48:23 +02:00
f6295df6a3 addons: ethtool: reset link-speed on downed swps
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-06-20 18:08:21 +02:00
cdb28715b0 set lanes in ethtool 2023-06-20 18:01:49 +02:00
cb8c67bc66 networkinterfaces: fix bad allow keyword
This commit fix the following by making an understandable error msg:
* the 'allow eth0' would make a IndexError shown to the user.
* the 'allow-' would be valid and use an empty classname.
2023-06-12 15:55:26 +02:00
a2d18a9d78 networkinterfaces: clean process_iface/vlan code
The only real change is the creation of a ifaceobj before testing it's
name. (The ifaceobj will still not be added if deemed invalid)
2023-06-12 15:31:34 +02:00
65b3f523f9 networkinterfaces: make allow/auto behave the same
This change goal is to make auto behave like allow-auto.
This commit will also provide the interfaces range capability to any
other allow-class names.
2023-06-12 15:31:34 +02:00
eb92c38042 networkinterfaces: make auto alias of allow-auto
The commit make the auto_ifaces container pointing to the
allow_classes['auto'] list. (since it's a mutable object, we get
the same instance)
2023-06-12 15:31:34 +02:00
7cebbec155 ifupdown.utils: fix itf range in argument
ifquery excluded the last digit of interfaces range given.
ex: eth[1-2] would give only eth1 instead of eth1 + eth2.

This commit fix this behavior by increasing the range in
expand_iface_range.
2023-06-12 15:31:34 +02:00
d5f0e51d22 ifupdown.utils: simplify expand_iface_range
Replace indexing by variables named start/end and prefix/suffix.
2023-06-12 15:31:34 +02:00
e71f2e6360 Merge pull request #262 from sohorx/arg/lockfile
replace lockfile global by a common argument
2023-06-12 15:18:57 +02:00
55cba57de6 ifupdown.argv: replace lockfile global by an arg 2023-06-06 18:49:35 +02:00
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