Fix duplicate MTU value when running oam-modify

A system oam-modify command will apply the OAM addressing
changes at runtime. When running the oam-modify on a Debian system,
the OAM interface obtains the updated addressing,
but the state is "DOWN" after the runtime manifest is complete.

This results in a duplicate MTU value being generated by
the network_config puppet module inside each interface config file,
which prohibits ifup/ifdown of the interface.

Testing:

PASS: Using "system oam_modify" to verify that:
  - The OAM interface is "UP" with the proper addressing
  - The MTU value is not duplicated
  - A subsequent ifdown/ifup works properly

PASS: Ensure that the MTU value is configurable on all interfaces

Closes-Bug: 2003375

Signed-off-by: Mohammad Issa <mohammad.issa@windriver.com>
Change-Id: I16dfb81437d5503f34422372f5284dd894e4b311
This commit is contained in:
Mohammad Issa 2023-01-19 20:36:39 +00:00
parent 2d970e2b79
commit 7a939f1640
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From be164ba7c835ff932674a73bd7adde90d5601c9b Mon Sep 17 00:00:00 2001
From: Mohammad Issa <mohammad.issa@windriver.com>
Date: Mon, 16 Jan 2023 21:20:21 +0000
Subject: [PATCH] Prevent MTU value from duplicating
A system oam-modify command will apply the OAM addressing
changes at runtime. When running the oam-modify on a Debian system,
the OAM interface obtains the updated addressing,
but the state is 'DOWN' after the runtime manifest is complete.
This results in a duplicate MTU value being generated by
the network_config puppet module inside each interface's config.
This prevents ifup/ifdown of the interface.
This change ensures there is no duplicating MTU value.
Signed-off-by: Mohammad Issa <mohammad.issa@windriver.com>
---
lib/puppet/provider/network_config/interfaces.rb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/puppet/provider/network_config/interfaces.rb b/lib/puppet/provider/network_config/interfaces.rb
index 487b243..94b7445 100644
--- a/lib/puppet/provider/network_config/interfaces.rb
+++ b/lib/puppet/provider/network_config/interfaces.rb
@@ -317,8 +317,7 @@ Puppet::Type.type(:network_config).provide(:interfaces) do
[
[:ipaddress, 'address'],
- [:netmask, 'netmask'],
- [:mtu, 'mtu']
+ [:netmask, 'netmask']
].each do |(property, section)|
stanza << "#{section} #{provider.send property}" if provider.send(property) && provider.send(property) != :absent
end
--
2.30.2

View File

@ -3,4 +3,5 @@
0003-set-routes-file-to-var-run-network-scripts.puppet.patch
0004-Save-dir-path-variable-with-distinct-names.patch
0005-Add-options-content-to-routes-file.patch
0006-Use-prefix_len-for-default-routes.patch
0006-Use-prefix_len-for-default-routes.patch
0007-Prevent-MTU-value-from-duplicating.patch