]> git.proxmox.com Git - ifupdown2.git/commitdiff
patch: don't remove bridge if tap|veth|fw are connected
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 13 Jun 2019 12:48:54 +0000 (14:48 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 14 Jun 2019 05:17:16 +0000 (07:17 +0200)
instead make a warning

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
debian/patches/pve/0006-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch [new file with mode: 0644]
debian/patches/pve/0007-add-uplink-id-option.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/pve/0006-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch b/debian/patches/pve/0006-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch
new file mode 100644 (file)
index 0000000..982537e
--- /dev/null
@@ -0,0 +1,34 @@
+From d4dd66be9bf4495c0dbf98d878d9121d7ed12b2f Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier@odiso.com>
+Date: Thu, 13 Jun 2019 14:34:59 +0200
+Subject: [PATCH] don't remove bridge is tap|veth are still plugged
+
+Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
+---
+ ifupdown2/ifupdown/ifupdownmain.py | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/ifupdown2/ifupdown/ifupdownmain.py b/ifupdown2/ifupdown/ifupdownmain.py
+index f520994..9f7641a 100644
+--- a/ifupdown2/ifupdown/ifupdownmain.py
++++ b/ifupdown2/ifupdown/ifupdownmain.py
+@@ -2067,7 +2067,15 @@ class ifupdownMain(ifupdownBase):
+                 # append it to the down list
+                 newifaceobjlist = new_ifaceobjdict.get(ifname)
+                 if not newifaceobjlist:
+-                    ifacedownlist.append(ifname)
++                    removebridge = 0
++                    if (ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind) == 'bridge'):
++                         runningbridgeports = os.listdir('/sys/class/net/%s/brif/' % ifname)
++                         for bport in runningbridgeports:
++                             if re.match('^(tap|veth|fwpr)',bport):
++                                 self.logger.warn("cant remove bridge %s, port %s is present " %(ifname,bport))
++                                 removebridge = 1
++                    if removebridge != 1:
++                        ifacedownlist.append(ifname)
+                     continue
+                 # If ifaceobj was present in the old interfaces file,
+                 # and does not have a config in the new interfaces file
+-- 
+2.20.1
+
diff --git a/debian/patches/pve/0007-add-uplink-id-option.patch b/debian/patches/pve/0007-add-uplink-id-option.patch
new file mode 100644 (file)
index 0000000..2f0bcb4
--- /dev/null
@@ -0,0 +1,29 @@
+From af2f2c44bea0a3a89f338d8e7cd5a8f61334a491 Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier@odiso.com>
+Date: Thu, 13 Jun 2019 14:40:17 +0200
+Subject: [PATCH] add uplink-id option
+
+Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
+---
+ ifupdown2/addons/address.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/ifupdown2/addons/address.py b/ifupdown2/addons/address.py
+index f576dc0..ce56ae6 100644
+--- a/ifupdown2/addons/address.py
++++ b/ifupdown2/addons/address.py
+@@ -111,6 +111,11 @@ class address(moduleBase):
+                               'validvals': ['yes', 'no'],
+                               'default' : 'no',
+                               'example' : ['mpls-enable yes']},
++                      'uplink-id' :
++                            { 'help': 'uplink-id',
++                              'validrange' : ['1', '4096'],
++                              'example' : ['uplink-id 1']},
++
+                     'ipv6-addrgen': {
+                         'help': 'enable disable ipv6 link addrgenmode',
+                         'validvals': ['on', 'off'],
+-- 
+2.20.1
+
index e1c10320d13ef930a294a0a7e635d7b42bd19418..d2ab37f7bac2a92dd7ae0a09d503830da657a282 100644 (file)
@@ -3,4 +3,5 @@ pve/0002-don-t-remove-tap-veth-fwpr-interfaces-from-bridge-on.patch
 pve/0003-add-dummy-mtu-bridgevlanport-modules.patch
 pve/0004-debian-fixup-networking.service.patch
 pve/0005-allow-vlan-subinterface-in-a-vlan-aware-bridge.patch
+pve/0006-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch
 extra/0001-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch