]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
9 years agomove udev script processing to before restarting networking
Roopa Prabhu [Thu, 7 May 2015 23:13:52 +0000 (16:13 -0700)]
move udev script processing to before restarting networking

Testing Done:
(cherry picked from commit 70e4c52d2c9def58a073c8c09c59010cd90f3bd9)
(cherry picked from commit 5b22e2e9bec3ce12530755e1c31993d573bc7e77)

9 years agoAdd default link parameter support for ethtool module
Sam Tannous [Sun, 10 May 2015 19:42:47 +0000 (15:42 -0400)]
Add default link parameter support for ethtool module

Testing Done: tested master and 2.5_br images with testifupdown2 suite and hand tested

This patch creates a json defaults file upon bootup
(which can be overridden by customer configs in /etc)
which the ethtool module in ifupdown2 will consult
when "link-x" configs are removed in order to restore
them to the initial settings used by the switch.
(cherry picked from commit 8388664f5a5a85f2a813cafbf40ac92d7b86f4bf)

Conflicts:
packages/cl-utilities/dist-packages/cumulus/portconfig.py
packages/cl-utilities/usrlib/update-ports
tests/tests/smoke/testifupdown2.py

9 years agoFix bridge pvid add/del order
Roopa Prabhu [Thu, 30 Apr 2015 19:59:16 +0000 (12:59 -0700)]
Fix bridge pvid add/del order

Testing Done: Tested with test case in the bug and other orders

kernel(upstream and us) does not seem to honor the vidinfo flags
during the deletes. Hence, this reordering becomes necessary.

tested with the example in the bug and also some other examples.

code wise this combines two existing methods but leaves the two existing methods
around for future use. Will remove them if they become completely
unnecessary.
(cherry picked from commit 992906e0771b7415cbd8c03563a99a8f050415bd)
(cherry picked from commit 1ad488b44e1a9a0e059765e8ee4a19164b386dfe)

9 years agoFix ifreload man page to include the new behaviour where it does not
Roopa Prabhu [Tue, 28 Apr 2015 12:38:15 +0000 (05:38 -0700)]
Fix ifreload man page to include the new behaviour where it does not
down all changed interfaces

Testing Done: Tested man page
(cherry picked from commit 93ecf73b22d317dcf2a0924030f34f008fc25c33)
(cherry picked from commit 73d846c447d575a72822abd5ac5d5d758e9686e5)

9 years agoDont down an interface during ifreload just because the number of iface
Roopa Prabhu [Tue, 28 Apr 2015 04:18:14 +0000 (21:18 -0700)]
Dont down an interface during ifreload just because the number of iface
sections for that interface changed

Testing Done: tested ifreload with new iface section

problem stmt:
if the user adds a new section for an existing interface, I mark the
interface for down.
Basically the below:

               if len(newifaceobjlist) != len(lastifaceobjlist):
                    ifacedownlist.append(ifname)
                    continue

You rarely need to add a new section to the interfaces file. It is not
recommended even by the user guide.
sankaran was trying to add a new address. Which he could have added to
the same iface section.

But, looking at his trivial example, i am thinking of not marking an
interface for down if the user merely tried to add a new section to an
existing interface
(cherry picked from commit 65c62c02981cf6e2677b18c0aafcb3f2bd737b1b)
(cherry picked from commit 4453b1921fc3f8e959131cb5e1b9e79e0433cc08)

9 years agoFix addons man page for a few mstpctl defaults
Roopa Prabhu [Mon, 27 Apr 2015 22:38:07 +0000 (15:38 -0700)]
Fix addons man page for a few mstpctl defaults

Testing Done: build and tested man page
(cherry picked from commit 540aa30332a3c49e8a2be2c3975a3a24dbbf1209)
(cherry picked from commit 9426b13318950a6d285e6dcc1844d8cdc0d140df)

9 years agoifupdown2: fixup maintainer scripts
Jonathan Toppins [Tue, 21 Apr 2015 21:07:46 +0000 (14:07 -0700)]
ifupdown2: fixup maintainer scripts

Testing Done: of course none ;) Will update when I have some time to test

fupdown2's postinst and postrm scripts do not conform to Debian's policy
for maintainer scripts [1]. Specific non-conformance follows:

* fixed maintainer scripts so they only use /bin/sh as other shells are
  non-essential packages and may not exist on the system
