From d85b7af0fd6885d73e0a09bdba303dce633309c6 Mon Sep 17 00:00:00 2001 From: Olivier BLIN Date: Fri, 10 Nov 2023 18:36:11 +0100 Subject: [PATCH 1/4] Update from Debhelper 9 to Debhelper 13 --- debian/compat | 1 - debian/control | 2 +- debian/rules | 10 +++------- 3 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 debian/compat diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec635144..00000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control index ed87b395..821d05eb 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: ifupdown2 Section: admin Priority: optional Maintainer: Julien Fortin -Build-Depends: debhelper (>= 9.20160709), +Build-Depends: debhelper-compat (= 13), dh-python, python3, python3-all, diff --git a/debian/rules b/debian/rules index ea6f4342..da6ee66f 100755 --- a/debian/rules +++ b/debian/rules @@ -5,7 +5,7 @@ export PYBUILD_NAME=ifupdown2 export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/ --install-scripts=/usr/share/ %: - dh $@ --with=python3 --with systemd --buildsystem=pybuild + dh $@ --with=python3 --buildsystem=pybuild override_dh_installman: ./ifupdown2/man/genmanpages.sh ./ifupdown2/man ./man @@ -16,12 +16,8 @@ override_dh_install: mkdir -p debian/ifupdown2/lib/systemd/system/ install --mode=644 debian/ifup@.service debian/ifupdown2/lib/systemd/system/ - -override_dh_systemd_start: - dh_systemd_start --name=networking --no-start - -override_dh_systemd_enable: - dh_systemd_enable --name=networking +override_dh_installsystemd: + dh_installsystemd --name=networking --no-start override_dh_compress: dh_compress -X.py From 38497b1af071cb289bb91e6d3c438d14481ff269 Mon Sep 17 00:00:00 2001 From: Olivier BLIN Date: Fri, 10 Nov 2023 23:03:45 +0100 Subject: [PATCH 2/4] Fix lintian warnings in changelog --- debian/changelog | 146 +++++++++++++++++++++++------------------------ 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/debian/changelog b/debian/changelog index 93b32982..f42f65c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,84 +19,84 @@ ifupdown2 (3.2.0) unstable; urgency=medium ifupdown2 (3.1.0-1) unstable; urgency=medium - * New: ifquery-check now validates admin state - * New: bond: bond mac should always be inherited from it's first slave - - * New: macvlan/addressvirtual features: - - check interface name lenght and warn if len > 15 - - sync macvlan forwarding state with lower-device - - * New: vxlan features: - - Single vxlan device support (bridge-vlan-vni-map) - New attributes: - - vxlan-mcastgrp-map (vxlan multicast group for single-vxlan device) - - vxlan-vnifilter (vxlan vni filter for single-vxlan device) - - vxlan-remoteip-map (static HREP entries for static single vxlan dev) - - vxlan-tos (ToS value) - - vxlan-udp-csum (whether to perform checksumming or not) - New policy: - - vxlan-support-mix-dev-types: allow mix of traditional and single - vxlan device (default to yes) - - * New: bridge features: - - add multi bridge support for bridge_set_static_mac_from_port=yes - - check if bridge mac is already inherited from a port - - detect VXLAN mis-config VNI "bridge-learning=on" and warn - - detect and warn when arp suppression is enabled but no vlan config - - bridge-arp-nd-suppress with ifquery --with-default if policy is set - - enable ipv6 on SVD brport - - enable forwarding on dhcp bridges (fixes: #179) - New attribute: - - bridge-vlan-vni-map (single vxlan device support) - New policy: - - bridge_always_up_dummy_brport - - * New: address features: - - warn user if L3-SVI is configured with "ip-forward off" - - enable ipv6 before adding new address - New policies: - - check_l3_svi_ip_forwarding (check ip forward on l3 svi, default off) - - ip_blacklist: blacklist specific ip addresses - - * New: vlan features: - - check vlan-id misconfiguration and print warning - New attribute: - - vlan-bridge-binding (if enabled link state is no longer automatically - transferred from the lower device) - - * Fix: address: remove stale fdb entry for svi (when hwaddress is used) - * Fix: usercmds: Set environment just like the original ifupdown - * Fix: update mako template warning (python3-mako) - * Fix: batman_adv: fix unresolved reference + * New: ifquery-check now validates admin state + * New: bond: bond mac should always be inherited from it's first slave + + * New: macvlan/addressvirtual features: + - check interface name lenght and warn if len > 15 + - sync macvlan forwarding state with lower-device + + * New: vxlan features: + - Single vxlan device support (bridge-vlan-vni-map) + New attributes: + - vxlan-mcastgrp-map (vxlan multicast group for single-vxlan device) + - vxlan-vnifilter (vxlan vni filter for single-vxlan device) + - vxlan-remoteip-map (static HREP entries for static single vxlan dev) + - vxlan-tos (ToS value) + - vxlan-udp-csum (whether to perform checksumming or not) + New policy: + - vxlan-support-mix-dev-types: allow mix of traditional and single + vxlan device (default to yes) + + * New: bridge features: + - add multi bridge support for bridge_set_static_mac_from_port=yes + - check if bridge mac is already inherited from a port + - detect VXLAN mis-config VNI "bridge-learning=on" and warn + - detect and warn when arp suppression is enabled but no vlan config + - bridge-arp-nd-suppress with ifquery --with-default if policy is set + - enable ipv6 on SVD brport + - enable forwarding on dhcp bridges (fixes: #179) + New attribute: + - bridge-vlan-vni-map (single vxlan device support) + New policy: + - bridge_always_up_dummy_brport + + * New: address features: + - warn user if L3-SVI is configured with "ip-forward off" + - enable ipv6 before adding new address + New policies: + - check_l3_svi_ip_forwarding (check ip forward on l3 svi, default off) + - ip_blacklist: blacklist specific ip addresses + + * New: vlan features: + - check vlan-id misconfiguration and print warning + New attribute: + - vlan-bridge-binding (if enabled link state is no longer automatically + transferred from the lower device) + + * Fix: address: remove stale fdb entry for svi (when hwaddress is used) + * Fix: usercmds: Set environment just like the original ifupdown + * Fix: update mako template warning (python3-mako) + * Fix: batman_adv: fix unresolved reference -- Julien Fortin Mon, 05 Jul 2021 23:42:42 +0200 ifupdown2 (3.0.0-1) unstable; urgency=medium - * New: python3 support - * New: attribute alias support - * New: bridge-always-up attribute - * New: set bridge mtu with policy default - * New: ES bond with "es-sys-mac" attribute - * New: vxlan attribute: vxlan-mcastgrp-map - * New: support for "veth-peer-name" attribute - * New: dhcp policy: dhclient_retry_on_failure - * New: support for marking interfaces as mgmt interfaces - * New: bridge-vlan-vni-map attribute (single vxlan device) - * New: dhcp: skipping dhcp configuration if link-down yes - * New: vrf-slave: keep vlan down if lower device has "link-down yes" - * New: vxlan: support for vxlan-svcnodeip6 and vxlan-mcastgrp6 (fixes #43) - * New: support for add ovs-ports-condone-regex attribute (openvswitch) - * Fix: dry-run exceptions - * Fix: bond enslavement ordering - * Fix: process MTU before addrgen - * Fix: set bridge MTU after bridge creation - * Fix: ifquery-running: incorrect displayed data - * Fix: tunnel configuration compatibility with ifupdown1 - * Fix: start-networking script is back to handle mgmt & hotplug cases - * Fix: devices matching with ".{0,13}\-v" could get removed by ifreload - * Fix: mstpctl: check mstpctl-stp and bridge-stp and fix bridge cache update - * Removing python-argcomplete dependency + * New: python3 support + * New: attribute alias support + * New: bridge-always-up attribute + * New: set bridge mtu with policy default + * New: ES bond with "es-sys-mac" attribute + * New: vxlan attribute: vxlan-mcastgrp-map + * New: support for "veth-peer-name" attribute + * New: dhcp policy: dhclient_retry_on_failure + * New: support for marking interfaces as mgmt interfaces + * New: bridge-vlan-vni-map attribute (single vxlan device) + * New: dhcp: skipping dhcp configuration if link-down yes + * New: vrf-slave: keep vlan down if lower device has "link-down yes" + * New: vxlan: support for vxlan-svcnodeip6 and vxlan-mcastgrp6 (fixes #43) + * New: support for add ovs-ports-condone-regex attribute (openvswitch) + * Fix: dry-run exceptions + * Fix: bond enslavement ordering + * Fix: process MTU before addrgen + * Fix: set bridge MTU after bridge creation + * Fix: ifquery-running: incorrect displayed data + * Fix: tunnel configuration compatibility with ifupdown1 + * Fix: start-networking script is back to handle mgmt & hotplug cases + * Fix: devices matching with ".{0,13}\-v" could get removed by ifreload + * Fix: mstpctl: check mstpctl-stp and bridge-stp and fix bridge cache update + * Removing python-argcomplete dependency -- Julien Fortin Tue, 04 Aug 2020 23:42:42 +0200 From 2f92e4cd38d85af244d67d76552febae9564d8ba Mon Sep 17 00:00:00 2001 From: Olivier BLIN Date: Fri, 10 Nov 2023 13:08:12 +0100 Subject: [PATCH 3/4] Ensure ifupdown2 runtime directory always exists The /run/network directory is used by ifupdown2 for locks and state files. This directory is created at service startup (networking). But if we want, for example, to use ifquery before network start, it fails. We can ensure that /run/network directory is always present with systemd-tmpfiles. We could do it with systemd RuntimeDirectory in the networking service, but it does not seem to be the right method with the standalone mode. Like /run/network, we can move /etc/network/run symlink creation in ifupdown2 tmpfiles --- debian/ifupdown2.tmpfiles | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 debian/ifupdown2.tmpfiles diff --git a/debian/ifupdown2.tmpfiles b/debian/ifupdown2.tmpfiles new file mode 100644 index 00000000..6db85c28 --- /dev/null +++ b/debian/ifupdown2.tmpfiles @@ -0,0 +1,5 @@ +# Manage ifupdown2 runtime directory + +#Type Path Mode UID GID Age Argument +d /run/network 0775 root root - - +L /etc/network/run - - - - /run/network From f7a3270a83ac55b770a6aa836f8edf0c4744a38c Mon Sep 17 00:00:00 2001 From: Olivier BLIN Date: Mon, 13 Nov 2023 12:05:30 +0100 Subject: [PATCH 4/4] Remove /run/network directory creation in codebase and /etc/network/run directory symlink. We no longer need to worry about the existence of this directory. The system handles the creation. --- etc/init.d/networking | 5 +---- ifupdown2/ifupdown/statemanager.py | 3 --- ifupdown2/sbin/start-networking | 4 ---- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/etc/init.d/networking b/etc/init.d/networking index b52bfdca..0cd1843f 100644 --- a/etc/init.d/networking +++ b/etc/init.d/networking @@ -6,7 +6,7 @@ # Default-Start: S # Default-Stop: 0 6 # Short-Description: Raise network interfaces. -# Description: Prepare /run/network directory, ifstate file and raise network interfaces, or take them down. +# Description: Prepare ifstate file and raise network interfaces, or take them down. ### END INIT INFO RUN_DIR="/run/network" @@ -128,9 +128,6 @@ ifup_hotplug () { ifupdown_init() { # remove state file at boot [ ! -e ${IFSTATE_LOCKFILE} ] && rm -f ${IFSTATE_FILE} - [ ! -e /run/network ] && mkdir -p /run/network &>/dev/null - [ ! -e /etc/network/run ] && \ - ln -sf /run/network /etc/network/run &>/dev/null } case "$1" in diff --git a/ifupdown2/ifupdown/statemanager.py b/ifupdown2/ifupdown/statemanager.py index 0cd58722..98c96b17 100644 --- a/ifupdown2/ifupdown/statemanager.py +++ b/ifupdown2/ifupdown/statemanager.py @@ -107,9 +107,6 @@ def init(self): except Exception as e: raise Exception("statemanager: unable to create required directory: %s" % str(e)) - if not os.path.exists(self.state_rundir): - os.makedirs(self.state_rundir) - self.state_file = "%s/%s" % (self.state_dir, self.state_filename) def _init_makedirs_state_dir(self): diff --git a/ifupdown2/sbin/start-networking b/ifupdown2/sbin/start-networking index 8f790a09..afd295be 100755 --- a/ifupdown2/sbin/start-networking +++ b/ifupdown2/sbin/start-networking @@ -108,10 +108,6 @@ ifup_mgmt () { ifupdown_init() { # remove state file at boot [ ! -e ${IFSTATE_LOCKFILE} ] && rm -f ${IFSTATE_FILE} - - [ ! -e /run/network ] && mkdir -p /run/network &>/dev/null - [ ! -e /etc/network/run ] && \ - ln -sf /run/network /etc/network/run &>/dev/null } case "$1" in