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

1675 Commits

Author SHA1 Message Date
577b903785 debian: changelog: new entry: 3.3.0
* New: performance improvement: replace glob.glob with os.listdir
  * New: bridge: Do not create untagged vlans on "external" vxlan ports
  * New: Attribute: "disable-ipv6" to control ipv6 on an interface
  * New: Policy: "default_loopback_scope" control loopback ip scope
  * Fix: keep link down after mac change if 'link-down yes' is specified
  * Fix: addressvirtual: stale mac detection is missing vrr without ip
  * Fix: bond: warn if sub interface is detected on bond slave
  * Fix: bridge: update bridge-fd valid range to 2-255

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
3.3.0
2023-12-20 18:09:49 +01:00
2945b67b6b bridge: Do not create untagged vlans on "external" vxlan ports
vxlan interfaces with the external flag get the vni for a frame based on
its vlan tag. If a frame is marked as untagged, the vxlan interface drops
the frame because there's no way to transmit a vxlan frame without a vni.

ifupdown2 configures the bridge pvid as an untagged vlan on single vxlan
interfaces. (Note that bridge-pvid is inherited from bridge to port and it
has a default value of 1.) This leads to the traffic being dropped for
traffic on that vlan. Avoid that problem by not configuring any vlans as
untagged on single vxlan interfaces.
2023-12-20 18:00:37 +01:00
74d286d18f addons: bridge: update bridge-fd valid range
valid range for bridge forward delay is 2-255

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:57:09 +01:00
c50aff4f70 addons: bond: warn if sub interface is detected on bond slave
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:54:17 +01:00
e15c8287cc SCALE: addressvirtual: replace glob.glob with listdir
using glob.glob is way to costly, use os.listdir to increase
performances.

Test with timeit show the following for 10k loop:
time_glob executed in 39.16788899600215 seconds
time_listdir executed in 5.625843115005409 seconds

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:51:06 +01:00
f494105031 addons: addressvirtual: stale mac address detection was missing vrr without ip
The stale mac verification code was only working for the following syntax:

address-virtual MAC IP
and not
address-virtual MAC

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:49:24 +01:00
d9bacfc2a7 netlink: keeping link down after mac change if 'link-down yes' is specified
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:47:09 +01:00
e7ecc5ddcd addons: address: new attribute: disable-ipv6
"disable-ipv6": {
                "help": "disable IPv6",
                "validvals": ['on', 'off', 'yes', 'no', '0', '1'],
                "default": "no",
                "aliases": ["disable-ip6"]
            }

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:44:38 +01:00
582b0acb9e addons: address: new policy default_loopback_scope
The loopback addresses on VRF devices is added with scope global.
The scope must be host to prevent the kernel using the address on external routing/addresses.

Since this change is CL specific we need to control this behavior via policy.
We will re-evaluate later if we make this the default behavior for upstream as well.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:40:08 +01:00
b63d4b4f0b main: update running time display
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:34:26 +01:00
b005469d46 main: display total running time after exit status
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2023-12-20 17:34:26 +01:00
7a28bcb61b Merge pull request from frwbr/dev/fix-stdout-wait
scheduler: avoid waiting for stdout eof of /etc/network/ scripts
2023-12-18 21:37:36 +01:00
427b7a7bba Merge pull request from markfeathers/postinst-source
debian: postinst: source /etc/network/interfaces.d/ in generated config
2023-12-08 22:36:27 +01:00
ccc6ac8fa5 debian: postinst: source /etc/network/interfaces.d/ in generated config 2023-12-08 11:07:57 -07:00
989508a237 Merge pull request 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
1303d9211d scheduler: avoid waiting for stdout eof of /etc/network/ scripts
Scripts in /etc/network/ are executed using `exec_command` which
captures stdout by default, and thus waits for stdout end-of-file via
`Popen.communicate()`. However, this can cause hangs if the network
script executes a long-running command in the background. Can be
reproduced by putting the following (executable) script in
/etc/network/if-up.d/:

	#!/bin/sh
	sleep 5&

This script will cause `ifreload -a` to wait for 5 seconds per network
interface.

To avoid waiting, do not capture stdout when executing /etc/network/
scripts. This also improves compatibility with ifupdown, which runs
the above script in the background.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
2023-09-28 14:01:34 +02:00
10b9cf6d90 Merge pull request 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 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 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 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 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 )
  * 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