* fixed maintainer scripts so only actions specified by $1 are performed
  per run of the script
* fixed maintainer scripts to only support specific values for $1, and
  will otherwise exit with error
* included at the bottom of the postrm script the "#DEBHELPER#" tag as
  during package building debianhelper will inject extra code at this
  location

[1] https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
(cherry picked from commit 2289fe4e90a0134fcb07fe7e2e838de755d73e68)

9 years agoadd new ifupdown2.conf option ifreload_down_changed to control ifreload
Roopa Prabhu [Sat, 25 Apr 2015 22:33:28 +0000 (15:33 -0700)]
add new ifupdown2.conf option ifreload_down_changed to control ifreload
ifdown behaviour.

Testing Done: tested ifreload evo test case

ifreload_down_changed is 0 by default which will make
sure ifreload will not execute down on changed interfaces
but only on deleted interfaces making it non-disruptive.

some notes from CCR:

ifreload was designed to be an optimization for 'service networking
restart' or 'ifdown -a + ifup -a'.
essentially it is a combination of 'ifdown + ifup' with some smarts in
which interfaces it will execute ifdown on.

By default it does the below:
ifdown all interfaces that were deleted from the interfaces file
ifdown all interfaces that were changed from the last time they were
ifup'ed
ifup -a (execute ifup on all interfaces marked auto)

Did not realize people will use ifreload as much as they do today. Also,
they may execute it on a production box when changes are made. ifdown on a production box can be
disruptive because if the ifdown which is part of the ifreload.

To have a non-disruptive option to ifreload, 2.5 added a new option -c
that only executed 'ifup' on all interfaces. Thus reloading all auto +
any other interfaces that were once brought up on the box (essentially
all interfaces present in the saved state file). This by default did not
do anything to the interfaces that got deleted from the file. But had an
ifupdown2.conf toggle to do so.

Looking at the evo use case, they do want to use a single command that
modifies, adds, deletes with
minimum disruption. we can achieve maybe what they want with multiple
commands (But there is also a case of a bug in the build evo is running
which makes it not so easy ).

This patch fixes the bug and also tries to change the default ifreload
behaviour controllable via a variable in ifupdown2.conf.
when ifreload_down_changed=0 in ifupdown2.conf, ifreload will only
ifdown interfaces that were deleted
from the file but not the ones that changed. subsequent ifup as part of
ifreload on the interfaces
that changed will apply the delta. And ifreload_down_changed default
value is '0'.

WIth the patch, ifreload by default will do the below (going back to the
previous default is just a toggle in the ifupdown.conf file):
ifdown all interfaces that were deleted from the interfaces file
ifup -a (execute ifup on all interfaces marked auto)

It sounds like a big change of behaviour for a hotfix release, but
essentially the patch just moves a few things around. And the change in
behaviour is so subtle that it is not very visible.
It just makes it non-disruptive.
(cherry picked from commit 2f7977834d4912a69159d27e54ba201f58a321d8)
(cherry picked from commit 09f283009e7de62ef1d258de81c94cc86fa13323)
(cherry picked from commit 898562e0e2284ccdc201dafc62b25b928037e0c6)

9 years agorework error message
Roopa Prabhu [Sat, 4 Apr 2015 05:33:53 +0000 (22:33 -0700)]
rework error message

Testing Done: tested interfaces file with shared dependents
(cherry picked from commit 671535a300f366cf690cf96b6ad667c66db22497)
(cherry picked from commit b2c1cffa2ea6740eceacde57d59449057c6bcb82)

9 years agoAdd check for shared dependents during building dependency list
Roopa Prabhu [Sat, 4 Apr 2015 04:24:25 +0000 (21:24 -0700)]
Add check for shared dependents during building dependency list

Testing Done: Tested with shared slaves in bridge and bonds
(cherry picked from commit 6f990450001d367a775681a29cdce74f862f7848)
(cherry picked from commit 8d9a5107112628ee8434e227dff49a0ef09966ee)

9 years agoDont follow dependents during down of interfaces as part of ifreload
Roopa Prabhu [Sat, 4 Apr 2015 03:47:06 +0000 (20:47 -0700)]
Dont follow dependents during down of interfaces as part of ifreload

Testing Done: tested ifreload with example in the bug

ifdown of the bridge svi was following the lowerdev and downing the
bridge. kernel implicitly deletes all svi's on bridge down.
ifup of the bridge usually handles it, but a change done in 2.5.1
was causing it not to. Thinking about this some more, its safe
to not follow dependents on down during a ifreload. This patch does
just that.
(cherry picked from commit 03f7a376aee944b4037b7b7b02a5096e9360f79e)
(cherry picked from commit aac5777ecc7d367ada0681f813fbec7f78fa80ee)

9 years agoifupdown2 loses interfaces on second down of swp port
Sam Tannous [Fri, 24 Apr 2015 00:19:22 +0000 (20:19 -0400)]
ifupdown2 loses interfaces on second down of swp port

Testing Done: tested bridge and bonds with interfaces with configs

Both bridge and mstpctl modules set priv_flags on interfaces
that have configs (like link-speed) even when used as bridge-ports.
And this collision causes statemanager.ifaceobj_sync() to never get called
because ifaceobj.priv_flags is 1 (we return immediately):
The fix was to create a new iface module_flags array to carry module info.
(cherry picked from commit 56924fef20984fd959939bf7f17c3dd6fd6b137a)
(cherry picked from commit 28d96f7643e2885b1f9c17ad9324a6dbb1b0f8c7)

9 years agoifupdown2: fixup maintainer scripts to not crash on files not existing
Jonathan Toppins [Mon, 20 Apr 2015 20:41:05 +0000 (13:41 -0700)]
ifupdown2: fixup maintainer scripts to not crash on files not existing

In addition fixed up the Debian maintainer scripts to prevent a
potential upgrade failure, discussion follows:

The Cause For the upgrade Failure
=================================

A commit introduced changes to
ifupdown2's package maintainer scripts to override some files provided
by the bridge-utils and udev packages as they conflict with ifupdown2.

The change to ifupdown2's postrm script is currently causing the script
to exit with a failure code if the following files do not exist on the
box:
/etc/udev/rules.d/80-networking.rules
/etc/udev/rules.d/60-bridge-network-interface.rules

The reason for this is in how the script is written.

Since the postrm script is configured to exit on the first command
failure, the "set -e" on line 3, the commands on lines 20 and 22 will
fail if the files being looked for do not exist, causing the script to
exit with a non-zero exit code. Causing apt to fail the upgrade.

.postrm script excerpt
----------
20 udevlink=$(readlink /etc/udev/rules.d/80-networking.rules 2>/dev/null)
21 [ -n "$udevlink" -a "$udevlink" == "/dev/null" ] && rm -f /etc/udev/rules.d/80-networking.rules
22 udevlink=$(readlink /etc/udev/rules.d/60-bridge-network-interface.rules 2>/dev/null)
23 [ -n "$udevlink" -a "$udevlink" == "/dev/null" ] && rm -f /etc/udev/rules.d/60-bridge-network-interface.rules
----------

Solution
--------

The solution requires having the newer version of the ifupdown2 package
provide a preinst script that gets run before the older package's postrm
script is run[1,2]. This gives us the opportunity to quietly fix the
problem. We also fix the postrm script in newer versions of the package
so it cannot bomb out in this way.

Finally, removed what appears to be a poor merge from commit
5f5d84e3261bf70dd3541666a3d3a7f817727ce6.

Fixes: 8959e8e4ec93487228733b17ef2b220ed47c1260
(cherry picked from commit 0eab79eb5aed4cdf0674e3f0ddad3631dd457bdc)

Conflicts:
packages/cl-utilities/debian/postinst
packages/cl-utilities/debian/prerm

9 years agoAdd config len check to iface compare
Roopa Prabhu [Sat, 4 Apr 2015 03:33:28 +0000 (20:33 -0700)]
Add config len check to iface compare

Testing Done: Tested ifreload with steps in the bug

9 years agoModified ifupdown support for vxlan head end replication
Wilson Kok [Wed, 15 Apr 2015 16:48:12 +0000 (09:48 -0700)]
Modified ifupdown support for vxlan head end replication

Replaced vxlan-peernodeip attribute with vxlan-remoteip.  Updated
the vxlan and iproute2 modules to configure head end replication
using bridge fdb commands.
(cherry picked from commit 567f445fc4a1828fc2aac0da3f2402a185656cb5)

Conflicts:
packages/ifupdown2/addons/vxlan.py
packages/ifupdown2/ifupdownaddons/iproute2.py

Conflicts:
ifupdown2/addons/vxlan.py
ifupdown2/ifupdownaddons/iproute2.py

9 years agoPrevent MTU from being set to 1500 on interface downing.
Sam Tannous [Wed, 18 Mar 2015 01:59:15 +0000 (21:59 -0400)]
Prevent MTU from being set to 1500 on interface downing.

MTU settings are defaulted 1500 when interface is ifdowned.
This has the effect of changing the MTU on the interface and any subinterfaces to
1500.  And if these subinterfaces are in a bridge, the bridge will pick the MIN MTU
so the bridge keeps this MTU even after the interface is brought back up. The sub
interface does not change to a higher value then 1500 (kernel VLAN driver only
moves the MTU is the decreasing direction.
(cherry picked from commit 70e67ab15efb13e1499288152d801b39f28a190b)
(cherry picked from commit 56238543a980e983957a180c583b9412c3ab48ab)

9 years agoCorrect error message for unsupported ifupdown2 attributes
Sam Tannous [Tue, 10 Mar 2015 20:46:07 +0000 (16:46 -0400)]
Correct error message for unsupported ifupdown2 attributes

Corrected a minor error in how we handle unsupported config attributes.
Instead of

     error: not enough arguments for format string

we will now print this:

     warning: peerlink.4000: unsupported attribute 'clagd-foobar'
(cherry picked from commit 44c6004a33d59ee234f8ee3d5f450e158c9e5bdc)
(cherry picked from commit f2c2321301d05e88d3c9ab9c26e6d4e256c884e9)

9 years agoRemove docs.addons since its now merged with the main ifupdown2
Roopa Prabhu [Tue, 10 Mar 2015 20:52:55 +0000 (13:52 -0700)]
Remove docs.addons since its now merged with the main ifupdown2
documentation in the docs dir

9 years agoMove python-ifupdown2 addons documentation into the ifupdown2 folder.
Roopa Prabhu [Tue, 10 Mar 2015 20:46:08 +0000 (13:46 -0700)]
Move python-ifupdown2 addons documentation into the ifupdown2 folder.

9 years agoRemove ifupdown2-addons (ifupdown2-addons contents are now merged into
Roopa Prabhu [Sun, 8 Mar 2015 17:04:54 +0000 (10:04 -0700)]
Remove ifupdown2-addons (ifupdown2-addons contents are now merged into
ifupdown2)

This simplifies ifupdown2 package management. Addon modules can be still
installed via third party modules outside of ifupdown2

9 years agoAdd note in readme regarding python-ifupdown2-addons being merged into
Roopa Prabhu [Sat, 7 Mar 2015 06:45:43 +0000 (22:45 -0800)]
Add note in readme regarding python-ifupdown2-addons being merged into
python-ifupdown2

9 years agoAdd note in readme regarding python-ifupdown2-addons being merged into
Roopa Prabhu [Sat, 7 Mar 2015 06:43:50 +0000 (22:43 -0800)]
Add note in readme regarding python-ifupdown2-addons being merged into
python-ifupdown2

9 years agoMerge 'vlan filtering bridge + vxlan + mlag + vrr' support from internal
Roopa Prabhu [Sat, 7 Mar 2015 05:46:10 +0000 (21:46 -0800)]
Merge 'vlan filtering bridge + vxlan + mlag + vrr' support from internal
tree to external

This also combines python-ifupdown2 and python-ifupdown2-addons package
into a single python-ifupdown2 package

9 years agoFix ifquery check for mstpctl-ports
Roopa Prabhu [Wed, 23 Jul 2014 22:15:53 +0000 (15:15 -0700)]
Fix ifquery check for mstpctl-ports

9 years agofew minor documentation cleanups
Roopa Prabhu [Tue, 22 Jul 2014 18:50:13 +0000 (11:50 -0700)]
few minor documentation cleanups

9 years agoInitial import of ifupdown2 sources
Roopa Prabhu [Sun, 20 Jul 2014 07:45:04 +0000 (00:45 -0700)]
Initial import of ifupdown2 sources

9 years agoInitial commit
nolanl [Sun, 20 Jul 2014 04:03:25 +0000 (21:03 -0700)]
Initial commit