diff --git a/rules/ifupdown2.mk b/rules/ifupdown2.mk index 0a7abd7b2f1..de44b0f5bd1 100644 --- a/rules/ifupdown2.mk +++ b/rules/ifupdown2.mk @@ -1,6 +1,6 @@ # ifupdown2 package -IFUPDOWN2_VERSION = 3.0.0-1 +IFUPDOWN2_VERSION = 3.9.0 export IFUPDOWN2_VERSION IFUPDOWN2 = ifupdown2_$(IFUPDOWN2_VERSION)_all.deb diff --git a/src/ifupdown2/patch/0004-Ensure-etc-iproute2-rt_tables.d-directory-present-fo.patch b/src/ifupdown2/patch/0001-Ensure-etc-iproute2-rt_tables.d-directory-present-fo.patch similarity index 89% rename from src/ifupdown2/patch/0004-Ensure-etc-iproute2-rt_tables.d-directory-present-fo.patch rename to src/ifupdown2/patch/0001-Ensure-etc-iproute2-rt_tables.d-directory-present-fo.patch index 700808c10c3..6ccb827df65 100644 --- a/src/ifupdown2/patch/0004-Ensure-etc-iproute2-rt_tables.d-directory-present-fo.patch +++ b/src/ifupdown2/patch/0001-Ensure-etc-iproute2-rt_tables.d-directory-present-fo.patch @@ -20,13 +20,13 @@ Signed-off-by: Ravi Minnikanti 1 file changed, 10 insertions(+) diff --git a/ifupdown2/addons/vrf.py b/ifupdown2/addons/vrf.py -index 206c118..83bba50 100644 +index 712c5fd..c88e5a5 100644 --- a/ifupdown2/addons/vrf.py +++ b/ifupdown2/addons/vrf.py -@@ -272,6 +272,13 @@ class vrf(Addon, moduleBase): - 'map (%s)\n' %errstr) +@@ -265,6 +265,13 @@ class vrf(Addon, moduleBase): + 'map (%s)' %errstr) self.warn_on_vrf_map_write_err = False - + + def _ensure_iproute2_vrf_dir(self): + """Ensure the iproute2 VRF map directory exists""" + vrf_dir = os.path.dirname(self.iproute2_vrf_filename) @@ -37,7 +37,7 @@ index 206c118..83bba50 100644 def _iproute2_vrf_map_sync_to_disk(self): if (ifupdownflags.flags.DRYRUN or not self.iproute2_vrf_map_sync_to_disk): -@@ -279,6 +286,7 @@ class vrf(Addon, moduleBase): +@@ -272,6 +279,7 @@ class vrf(Addon, moduleBase): self.logger.info('vrf: syncing table map to %s' %self.iproute2_vrf_filename) try: @@ -45,7 +45,7 @@ index 206c118..83bba50 100644 with open(self.iproute2_vrf_filename, 'w') as f: f.write(self.iproute2_vrf_filehdr %(self.vrf_table_id_start, self.vrf_table_id_end)) -@@ -294,6 +302,7 @@ class vrf(Addon, moduleBase): +@@ -286,6 +294,7 @@ class vrf(Addon, moduleBase): %self.iproute2_vrf_filename) if ifupdownflags.flags.DRYRUN: return @@ -53,7 +53,7 @@ index 206c118..83bba50 100644 fmode = 'a+' if append else 'w' if not append: # write file header -@@ -365,6 +374,7 @@ class vrf(Addon, moduleBase): +@@ -357,6 +366,7 @@ class vrf(Addon, moduleBase): old_vrf_name = self.iproute2_vrf_map.get(int(table_id)) if not old_vrf_name: self.iproute2_vrf_map[int(table_id)] = vrfifaceobj.name @@ -61,6 +61,5 @@ index 206c118..83bba50 100644 with open(self.iproute2_vrf_filename, "a+") as vrf_map_fd: vrf_map_fd.write('%s %s\n' % (table_id, vrfifaceobj.name)) --- +-- 2.25.1 - diff --git a/src/ifupdown2/patch/0001-fix-broadcast-addr-encoding.patch b/src/ifupdown2/patch/0001-fix-broadcast-addr-encoding.patch deleted file mode 100644 index 43ccbf0c636..00000000000 --- a/src/ifupdown2/patch/0001-fix-broadcast-addr-encoding.patch +++ /dev/null @@ -1,31 +0,0 @@ -Fix reading and using broadcast address - -When reading the broadcast address, convert it to an IPNetwork object, -so that it can be encoded/packed later. - -From: Saikrishna Arcot ---- - ifupdown2/addons/address.py | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/ifupdown2/addons/address.py b/ifupdown2/addons/address.py -index 8b99b25..2ca41fc 100644 ---- a/ifupdown2/addons/address.py -+++ b/ifupdown2/addons/address.py -@@ -441,11 +441,15 @@ class address(Addon, moduleBase): - else: - addr_obj = ipnetwork.IPNetwork(addr) - -- for attr_name in ("broadcast", "scope", "preferred-lifetime"): -+ for attr_name in ("scope", "preferred-lifetime"): - attr_value = ifaceobj.get_attr_value_n(attr_name, index) - if attr_value: - addr_attributes[attr_name] = attr_value - -+ broadcast = ifaceobj.get_attr_value_n("broadcast", index) -+ if broadcast: -+ addr_attributes["broadcast"] = ipnetwork.IPNetwork(broadcast) -+ - pointopoint = ifaceobj.get_attr_value_n("pointopoint", index) - try: - if pointopoint: diff --git a/src/ifupdown2/patch/0002-disable-checks-when-using-no-wait.patch b/src/ifupdown2/patch/0002-disable-checks-when-using-no-wait.patch deleted file mode 100644 index 2049b4b5dce..00000000000 --- a/src/ifupdown2/patch/0002-disable-checks-when-using-no-wait.patch +++ /dev/null @@ -1,36 +0,0 @@ -Don't check for a new IP address if dhcp-wait=no is set - -From: Saikrishna Arcot - -If dhcp-wait=no is specified in the ifupdown2 policy configuration, then -skip the check for a new IP address. When checking, dhclient probably -isn't done getting a new IP address from the DHCP server. - -This change is needed for ZTP (zero-touch provisioning) in SONiC. The -expectation is that dhclient will get started on all interfaces -(both management and in-band), and on some interfaces, there might not -be a DHCP server on the other end of the link. That'll mean that it may -get blocked here. - -SONiC ZTP needs dhclient to be started, but ifupdown2 shouldn't block on -dhclient being successful. ---- - ifupdown2/addons/dhcp.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/ifupdown2/addons/dhcp.py b/ifupdown2/addons/dhcp.py -index 9d5ce27..87f61e7 100644 ---- a/ifupdown2/addons/dhcp.py -+++ b/ifupdown2/addons/dhcp.py -@@ -103,7 +103,10 @@ class dhcp(Addon, moduleBase): - - while retry >= 0: - handler(ifname, **handler_kwargs) -- retry = self.dhclient_check(ifname, family, ip_config_before, retry, handler_kwargs.get("cmd_prefix")) -+ if handler_kwargs.get("wait", True): -+ retry = self.dhclient_check(ifname, family, ip_config_before, retry, handler_kwargs.get("cmd_prefix")) -+ else: -+ retry = -1 - - def dhclient_check(self, ifname, family, ip_config_before, retry, dhclient_cmd_prefix): - retry -= 1 diff --git a/src/ifupdown2/patch/0002-remove-ifupdown2d-from-setup-py.patch b/src/ifupdown2/patch/0002-remove-ifupdown2d-from-setup-py.patch new file mode 100644 index 00000000000..0f7dfdc530c --- /dev/null +++ b/src/ifupdown2/patch/0002-remove-ifupdown2d-from-setup-py.patch @@ -0,0 +1,26 @@ +From 231411a43b1ff9ef175c251be72fa02b938a077e Mon Sep 17 00:00:00 2001 +From: Spandan Chowdhury +Date: Tue, 31 Mar 2026 10:46:52 -0700 +Subject: [PATCH] Remove ifupdown2d from setup.py DATA_FILES + +The ifupdown2d daemon was removed from the source tree but setup.py +still references it in DATA_FILES for deb package builds, causing +the build to fail with a FileNotFoundError. + +Signed-off-by: Spandan Chowdhury +--- + setup.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/setup.py b/setup.py +index b555c7b..bf48297 100755 +--- a/setup.py ++++ b/setup.py +@@ -30,7 +30,6 @@ def build_deb_package(): + + + if build_deb_package(): +- DATA_FILES.append(('/usr/share/ifupdown2/', ['ifupdown2/ifupdown2d'])) + DATA_FILES.append(('/usr/share/ifupdown2/sbin/', ['ifupdown2/sbin/start-networking'])) + else: + ENTRY_POINTS = { diff --git a/src/ifupdown2/patch/0003-Fix-the-return-value-of-utils._execute_subprocess-me.patch b/src/ifupdown2/patch/0003-Fix-the-return-value-of-utils._execute_subprocess-me.patch deleted file mode 100644 index 39cd481099c..00000000000 --- a/src/ifupdown2/patch/0003-Fix-the-return-value-of-utils._execute_subprocess-me.patch +++ /dev/null @@ -1,21 +0,0 @@ -Fix the return value of utils._execute_subprocess method for empty strings ---- - ifupdown2/ifupdown/utils.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ifupdown2/ifupdown/utils.py b/ifupdown2/ifupdown/utils.py -index d638fe9..0c5d8ce 100644 ---- a/ifupdown2/ifupdown/utils.py -+++ b/ifupdown2/ifupdown/utils.py -@@ -380,7 +380,7 @@ class utils(): - finally: - utils.disable_subprocess_signal_forwarding(signal.SIGINT) - -- cmd_output_string = cmd_output.decode() if cmd_output else cmd_output -+ cmd_output_string = cmd_output.decode() if cmd_output is not None else cmd_output - - if cmd_returncode != 0: - raise Exception(cls._format_error(cmd, --- -2.14.1 - diff --git a/src/ifupdown2/patch/bug-296-python-3.12-compability.patch b/src/ifupdown2/patch/bug-296-python-3.12-compability.patch deleted file mode 100644 index 258bd2c9b70..00000000000 --- a/src/ifupdown2/patch/bug-296-python-3.12-compability.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Jan Huijsmans -Date: Tue, 9 Jul 2024 09:03:25 +0200 -X-Dgit-Generated: 3.0.0-1.3 25127847996b30ded7825cb98247e54478bdd350 -Subject: Bug #296: python 3.12 compability - -Since python 3.2, readfp needs to be replaced by read_file. -Python 3.12 dropped the readfp function. - -Patch provided as PR by me, as the original reporter failed to do -so since 4-4-2024 and my systems break due to this issue. - ---- - -diff --git a/ifupdown2/ifupdown/main.py b/ifupdown2/ifupdown/main.py -index 5ab07fa..141a922 100644 ---- a/ifupdown2/ifupdown/main.py -+++ b/ifupdown2/ifupdown/main.py -@@ -139,7 +139,7 @@ class Ifupdown2: - configStr = '[ifupdown2]\n' + config - configFP = io.StringIO(configStr) - parser = configparser.RawConfigParser() -- parser.readfp(configFP) -+ parser.read_file(configFP) - configmap_g = dict(parser.items('ifupdown2')) - - # Preprocess config map diff --git a/src/ifupdown2/patch/series b/src/ifupdown2/patch/series index 64b760a7a3a..dc5e81b9548 100644 --- a/src/ifupdown2/patch/series +++ b/src/ifupdown2/patch/series @@ -1,5 +1,2 @@ -0001-fix-broadcast-addr-encoding.patch -0002-disable-checks-when-using-no-wait.patch -0003-Fix-the-return-value-of-utils._execute_subprocess-me.patch -bug-296-python-3.12-compability.patch -0004-Ensure-etc-iproute2-rt_tables.d-directory-present-fo.patch +0001-Ensure-etc-iproute2-rt_tables.d-directory-present-fo.patch +0002-remove-ifupdown2d-from-setup-py.patch