[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#856868: unblock: ifupdown2/1.0~git20170223-1



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package ifupdown2

Hello,

Our latest upload made it into sid. This upload (1.0~git20170223-1) fixes all
the recent bugs we faced. This version fixes 2 bugs (1 serious and 1 important)

We would appreciate if you could unblock this latest version to allow our users
and stretch to benefit from these fixes.

Thank you,
Julien - Cumulus Networks

diff -Nru ifupdown2-1.0~git20170114/addons/tunnel.py ifupdown2-1.0~git20170223/addons/tunnel.py
--- ifupdown2-1.0~git20170114/addons/tunnel.py	1970-01-01 01:00:00.000000000 +0100
+++ ifupdown2-1.0~git20170223/addons/tunnel.py	2017-03-05 18:21:55.000000000 +0100
@@ -0,0 +1,151 @@
+#!/usr/bin/python
+#
+# Maximilian Wilhelm <max@rfc2324.org>
+#  --  Mon 10 Oct 2016 10:53:13 PM CEST
+#
+
+from ifupdown.iface import *
+from ifupdownaddons.modulebase import moduleBase
+from ifupdownaddons.iproute2 import iproute2
+import ifupdown.ifupdownflags as ifupdownflags
+import logging
+
+#
+# TODO: Add checks for ipip tunnels.
+#
+class tunnel (moduleBase):
+    _modinfo = { 'mhelp' : 'create/configure GRE/IPIP/SIT tunnel interfaces',
+                 'attrs' : {
+                   'mode' :
+                        { 'help' : 'type of tunnel as in \'ip link\' command.',
+                          'validvals' : ['gre' 'ipip', 'sit'],
+                          'required' : True,
+                          'example' : ['mode gre']},
+                   'local' :
+                        { 'help' : 'IP of local tunnel endpoint',
+                          'validvals' : ['<ipv4>', '<ipv6>'],
+                          'required' : True,
+                          'example' : ['local 192.2.0.42']},
+                   'endpoint' :
+                        { 'help' : 'IP of remote tunnel endpoint',
+                          'validvals' : ['<ipv4>', '<ipv6>'],
+                          'required' : True,
+                          'example' : ['endpoint 192.2.0.23']},
+                   'ttl' :
+                        { 'help' : 'TTL for tunnel packets',
+                          'validvals' : ['<number>'],
+                          'required' : False,
+                          'example' : ['ttl 64']},
+                   'tunnel-physdev' :
+                        { 'help' : 'Physical underlay device to use for tunnel packets',
+                          'validvals' : ['<interface>'],
+                          'required' : False,
+                          'example' : ['tunnel-physdev eth1']},
+                 }
+               }
+
+
+    def __init__ (self, *args, **kargs):
+        moduleBase.__init__ (self, *args, **kargs)
+        self.ipcmd = None
+
+
+    def _is_my_interface (self, ifaceobj):
+        if ifaceobj.addr_method == "tunnel" and ifaceobj.get_attr_value_first ('mode'):
+            return True
+        return False
+
+
+    def _up (self, ifaceobj):
+        attr_map = {
+            # attr_name -> ip route param name
+            'local' : 'local',
+            'endpoint' : 'remote',
+            'ttl' : 'ttl',
+            'tunnel-physdev' : 'dev',
+        }
+
+        mode = ifaceobj.get_attr_value_first ('mode')
+        attrs = {}
+
+        # Only include attributes which have been set and map ifupdown2 names
+        # to attribute names expected by iproute
+        for attr, iproute_attr in attr_map.items ():
+            attr_val = ifaceobj.get_attr_value_first (attr)
+            if attr_val != None:
+                attrs[iproute_attr] = attr_val
+
+        self.ipcmd.link_create (ifaceobj.name, mode, attrs)
+
+
+    def _down (self, ifaceobj):
+        if not ifupdownflags.flags.PERFMODE and not self.ipcmd.link_exists (ifaceobj.name):
+           return
+        try:
+            self.ipcmd.link_delete (ifaceobj.name)
+        except Exception, e:
+            self.log_warn (str (e))
+
+
+    def _query_check_n_update (self, ifaceobj, ifaceobjcurr, attrname, attrval,
+                               running_attrval):
+        if not ifaceobj.get_attr_value_first (attrname):
+            return
+
+        if running_attrval and attrval == running_attrval:
+           ifaceobjcurr.update_config_with_status (attrname, attrval, 0)
+        else:
+           ifaceobjcurr.update_config_with_status (attrname, running_attrval, 1)
+
+
+    def _query_check (self, ifaceobj, ifaceobjcurr):
+        if not self.ipcmd.link_exists (ifaceobj.name):
+            return
+
+        tunattrs = self.ipcmd.link_get_linkinfo_attrs (ifaceobj.name)
+        if not tunattrs:
+            ifaceobjcurr.check_n_update_config_with_status_many (ifaceobj, self.get_mod_attrs (), -1)
+            return
+
+        for attr in self.get_mod_attrs ():
+            if not ifaceobj.get_attr_value_first (attr):
+                continue
+
+            # Validate all interface attributes set in the config.
+            # Remote any leading 'tunnel-' prefix in front of the attr name
+            # when accessing tunattrs parsed from 'ip -d link'.
+            self._query_check_n_update (ifaceobj, ifaceobjcurr, attr,
+                                        ifaceobj.get_attr_value_first (attr),
+                                        tunattrs.get (attr.replace ("tunnel-", "")))
+
+
+    # Operations supported by this addon (yet).
+    _run_ops = {
+        'pre-up' : _up,
+        'post-down' : _down,
+        'query-checkcurr' : _query_check
+    }
+
+
+    def get_ops (self):
+        return self._run_ops.keys()
+
+
+    def _init_command_handlers (self):
+        if not self.ipcmd:
+            self.ipcmd = iproute2 ()
+
+
+    def run (self, ifaceobj, operation, query_ifaceobj = None, **extra_args):
+        op_handler = self._run_ops.get (operation)
+        if not op_handler:
+            return
+
+        if operation != 'query-running' and not self._is_my_interface (ifaceobj):
+            return
+
+        self._init_command_handlers ()
+        if operation == 'query-checkcurr':
+            op_handler (self, ifaceobj, query_ifaceobj)
+        else:
+            op_handler (self, ifaceobj)
diff -Nru ifupdown2-1.0~git20170114/config/addons.conf ifupdown2-1.0~git20170223/config/addons.conf
--- ifupdown2-1.0~git20170114/config/addons.conf	2017-01-14 04:15:27.000000000 +0100
+++ ifupdown2-1.0~git20170223/config/addons.conf	2017-03-05 18:21:55.000000000 +0100
@@ -1,4 +1,5 @@
 pre-up,link
+pre-up,tunnel
 pre-up,bond
 pre-up,batman_adv
 pre-up,vlan
@@ -35,3 +36,4 @@
 post-down,batman_adv
 post-down,usercmds
 post-down,link
+post-down,tunnel
diff -Nru ifupdown2-1.0~git20170114/debian/changelog ifupdown2-1.0~git20170223/debian/changelog
--- ifupdown2-1.0~git20170114/debian/changelog	2017-01-14 03:59:54.000000000 +0100
+++ ifupdown2-1.0~git20170223/debian/changelog	2017-02-23 11:24:37.000000000 +0100
@@ -1,3 +1,17 @@
+ifupdown2 (1.0~git20170223-1) unstable; urgency=medium
+
+  * drop the dependency to pkg_resources, hardcode version number (closes: #855401)
+  * adjust allow-hotplug behavior to ifupdown (closes: #855598)
+
+ -- Julien Fortin <julien@cumulusnetworks.com>  Thu, 23 Feb 2017 11:24:37 +0100
+
+ifupdown2 (1.0~git20170214-1) unstable; urgency=medium
+
+  * closes: #854325 debian: control: add back "Conflicts: ifupdown"
+  * New. Enabled: support for GRE/SIT tunnels
+
+ -- Julien Fortin <julien@cumulusnetworks.com>  Tue, 14 Feb 2017 21:47:26 +0100
+
 ifupdown2 (1.0~git20170114-1) unstable; urgency=medium
 
   * closes: #843848 diversion handling broken
diff -Nru ifupdown2-1.0~git20170114/debian/control ifupdown2-1.0~git20170223/debian/control
--- ifupdown2-1.0~git20170114/debian/control	2017-01-14 03:59:54.000000000 +0100
+++ ifupdown2-1.0~git20170223/debian/control	2017-02-23 11:24:37.000000000 +0100
@@ -12,6 +12,7 @@
 Suggests: python-gvgen, python-mako
 Replaces: ifupdown
 Provides: ifupdown
+Conflicts: ifupdown
 Depends: ${python:Depends}, ${misc:Depends}, python-argcomplete, python-ipaddr, iproute2
 Recommends: isc-dhcp-client | dhcp-client
 Description: Network Interface Management tool similar to ifupdown
diff -Nru ifupdown2-1.0~git20170114/debian/ifupdown2.preinst ifupdown2-1.0~git20170223/debian/ifupdown2.preinst
--- ifupdown2-1.0~git20170114/debian/ifupdown2.preinst	2017-01-14 03:59:54.000000000 +0100
+++ ifupdown2-1.0~git20170223/debian/ifupdown2.preinst	2017-02-23 11:24:37.000000000 +0100
@@ -27,14 +27,6 @@
             preinst_divert "/usr/share/man/man8/$filename.8.gz"
         done
         preinst_divert "/usr/share/man/man5/interfaces.5.gz"
-
-        # workaround 3.0.0 internal install error.  This can be removed in a
-        # few weeks.
-        if [ -f /etc/default/networking/networking.default ]; then
-            dpkg-maintscript-helper rm_conffile /etc/default/networking/networking.default 1.1 -- $@
-            rm -f /etc/default/networking/networking.default
-            rmdir /etc/default/networking
-        fi
         ;;
 esac
 
diff -Nru ifupdown2-1.0~git20170114/ifupdown/networkinterfaces.py ifupdown2-1.0~git20170223/ifupdown/networkinterfaces.py
--- ifupdown2-1.0~git20170114/ifupdown/networkinterfaces.py	2017-01-14 04:15:27.000000000 +0100
+++ ifupdown2-1.0~git20170223/ifupdown/networkinterfaces.py	2017-03-05 18:21:55.000000000 +0100
@@ -27,8 +27,8 @@
     callbacks = {}
     auto_all = False
 
-    _addrfams = {'inet' : ['static', 'manual', 'loopback', 'dhcp', 'dhcp6'],
-                 'inet6' : ['static', 'manual', 'loopback', 'dhcp', 'dhcp6']}
+    _addrfams = {'inet' : ['static', 'manual', 'loopback', 'dhcp', 'dhcp6', 'tunnel'],
+                 'inet6' : ['static', 'manual', 'loopback', 'dhcp', 'dhcp6', 'tunnel']}
 
     def __init__(self, interfacesfile='/etc/network/interfaces',
                  interfacesfileiobuf=None, interfacesfileformat='native',
diff -Nru ifupdown2-1.0~git20170114/ifupdownaddons/iproute2.py ifupdown2-1.0~git20170223/ifupdownaddons/iproute2.py
--- ifupdown2-1.0~git20170114/ifupdownaddons/iproute2.py	2017-01-14 04:15:27.000000000 +0100
+++ ifupdown2-1.0~git20170223/ifupdownaddons/iproute2.py	2017-03-05 18:21:55.000000000 +0100
@@ -103,6 +103,24 @@
                         linkattrs['state'] = citems[i + 1]
                     elif citems[i] == 'link/ether':
                         linkattrs['hwaddress'] = citems[i + 1]
+                    elif citems[i] in [ 'link/gre', 'link/sit' ]:
+                        linkattrs['kind'] = 'tunnel'
+                        tunattrs = {'mode' : citems[i].split ('/')[1],
+                                    'endpoint' : None,
+                                    'local' : None,
+                                    'ttl' : None,
+                                    'physdev' : None}
+                        for j in range(i + 2, len(citems)):
+                            if citems[j] == 'local':
+                                tunattrs['local'] = citems[j + 1]
+                            elif citems[j] == 'remote':
+                                tunattrs['endpoint'] = citems[j + 1]
+                            elif citems[j] == 'ttl':
+                                tunattrs['ttl'] = citems[j + 1]
+                            elif citems[j] == 'dev':
+                                tunattrs['physdev'] = citems[j + 1]
+                        linkattrs['linkinfo'] = tunattrs
+                        break
                     elif citems[i] == 'vlan':
                         vlanid = self._get_vland_id(citems, i, warn)
                         if vlanid:
diff -Nru ifupdown2-1.0~git20170114/sbin/ifupdown2 ifupdown2-1.0~git20170223/sbin/ifupdown2
--- ifupdown2-1.0~git20170114/sbin/ifupdown2	2017-01-14 04:15:27.000000000 +0100
+++ ifupdown2-1.0~git20170223/sbin/ifupdown2	2017-03-05 18:21:55.000000000 +0100
@@ -15,10 +15,11 @@
 import logging
 import logging.handlers
 import resource
-import pkg_resources
 from ifupdown.ifupdownmain import *
 from ifupdown.utils import *
 
+IFUPDOWN2_VERSION = '20170223-1'
+
 lockfile="/run/network/.lock"
 configfile="/etc/network/ifupdown2/ifupdown2.conf"
 configmap_g=None
@@ -397,10 +398,9 @@
 def update_common_argparser(argparser):
     ''' general parsing rules '''
 
-    package = pkg_resources.get_distribution("ifupdown2")
     argparser.add_argument('-V', '--version',
                 action='version',
-                version='ifupdown2:%(prog)s ' + package.version,
+                version='ifupdown2:%(prog)s ' + IFUPDOWN2_VERSION,
                 help='display current ifupdown2 version')
 
 def parse_args(argsv, op):
diff -Nru ifupdown2-1.0~git20170114/sbin/start-networking ifupdown2-1.0~git20170223/sbin/start-networking
--- ifupdown2-1.0~git20170114/sbin/start-networking	2017-01-14 04:15:27.000000000 +0100
+++ ifupdown2-1.0~git20170223/sbin/start-networking	2017-03-05 18:21:55.000000000 +0100
@@ -87,7 +87,8 @@
 			    do
 				    link=${iface##:*}
 				    link=${link##.*}
-				    if [ -e "/sys/class/net/$link" ] && [ "$(cat /sys/class/net/$link/operstate)" = up ]
+				    ip link set "$iface" up || true
+				    if [ "$(cat /sys/class/net/$link/operstate)" = up ]
 				    then
 					    echo "$iface"
 				    fi
diff -Nru ifupdown2-1.0~git20170114/setup.py ifupdown2-1.0~git20170223/setup.py
--- ifupdown2-1.0~git20170114/setup.py	2017-01-14 04:15:27.000000000 +0100
+++ ifupdown2-1.0~git20170223/setup.py	2017-03-05 18:21:55.000000000 +0100
@@ -16,7 +16,7 @@
                       'addons/dhcp.py', 'addons/usercmds.py',
                       'addons/ethtool.py',
                       'addons/addressvirtual.py', 'addons/vxlan.py',
-                      'addons/link.py', 'addons/vrf.py',
+                      'addons/link.py', 'addons/tunnel.py', 'addons/vrf.py',
                       'addons/bridgevlan.py', 'addons/batman_adv.py']),
                    ('/usr/share/ifupdown2/nlmanager/',
                     ['nlmanager/nllistener.py',


unblock ifupdown2/1.0~git20170223-1

-- System Information:
Debian Release: 9.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)


Reply to: