]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
8 years agoFix a few more minor issues with auto and non-auto interfaces
Roopa Prabhu [Tue, 20 Oct 2015 15:45:20 +0000 (08:45 -0700)]
Fix a few more minor issues with auto and non-auto interfaces

Ticket: CM-7851
Reviewed By: CCR-3664
Testing Done: Tested with auto/non-auto dependent and non-dependent
interfaces

8 years agochange address on bridge and slave to an info message instead of a warn
Roopa Prabhu [Fri, 9 Oct 2015 23:32:02 +0000 (16:32 -0700)]
change address on bridge and slave to an info message instead of a warn

Ticket: CM-6106
Reviewed By: CCR-3637
Testing Done: Tested address under a bridge

We had shipped example files with addresses under bridges and slaves
in 2.5.3. With the warning introduced in 2.5.4, we will start emitting
warnings for existing customer files. And I have recently
learnt that users are relying on warnings to detect errors.

With this commit I am changing the warn to an info message
to avoid breaking existing users. We can change it back to a warn in
3.0.

changed:
"warning: interface bridge is enslaved or a vlan aware bridge and cannot
have an IP Address"

to:
"info: bridge: ignoring ip address. Interface is enslaved or a vlan
aware bridge and cannot have an IP Address"

(cherry picked from commit ecb20279e3d3c123537b9e6fddea4590c63a5013)

8 years agochange shipping default ifupdown2.conf disable_cli_interfacesfile to 0
Roopa Prabhu [Fri, 9 Oct 2015 23:09:10 +0000 (16:09 -0700)]
change shipping default ifupdown2.conf disable_cli_interfacesfile to 0
(ie to allow -i option)

Ticket: CM-7066
Reviewed By: CCR-3636
Testing Done: Tested ifupdown2 -i option

Administrators can protect from sudo users executing files with -i
by changing the disable_cli_interfacesfile=1 in ifupdown2.conf

I have uploaded the patch in CCR-3636. And checked with shm and nolan
before pushing this change in 2.5.4.

The default is being changed because of the fear of breaking existing
users of -i after an upgrade to 2.5.4.

The shipping default behaviour for -i will be revisited in 3.0
timeframe.

(cherry picked from commit 5dce566a94dafc99c441e66c412d8d66a083aa5e)

8 years agoFix the return value for auto interface checks
Roopa Prabhu [Fri, 9 Oct 2015 22:14:56 +0000 (15:14 -0700)]
Fix the return value for auto interface checks

Ticket: CM-7851
Reviewed By: CCR-3639
Testing Done: Tested a combination of auto and non-auto interfaces.

This fixes a regression introduced in 2.5.4 where ifreload was
picking up non-auto interfaces

This also fixes a minor issue with blacklisting interfaces introduced by
("450c679249b546dbc2cd97d81b49e011fec948bd remove blacklisted interfaces
only if they are upperifaces (ie root of the tree") when an interface
has multiple auto and non-auto stanzas (A rare case, but it was an easy
fix and around the same area).

example, the fix will now blacklist an interface only if all of its stanzas are
blacklisted. In the below example, swp4 is not blacklisted if user
specified auto because one of the iface stanzas is auto.

auto swp4
iface swp4

iface swp4
        address 10.0.14.2/24

(cherry picked from commit ad6d4567fdf9413c804a348c1712d8706934264a)

8 years agoFix stdin issues with missing config filename ifquery for disable_cli_interfacesfile
Sam Tannous [Fri, 9 Oct 2015 22:00:49 +0000 (18:00 -0400)]
Fix stdin issues with missing config filename ifquery for disable_cli_interfacesfile

Ticket: CM-7066
Reviewed By: roopa
Testing Done: unit tested and wrote new testcase in testifupdown2

Use case for ifquery where stdin used with -i breaks
because interfacesfileiobuf was not checked in addition to interfacesfilename.

Testcase like:

echo '[{"name": "swp1","auto": true,"config": {"address": "10.10.10.10/24"}}]' | ifquery -i - -t json swp1

would fail because while -i was given with stdin, the check for missing filename would produce an error.

It was also decided by consensus that the ifquery command does not need to have a check for
disable_cli_interfacesfile since a query "should" not pose a security check.

(I've also added some test cases for this in cl-tests).

(cherry picked from commit 4d37e932b43da87a9240a866be2d8b9508a9c7eb)

8 years agoremove blacklisted interfaces only if they are upperifaces (ie root of
Roopa Prabhu [Fri, 2 Oct 2015 20:18:03 +0000 (13:18 -0700)]
remove blacklisted interfaces only if they are upperifaces (ie root of
the tree)

Ticket: CM-7765
Reviewed By: CCR-3621
Testing Done: tested interface dependencies with auto and non-auto
interfaces

This commit fixes a change in behaviour introduced by "460906d0552d" ("skip adding
filtered or blacklisted interfaces in the dependency graph") that
skipped non-auto (or blacklisted) interfaces.

Turns out we have files out there that do have non-auto
dependents. This patch makes sure blacklisted interfaces who are
dependents of other interfaces are always picked up.

8 years agoIntroduce a lock file in non-persistent storage /run/network/ifstatelock
Roopa Prabhu [Fri, 2 Oct 2015 19:31:51 +0000 (12:31 -0700)]
Introduce a lock file in non-persistent storage /run/network/ifstatelock
to make sure the state file in persistent storage is cleaned up
correctly

Ticket: CM-7774
Reviewed By: CCR-3623
Testing Done: Tested statefile accross reboots

ifupdown2 state file was moved to /var/tmp because /var/tmp was tmpfs
and was large enough (100MB) for the state file. But it appears it has
changed (or is not consistent) across all platforms. We can move it
under /run, but /run again size varies on various platforms and it is
too small on some platforms.

This patch:
- continues to keep the ifupdown2 state file under /var/tmp (because it
needs the space)
- ntroduces a second level /run/network/ifstatelock file that stays on
non-persistant storage and is used to delete the state file at /boot up

9 years agoFix mstp settings ordering issues when bridge stp is toggled on and off
Roopa Prabhu [Tue, 29 Sep 2015 17:12:07 +0000 (10:12 -0700)]
Fix mstp settings ordering issues when bridge stp is toggled on and off
(when mstp settings are specified under the port)

Ticket: CM-6626
Reviewed By: CCR-3599
Testing Done: Tested the problem case mentioned in the bug (Plan to
re-work the fix a bit for 2.5.5)

problem:
    mstp parameters can be specified under the port or under the bridge
    When they are specified under the bridge, there should be no problem
(When you process the bridge, all things on the bridge port are set in
order)
    When they are specified under the port:
    we check if the bridge is up, if yes, and stp is already configured,
we process mstpctl settings
    This check today only checks running stp_state
    We should also check the user configured stp state for the bridge
    Note that the problem exists only if the bridge and ports are
already up and user executes ifup again and when we need to re-evaluate
the bridge port settings

solution:
    When the bridge port is being checked for mstp settings, not only
check running stp state, but also check user specified stp state and
correct bridge stp state before proceeding with mstp configuration

Few things to note with this patch:
    - If user changed stp state on bridge to 'on', and did `ifup
    <bridge_port>'`,
    though the user has not ifup'ed the bridge yet, the bridge stp state
    will be applied (very few people will run into this and practically this
    should not be a problem atall. But from correctness POV it is
    a voilation. ).

    - To avoid this, the other solution would have been to let the bridge
    port code be as is, but handle this during bringing up the bridge,
    but, this can confuse the user, because when processing the
    bridge_port, you will still throw warnings even if the port stp config
    is later reapplied when the bridge comes up

    - note that the patch only handles the case when stp state is not on and
    somebody turned it on.  For the case where stp state was on and somebody
    turned it off, this patch wont throw warnings for the mstpctl config. But
    it will not cause any issues because once stp is off things will be ok
    everywhere. I want to keep any changes here out of this patch. I will
    document this in the bug...and see if i can handle this in 2.5.5

9 years agoFix ifquery json output for --running and other options
Roopa Prabhu [Thu, 24 Sep 2015 20:00:38 +0000 (13:00 -0700)]
Fix ifquery json output for --running and other options

Ticket: CM-7635
Reviewed By: CCR-3575
Testing Done: Tested failing ifquery output in json format

This patch fixes a bug introduced by 0dea0cfeeec8b342ee2e2b767daa4071ac760f31
("Add support to display status (pass, fail) in ifquery --check json
output").

This patch separates the json encoders for iface objects with and
without status (ifaceJsonEncoder and ifaceJsonEncoderWithStatus) so
that they dont interfere with each other.

9 years agoAdd support to display status (pass, fail) in ifquery --check json output
Roopa Prabhu [Fri, 18 Sep 2015 04:57:06 +0000 (21:57 -0700)]
Add support to display status (pass, fail) in ifquery --check json output

Ticket: CM-7464
Reviewed By: CCR-3507
Testing Done: Tested ifquery check sanity

ifquery --check non-json output displays 'pass' and 'fail' for
each attribute on the same line (see below). This output is not json
friendly. For json, include status in 'config_status' a dictionary
whose keys are similar to the 'config' dictionary but values are status
for the corresponding keys in the 'config' dictionary (see example below)

auto bond4
iface bond4 inet static
[pass]
    bond-mode 802.3ad                                           [pass]
    bond-miimon 100                                             [pass]
    bond-use-carrier 1                                          [pass]
    bond-lacp-rate 1                                            [pass]
    bond-min-links 1                                            [pass]
    bond-xmit-hash-policy layer3+4                              [pass]
    bond-slaves swp3 swp4                                       [pass]

[
  {
    "name": "bond4",
    "addr_method": "static",
    "addr_family": "inet",
    "auto": true,
    "config": {
      "bond-use-carrier": "1",
      "bond-miimon": "100",
      "bond-lacp-rate": "1",
      "bond-min-links": "1",
      "bond-slaves": "swp3 swp4",
      "bond-mode": "802.3ad",
      "bond-xmit-hash-policy": "layer3+4"
    },
    "config_status": {
      "bond-use-carrier": "pass",
      "bond-miimon": "pass",
      "bond-lacp-rate": "pass",
      "bond-min-links": "pass",
      "bond-slaves": "pass",
      "bond-mode": "pass",
      "bond-xmit-hash-policy": "pass"
    },
    "status": "pass"
  }
]

9 years agoMake sure an interface is down (in the bond case, its slaves are also
Roopa Prabhu [Thu, 17 Sep 2015 18:26:56 +0000 (11:26 -0700)]
Make sure an interface is down (in the bond case, its slaves are also
down) when setting mac address

Ticket: CM-6982
Reviewed By: CCR-3516
Testing Done: Tested ifreload setting of mac on an already up bond

9 years agoFix batch_commit to reset vars if batch buffer is NULL.
Roopa Prabhu [Wed, 16 Sep 2015 19:49:24 +0000 (12:49 -0700)]
Fix batch_commit to reset vars if batch buffer is NULL.

Ticket: CM-6982
Reviewed By: trivial but imp
Testing Done:

This will make sure a stale batch.start() with no real batch commands
is ended cleanly.

9 years agoifupdown: vxlan-remoteip not getting applied when vxrd is not configured to run
Wilson Kok [Thu, 10 Sep 2015 20:57:14 +0000 (13:57 -0700)]
ifupdown: vxlan-remoteip not getting applied when vxrd is not configured to run

Ticket: CM-7410
Reviewed By: CCR-3470
Testing Done:

When vxrd is not enabled in /etc/default/vxrd, the 'service vxrd status'
command returns 0, causing the vxlan-remoteip to be not applied even
though it should have. Fix is to change to checking pidfile of vxrd.

9 years agoAdd a check to see if it is indeed a bridge port before applying mstpctl
Roopa Prabhu [Wed, 9 Sep 2015 18:43:19 +0000 (11:43 -0700)]
Add a check to see if it is indeed a bridge port before applying mstpctl
config

Ticket: CM-6965
Reviewed By: CCR-3472
Testing Done: Tested with interfaces file specified in the bug

9 years agofix errors in examples that were generate warnings
Roopa Prabhu [Wed, 9 Sep 2015 18:21:24 +0000 (11:21 -0700)]
fix errors in examples that were generate warnings

Ticket:
Reviewed By: trivial
Testing Done: Tested all example files with latest from 2.5.4

9 years agowarn on stale interfaces left as dependents + warn on reuse of bond
Roopa Prabhu [Fri, 4 Sep 2015 23:12:20 +0000 (16:12 -0700)]
warn on stale interfaces left as dependents + warn on reuse of bond
slaves under other interfaces

Ticket: CM-7322, CM-6772
Reviewed By: CCR-3464
Testing Done: Tested with faulty configs and checked for warnings

9 years agoifupdown2 changes for vxlan anycast_ip, head-end fdb entries, protodown
Balakrishnan Raman [Fri, 4 Sep 2015 07:32:15 +0000 (00:32 -0700)]
ifupdown2 changes for vxlan anycast_ip, head-end fdb entries, protodown

Ticket: CM-7087
Reviewed By: CCR-3379
Testing Done: unit testing with clag_vxlan_clos_spec/cfg.py

On clag pairing, clagd changes local address of vxlan device to anycast ip.
If user does ifreload now, ifupdown2 will overwrite local address with
individual ip contained in /etc/netwrok/interfaces. vxlan.py caches
anycast_ip configuration so that ifquery -c can skip it from flagging error
and ifreload skip overwriting vxlan device's local ip.

vxrd provisions head-end replication endpoints by adding bridge fdb entries.
If /etc/network/interfaces doesn't have remote-ip attribute, then on ifreload
ifupdown2 will delete all vxrd provisioned entries. ifupdown will check for
presence of vxrd service and skip add/delete bridge fdb entries for
head-end replication

On ifreload vxlan device are put in proto-down even if they are up and running.
Check for operstate and put it in proto-down only if operstate transitions from
down to up.

9 years agoFix ifupdown2 pre-up order
Balakrishnan Raman [Mon, 31 Aug 2015 23:22:12 +0000 (16:22 -0700)]
Fix ifupdown2 pre-up order

Ticket: CM-7313
Reviewed By: trivial
Testing Done: tested in active-active vxlan scale testbed

With recent change to ifupdown2 to create dummy devices (CM-3525), pre-up
sequence has been inadvertently changed to invoke clag before vxlan. This
causes protodown of vxlan device by clag addon to happen before vxlan device
gets added. Revert the pre-up order to have vxlan pre-up before clag's.

9 years agonew ifupdown2 link module to create dummy devices
Roopa Prabhu [Thu, 13 Aug 2015 06:30:55 +0000 (23:30 -0700)]
new ifupdown2 link module to create dummy devices

Ticket: CM-3525
Reviewed By: CCR-3326
Testing Done: Tested creating dummy devices using ifupdown2

This is modification to gospos loopback module. It solves the same
purpose ie using linux dummy device like a loopback device but there were
objections on calling it loopback so i have renamed it to link and i have changed it
into a generic module that can do any 'ip link'. Can be extended for
link args in the future.

below example creates a loopy device

$ifquery loopy
auto loopy
iface loopy
link-type dummy

$ifup loopy
$ifquery -c loopy
auto loopy
iface loopy [pass]
link-type dummy [pass]

(cherry picked from commit 1151420408a53c106d29183a1e0da5562c8b03a3)

9 years agoifupdown2 ethtool does not handle link-* settings on enslaved ports
Sam Tannous [Fri, 21 Aug 2015 03:12:26 +0000 (23:12 -0400)]
ifupdown2 ethtool does not handle link-* settings on enslaved ports

Ticket: CM-7128
Reviewed By: Trivial
Testing Done: unit tested on Ken's machine

The ifupdown2 ethtool addon module fails to set/check
the link-speed on bridge ports.
I removed excessive ifaceLinkKind checking since CM-6619
(03642a9a) added BRIDGE_PORT and BOND_SLAVE.  This is ok
since we now check to see if ports have defaults (only swp do)
before showing or changing settings).

9 years agoadd param in ifupdown2.conf to prevent fupdown2 users from specify interface config...
Sam Tannous [Fri, 21 Aug 2015 02:59:44 +0000 (22:59 -0400)]
add param in ifupdown2.conf to prevent fupdown2 users from specify interface config file on the CLI

Ticket: CM-7066
Reviewed By: scotte,roopa,olson
Testing Done: Unit testing and regression testing

This patch does two things:

1. It moves the interfaces config file name to the ifupdown2.conf file in /etc/network/ifupdown2.
This should allow administrators to specify a config file location different from the default and allow
subsets of users to use it without giving them access to specifying their own with the -i option in ifup/ifdown.

2. It also adds a new config setting called "disable_cli_interfacesfile" used to prevent users
from specifying their own interfaces file. This defaults to "1" (even if it is not configured).

Note: this new default takes away users ability to specify an interfaces file.

This should close the vulnerability where users could specify their own interfaces file
and add arbitrary user commands.

This leaves the shell=True option in the user commands add-on module since the ifup/ifdown/ifreload/ifquery
commands already require root access to run and the interfaces config file also requires root access to modify.

9 years agoifupdown: added bridge-allow-untagged bridge port option
Wilson Kok [Sat, 8 Aug 2015 03:45:12 +0000 (20:45 -0700)]
ifupdown: added bridge-allow-untagged bridge port option

Ticket: CM-6862
Reviewed By: CCR-3278
Testing Done:

Currently, ifupdown implicitly configures pvid on a bridge port
in case user doesn't configure it.  There is no way to configure
a bridge port to not accept untagged packets.  The new option
allows user to do that without changing the current default
behavior.

9 years agoifupdown: fixed warning when apply lacp attributes to non lacp bonds
Wilson Kok [Mon, 10 Aug 2015 21:17:46 +0000 (14:17 -0700)]
ifupdown: fixed warning when apply lacp attributes to non lacp bonds

Ticket: CM-6161
Reviewed By: Roopa
Testing Done:

Check bond mode when applying lacp attributes.

9 years agochange /bin/bridge path to /sbin/bridge to be same as upstream
Roopa Prabhu [Sun, 9 Aug 2015 06:14:55 +0000 (23:14 -0700)]
change /bin/bridge path to /sbin/bridge to be same as upstream

Ticket: CM-6519
Reviewed By:
Testing Done: sanity test

9 years agobreak down the bridge port batch add in ifupdown2
Satish Ashok [Thu, 30 Jul 2015 22:01:24 +0000 (15:01 -0700)]
break down the bridge port batch add in ifupdown2

Ticket:  CM-6496
Reviewed By: CCR-3196
Testing Done:

The "ip batch command to add a bridge port and flush the dev" command with 1k netdevices was taking 1.4G of memory. With 2k netdevices batch, this command was causing a OOM condition. To avoid this, commit the batch after 250 ports. Ideally we have to look at the internal batch implementation to see if there is an underlying issue.

9 years agoDocument --exclude option a little better for ifupdown2
Sam Tannous [Thu, 30 Jul 2015 15:15:17 +0000 (11:15 -0400)]
Document --exclude option a little better for ifupdown2

Ticket: CM-6587
Reviewed By: roopa
Testing Done: checked man paged

If we do an ifdown on all ports and try to exclude a bond or bridge port.
But we also have an iface defined for swp1 or swp4
(even if these are empty).
The lower interfaces will not be excluded. So if we
do an "ifdown -a -X bridge", swp ports in the bridge or bond
will go down effectively bringing a bond or bridge down.

This patch simply adds some documentation to the man pages.

ifupdown2 never follows dependents if the user has given an
interface list (unless explicitly requested with --with-depends
option which is available with some options).

9 years agoifupdown2 patch to properly remove address-virtual mac addresses
Sam Tannous [Thu, 23 Jul 2015 19:43:45 +0000 (15:43 -0400)]
ifupdown2 patch to properly remove address-virtual mac addresses

Ticket: CM-6702
Reviewed By: roopa
Testing Done: unit and smoke tested with ifupdown2 suite

When address-virtual mac adddress is modified, removed from an SVI, or the SVI is removed,
the permanent mac address is not removed.

This patch addresses all three cases but creating a global statemanager instance
and removing address-virtual FDB entries that were previously configured.

9 years agoifupdown2 fixes for svcnode, vxlan-ageing, bridge-vlan-aware
Balakrishnan Raman [Thu, 23 Jul 2015 19:15:16 +0000 (12:15 -0700)]
ifupdown2 fixes for svcnode, vxlan-ageing, bridge-vlan-aware

Ticket: CM-6815, CM-6816, CM-6817
Reviewed By: CCR-3234
Testing Done: unit testing

CM-6815 : ip link set syntax for svcnode has been changed. Absence of svcnode
will retain the existing values. svcnode 0.0.0.0 is needed to wipe out service
node addresses in vxlan device. Modified ifupdown2 to use svcnode 0.0.0.0 to
clean up service node address.

CM-6816: "bridge-clan-aware no" is not handled in query-check and hence ifquery
on bridge interface with "bridge-vlan-aware no" fails. Modified bridge's
query-check to take care of this.

CM-6817: With default ageing value (300), if query -c <vxlan device> was
failing. Set ageing to 300 if not specified and compare it with running config.

9 years agoDont up a vlan aware bridge during upper iface bringup (optimization)
Roopa Prabhu [Thu, 23 Jul 2015 17:17:02 +0000 (10:17 -0700)]
Dont up a vlan aware bridge during upper iface bringup (optimization)

Ticket: CM-6619
Reviewed By: CCR-3191
Testing Done:  Tested upperiface bringup for bridge and vlan devices

'up' on bridge was always done to add the newly created port to the bridge
in cases where the bridge is not part of the interfaces being brought
up. But This will try to re-apply bridge port attributes on all bridge
ports and that can take a while when there are large number of bridge
ports. This patch currently avoids the bridge up for only the vlan
aware bridge case.

9 years agoMerge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumul...
Roopa Prabhu [Thu, 23 Jul 2015 17:15:43 +0000 (10:15 -0700)]
Merge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumulus into CumulusLinux-2.5_br

9 years agoAllow customer set bond defaults for CL with ifupdown2
Sam Tannous [Wed, 22 Jul 2015 22:38:07 +0000 (18:38 -0400)]
Allow customer set bond defaults for CL with ifupdown2

Ticket: CM-6723
Reviewed By: roopa
Testing Done: unit tested and testifupdown2 test suite

This patch installs bond interface defaults in

     /etc/network/ifupdown2/policy.d/bond_defaults.json

and allows users to modify this file.   Users can then leave out these
bond attributes in their configs to save typing and space.

It also changes the ifenslave and ifenslaveutil module to bond and
bondutil, respectively to be consistent with other modules
(and also because customers think of "bond" interfaces not
"ifenslave" interfaces.)

For example, the default file installed looks like the following:

{
    "README": "This file is user generated and modifiable.",
    "bond": {
        "defaults": {
                "bond-mode": "802.3ad",
                "bond-miimon": "100",
                "bond-use-carrier": "1",
                "bond-lacp-rate": "0",
                "bond-min-links": "1",
                "bond-xmic-hash-policy": "layer3+4"
         }
    }
}
Please enter the commit message for your changes. Lines starting

9 years agoMerge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumul...
Roopa Prabhu [Mon, 13 Jul 2015 22:19:47 +0000 (15:19 -0700)]
Merge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumulus into CumulusLinux-2.5_br

9 years agoMerge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumul...
Roopa Prabhu [Mon, 13 Jul 2015 22:02:14 +0000 (15:02 -0700)]
Merge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumulus into CumulusLinux-2.5_br

9 years agoFix ip addr parsing breakage on sid
Roopa Prabhu [Mon, 13 Jul 2015 21:33:01 +0000 (14:33 -0700)]
Fix ip addr parsing breakage on sid

Ticket:
Reviewed By: stannous
Testing Done: sanity testing

9 years agoMerge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumul...
Roopa Prabhu [Mon, 13 Jul 2015 21:26:28 +0000 (14:26 -0700)]
Merge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumulus into CumulusLinux-2.5_br

9 years agoapt-get remove of python-ifupdown2 fails due to postrm script error
Sam Tannous [Mon, 13 Jul 2015 15:12:44 +0000 (11:12 -0400)]
apt-get remove of python-ifupdown2 fails due to postrm script error

Ticket: CM-6655
Reviewed By: Trivial
Testing Done: tested install and removal of python-ifupdown2

There was an invalid equality test in the postrm script for
ifupdown2.  In Dash, equality is tested with a single '='
and not '=='.

9 years agoMove interface name check to networkinterfaces.py where all other parse
Roopa Prabhu [Thu, 9 Jul 2015 18:07:06 +0000 (11:07 -0700)]
Move interface name check to networkinterfaces.py where all other parse
errors are reported

Ticket: CM-5882
Reviewed By: stannous
Testing Done: Tested with a long interface name

9 years agoMerge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumul...
Roopa Prabhu [Thu, 9 Jul 2015 18:04:39 +0000 (11:04 -0700)]
Merge branch 'CumulusLinux-2.5_br' of ssh://stash.cumulusnetworks.com:7999/ccmr/cumulus into CumulusLinux-2.5_br

9 years agoifupdown2 ethtool add-on module should not get unnecessary running configs for perfor...
Sam Tannous [Thu, 9 Jul 2015 17:40:00 +0000 (13:40 -0400)]
ifupdown2 ethtool add-on module should not get unnecessary running configs for performance reasons

Ticket: CM-6630
Reviewed By: roopa
Testing Done: unit tested

We still run ethtool on most interfaces even if we don't have defaults to use.
The last bug I fixed (CM-6557) should have also fixed that (even if it was specific to
ifquery).

We now check if there is a configured attribute and if there is a default
value. If we do not have both, we continue without calling ethtool to get the running value.

9 years agoCatch the interface long error during parsing
Roopa Prabhu [Thu, 9 Jul 2015 04:08:43 +0000 (21:08 -0700)]
Catch the interface long error during parsing

Ticket: CM-5882
Reviewed By:
Testing Done:

9 years agovxfld: ifupdown2 addon for vxrd
Sameer Ladiwala [Mon, 6 Jul 2015 20:40:52 +0000 (13:40 -0700)]
vxfld: ifupdown2 addon for vxrd

Ticket: CM-6358
Reviewed By: roopa
Testing Done: Yes

ifupdown2 creates overrides vxrd's config when either (or both) the vxrd-src-ip and vxrd-svcnode-ip appear under the loopback interface's configuration.
Example
address 12.0.0.4/32
vxrd-src-ip 12.0.0.4
vxrd-svcnode-ip 99.99.99.9

9 years agoRunning ifquery --running -a will truncate the pvid number to a single digit
Sam Tannous [Thu, 2 Jul 2015 21:14:24 +0000 (17:14 -0400)]
Running ifquery --running -a will truncate the pvid number to a single digit

Ticket: CM-6284
Reviewed By: roopa
Testing Done: unit tested change

Running ifquery --running -a will truncate the pvid number to a single digit for the bridge.
This patch appendis the entire pvid instead of only the first character.

9 years agoMake ifupdown2 print meaningful error when interface name length exceeds 15 characters
Sam Tannous [Thu, 2 Jul 2015 21:10:04 +0000 (17:10 -0400)]
Make ifupdown2 print meaningful error when interface name length exceeds 15 characters

Ticket: CM-5882
Reviewed By: gospo
Testing Done: unit tested

When a user enters an interface name longer than 15 characters,
the error message is not clear about what the problem is.

   warning: netlink: Numerical result out of range <<<<<<<<<<<<<<<<

This patch catches the error before netlink gets the call and
prints

    error: the following interface names are too long: bond-xconnect.1006

9 years agoifquery --running should not show link attributes on logical interfaces
Sam Tannous [Thu, 2 Jul 2015 19:59:34 +0000 (15:59 -0400)]
ifquery --running should not show link attributes on logical interfaces

Ticket: CM-6557
Reviewed By: roopa, gospo
Testing Done: unit tested

ifquery should not show link attributes for interfaces we do not have defaults for.
Although somewhat useful, we don't want people saving the bond link attributes
to try to use then in a config

9 years agoFix warning (was emitting two lines)
Roopa Prabhu [Wed, 1 Jul 2015 22:01:15 +0000 (15:01 -0700)]
Fix warning (was emitting two lines)

Ticket:
Reviewed By: trivial
Testing Done:

9 years agoun-glob expression in sample file
Roopa Prabhu [Wed, 1 Jul 2015 22:00:07 +0000 (15:00 -0700)]
un-glob expression in sample file

Ticket:
Reviewed By: trivial
Testing Done: Tested that sample works fine

9 years agoifreload causes unnecessary dhcp restart for eth0
Sam Tannous [Tue, 30 Jun 2015 17:47:08 +0000 (13:47 -0400)]
ifreload causes unnecessary dhcp restart for eth0

Ticket: CM-5730
Reviewed By: roopa
Testing Done: tested change on Sean and Jason's lab setup

The dhcp restart on all interfaces using dhcp causes a reconnection
for NTP and in addition, a recent addition of rack management packages
(CM-5782) added ntp and a exit-hook script that also interrupted NTP
for a second time.   This patch will check for dhclient running (IPv4 and IPv6)
and not restart dhcp if it's already running.

9 years agoFix check for bridge interface in scheduler during upperiface check
Roopa Prabhu [Sat, 27 Jun 2015 17:12:21 +0000 (10:12 -0700)]
Fix check for bridge interface in scheduler during upperiface check

Ticket: CM-6525
Reviewed By: trivial
Testing Done: Tested with failing config mentioned in the bug

c4d27f53e965af5edc938acae25bcb249a2214a7 introduced a
new interface kind of BRIDGE_VLAN_AWARE which broke the
scheduler check. This patch fixes the check.

9 years agoifupdown2 should not allow IP address command under vlan aware bridge stanza
Sam Tannous [Wed, 24 Jun 2015 15:39:56 +0000 (11:39 -0400)]
ifupdown2 should not allow IP address command under vlan aware bridge stanza

Ticket: CM-6106
Reviewed By: roopa,scotte
Testing Done: ran ifupdown2 regression suite and hand tested

This patch prevents IP address assignment under vlan aware bridges.
This prevents some confusion because a bridge subinterface is required
for layer 3 termination.

9 years agoskip adding filtered or blacklisted interfaces in the dependency graph
Roopa Prabhu [Mon, 22 Jun 2015 00:37:27 +0000 (17:37 -0700)]
skip adding filtered or blacklisted interfaces in the dependency graph

Ticket:
Reviewed By: CCR-3043
Testing Done:

This was resulting in lower interfaces not being brought up at boot
when their upper-ifaces were not-marked auto. And this was because
the dependency graph continued to have the non-auto upper interfaces
and the whole tree was ignored by the scheduler.

This fix eliminates filtered interfaces from the dependency graph
to simplify the scheduler and also to avoid scheduler picking up
non-auto (or non-class interfaces).

testcase (Without this patch swp1 was skipped at boot)
iface swp1.100

auto swp1
iface swp1

9 years agoEliminate confusing and unnecessary ethtool calls
Sam Tannous [Sat, 20 Jun 2015 01:27:49 +0000 (21:27 -0400)]
Eliminate confusing and unnecessary ethtool calls

Ticket: CM-6275
Reviewed By: roopa,dustin
Testing Done: Unit tested and ran complete ifupdown2 test suite

There are unnecessary calls to the ethtool module that cause some error messages to be printed.
We currently don't check ifaceobj.link_kind at the start
so this check was added.

If someone creates a new interface without setting link_kind, we still printed error message.
This patch adds a check at the start of ethtool.

This patch also removes the global link defaults (used by ifupdown2/ethtool)
created when update-ports is called.  The defaults are created for each swp port
so we don't have defaults (and therefore will not attempt to set) for interfaces
like eth0, loopbacks, dummys, vxlans, or any other non swp interface.

9 years agoifupdown changes for active-active vxlan
Balakrishnan Raman [Thu, 18 Jun 2015 08:18:43 +0000 (01:18 -0700)]
ifupdown changes for active-active vxlan

Ticket: CM-3715
Reviewed By: CCR-3065
Testing Done: unit testing

Changes to proto down vxlan devices to avoid packet loops or duplicates before
clagd checks consistency and installs egress acl rules. When vxlan device is
brought up, check for presence of peer link and proto-down the device if peer
link exists.
- get_dependent_ifacenames is used to eliminate order dependency in specifying
peer link and vxlan configuration in /etc/network/interfaces.
- A separate script clagVxlanProtoDown is used to protodown vxlan devices if
peer link is configured separately (ifup peerlink) and vxlan devices are
already functional in the system.

9 years agoEnhance globbing in ifupdown2 to support breakout cables
Sam Tannous [Wed, 17 Jun 2015 00:58:15 +0000 (20:58 -0400)]
Enhance globbing in ifupdown2 to support breakout cables

Ticket: CM-5365
Reviewed By: roopa,dwalton
Testing Done: Ran regression suite and hand tested.

This patch extends the globbing support in ifupdown2
to handle two levels of square brackets so that breakout
cables can be handled (e.g. swp[2-7]s[0-3]).  Also modified
the user's guide and the man pages.

9 years agovxlan error 'str' object has no attribute 'append'
Sam Tannous [Tue, 16 Jun 2015 21:15:57 +0000 (17:15 -0400)]
vxlan error 'str' object has no attribute 'append'

Ticket: CM-6329
Reviewed By: roopa
Testing Done: unit testing with vxlan configs

A bug iproute2.py creates an unnecessary warning
about appending the ageing value to a string.
This patch removes the append and simply sets the ageing value.

9 years agoDocument exclude (-X) option in ifreload
Sam Tannous [Wed, 20 May 2015 14:15:39 +0000 (10:15 -0400)]
Document exclude (-X) option in ifreload

Ticket: CM-5419
Reviewed By: Trivial
Testing Done: built ifupdown2 deb and tested on switch

This patch adds man page mention of undocumented (but working)
option to exclude interfaces from a reload (-X option)
(cherry picked from commit 0358905782a4c0290a967d6f730fdcb27f2af3d9)

9 years agoDon't allow IP addresses on ports enslaved in bonds or bridges
Sam Tannous [Wed, 3 Jun 2015 00:35:08 +0000 (20:35 -0400)]
Don't allow IP addresses on ports enslaved in bonds or bridges

Ticket: CM-5146
Reviewed By: roopa,jtoppins
Testing Done: built new ifupdown package and ran testifupdown2 suite of tests

This patch prevents enslaved interfaces from having IP addresses.
(cherry picked from commit 0c00606fbc76db11557a8e946310e93a2b376aa7)
(cherry picked from commit dc30987acfc6af356b9e055db95d94ae45f0de9f)

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

Ticket: CM-5254
Reviewed By: roopa
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/usrlib/update-ports
(cherry picked from commit 21c9c10ab2fccaf60be9accb337e82541d497cc4)

9 years agoAdded ifupdown2 support for vxlan-ageing config
Sam Tannous [Thu, 5 Mar 2015 17:54:55 +0000 (12:54 -0500)]
Added ifupdown2 support for vxlan-ageing config

Ticket: CM-5105
Reviewed By: roopa
Testing Done: tested configs before and after change

We needed a configuration option to add vxlan-ageing to
ifupdown2 configs.  This patch adds the option to change
the vxlan-ageing timer currently set with "ip link"
commands.
(cherry picked from commit 9832462c365bd2b900b98f5675d407d1b11c4a95)

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

9 years agoAdded lacp bypass all-active parameter in ifupdown2 man page
Wilson Kok [Sat, 16 May 2015 18:06:10 +0000 (11:06 -0700)]
Added lacp bypass all-active parameter in ifupdown2 man page

Ticket: CM-6038
Reviewed By:
Testing Done:

9 years agoMove stale slave delete to after the adds are done
Roopa Prabhu [Fri, 15 May 2015 06:00:57 +0000 (23:00 -0700)]
Move stale slave delete to after the adds are done

Ticket: CM-5887
Reviewed By: trivial
Testing Done: Tested with sample config in the bug
(cherry picked from commit e90149a1e8ea3bc94e07fb080361e6909b12e81b)

9 years agoAdd new SKIP_DOWN_AT_SYSRESET /etc/init.d/networking config option to
Roopa Prabhu [Tue, 12 May 2015 14:32:53 +0000 (07:32 -0700)]
Add new SKIP_DOWN_AT_SYSRESET /etc/init.d/networking config option to
skip deconfiguring interfaces

Ticket: CM-5900
Reviewed By: CCR-2921
Testing Done: Tested 'service networking stop' during system reboot and shutdown

9 years agoLACP bypass fixes
Wilson Kok [Fri, 8 May 2015 18:17:14 +0000 (11:17 -0700)]
LACP bypass fixes

Ticket: CM-5924, CM-5937, CM-5921, CM-5932
Reviewed By: CCR-2911
Testing Done:

bonding driver:
- renamed bond lacp-bypass-use-priority config option to
  lacp-bypass-all-active with the default value of 0
- ignore clag role when lacp-bypass-all-active is enabled
- added info logging of lacp bypass state changes

iproute2:
- renamed bond lacp-bypass-use-priority config option

ifupdown:
- renamed bond lacp-bypass-use-priority config option
- added default value handling for lacp bypass attributes

switchd:
- macs learned on individual slaves are now sync to kernel with
  the bond's ifindex.  This eliminates flooding when cpu is
  communicating to the host where the bond is in lacp bypass
- fixed bond forwarding state propagation to individual slaves in
  bypass

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

Ticket: CM-5764
Reviewed By: jtoppins
Testing Done:

9 years agoAdded ifupdown support for different lacp bypass modes
Wilson Kok [Sat, 2 May 2015 22:19:51 +0000 (15:19 -0700)]
Added ifupdown support for different lacp bypass modes

Ticket: CM-5716
Reviewed By:
Testing Done:

Added mode to distinguish between priority based and multiple links
lacp bypass modes.

9 years agoMerge branch 'CumulusLinux-2.5_br' of ssh://dev.cumulusnetworks.com/home/trac/cumulus...
Roopa Prabhu [Thu, 30 Apr 2015 20:03:07 +0000 (13:03 -0700)]
Merge branch 'CumulusLinux-2.5_br' of ssh://dev.cumulusnetworks.com/home/trac/cumulus into CumulusLinux-2.5_br

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

Ticket: CM-5832
Reviewed By: CCR-2875
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.

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

Ticket: CM-5819
Reviewed By: trivial
Testing Done: Tested man page
(cherry picked from commit 93ecf73b22d317dcf2a0924030f34f008fc25c33)

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

Ticket: CM-5841
Reviewed By:
Testing Done: tested ifreload with new iface section

<email_notes>
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
</email_notes>

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

Ticket: CM-5813
Reviewed By: sashok
Testing Done: build and tested man page

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

Ticket: CM-5764
Reviewed By: TBA
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.

Ticket: CM-5819
Reviewed By: CCR-2846
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)

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

Ticket: CM-5693
Reviewed By: roopa
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.

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

Ticket: CM-5735
Reviewed By: no one
Testing Done: lots of repo upgrade testing by John B.

This partially reverts commit 8959e8e4ec93487228733b17ef2b220ed47c1260 ("Fix
bash completion for sudo users (mostly cosmetic)") in the sections where
the Debian maintainer scripts were modified.

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

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

Commit 8959e8e4ec93487228733b17ef2b220ed47c1260 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)

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

Ticket: CM-5637
Reviewed By: CCR-2755
Testing Done:

Replaced vxlan-peernodeip attribute with vxlan-remoteip.  Updated
the vxlan and iproute2 modules to configure head end replication
using bridge fdb commands.

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

Ticket: CM-5373
Reviewed By:
Testing Done: tested interfaces file with shared dependents

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

Ticket: CM-5373
Reviewed By: sam
Testing Done: Tested with shared slaves in bridge and bonds

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

Ticket: CM-5571
Reviewed By:
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.

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

Ticket: CM-5253
Reviewed By: sam
Testing Done: Tested ifreload with steps in the bug

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.

Ticket: CM-5355
Reviewed By: roopa
Testing Done: Tested config in ticket

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.

9 years agoMerge branch 'CumulusLinux-2.5_br' of ssh://dev.cumulusnetworks.com/home/trac/cumulus...
Roopa Prabhu [Tue, 10 Mar 2015 21:19:41 +0000 (14:19 -0700)]
Merge branch 'CumulusLinux-2.5_br' of ssh://dev.cumulusnetworks.com/home/trac/cumulus into CumulusLinux-2.5_br

9 years agomerge docs.addons content into docs directory
Roopa Prabhu [Tue, 10 Mar 2015 21:18:30 +0000 (14:18 -0700)]
merge docs.addons content into docs directory

Ticket:
Reviewed By:
Testing Done:

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

Ticket: CM-5349
Reviewed By: Trivial
Testing Done: Tested on cel box

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)

9 years agoWrong initialization of iface link kind (still puzzled how i had it this
Roopa Prabhu [Thu, 26 Feb 2015 22:26:58 +0000 (14:26 -0800)]
Wrong initialization of iface link kind (still puzzled how i had it this
way)

Ticket:
Reviewed By: trivial
Testing Done: Tested interface upperiface bring up

This was causing the auto upperiface bringup to pick all upperifaces on
malliks setup. This is a large number in a 500 svi setup.

9 years agomove link_set 'up' errors to debug
Roopa Prabhu [Wed, 25 Feb 2015 21:45:37 +0000 (13:45 -0800)]
move link_set 'up' errors to debug

Ticket: CM-5199
Reviewed By: trivial
Testing Done: tested with interfaces file in the bug

9 years agoIncrease LACP bypass period max to 900 seconds
Wilson Kok [Mon, 23 Feb 2015 19:18:34 +0000 (11:18 -0800)]
Increase LACP bypass period max to 900 seconds

Ticket: CM-5000
Reviewed By: Roopa
Testing Done:

9 years agoMerge branch 'CumulusLinux-2.5_br' of ssh://dev.cumulusnetworks.com/home/trac/cumulus...
Roopa Prabhu [Wed, 18 Feb 2015 20:32:05 +0000 (12:32 -0800)]
Merge branch 'CumulusLinux-2.5_br' of ssh://dev.cumulusnetworks.com/home/trac/cumulus into CumulusLinux-2.5_br

9 years agoCall mako renderer before rendering backslashes ('\')
Roopa Prabhu [Wed, 18 Feb 2015 20:28:50 +0000 (12:28 -0800)]
Call mako renderer before rendering backslashes ('\')

Ticket: CM-5104
Reviewed By:
Testing Done: Tested with interfaces file listed in the bug

9 years agoReplace bond-slave "link down" with "link protodown" for CLAG bond proto_down
anuradhak [Wed, 18 Feb 2015 16:03:07 +0000 (08:03 -0800)]
Replace bond-slave "link down" with "link protodown" for CLAG bond proto_down
handling.

Ticket: CM-4802
Reviewed By: CCR-2565
Testing Done: Yes

1. Earlier various clag components where using link admin state for enforcing
proto_down. With the introduction of a seperate proto_down state this is no
longer needed. Now on clag bond "proto_down" the bond and its slaves are
explicitly placed in a proto_down state. This carrier downs the slaves and
oper-downs the clag-bond. Change has been done in clagd, clag-monit script and
bonding driver.
2. Earlier misc tricks where needed in ifupdown2 to prevent slave state changes
for clag bond outside of clagd. These tricks are no longer needed and have been
reverted to keep ifupdown2 handling simple/consistent. This change basically
reverts #6985e1a376b538fbfa2346ef657427ae7e8f117a.

9 years agoifupdown2 must handle JSON input that is non-list
Sam Tannous [Wed, 11 Feb 2015 16:37:41 +0000 (11:37 -0500)]
ifupdown2 must handle JSON input that is non-list

Ticket: CM-4417
Reviewed By: roopa
Testing Done: Build powerpc image and tested alternate json format

ifupdown2 was patched to handle nonlist JSON input since this
is a valid format.
(cherry picked from commit 2597194f6f34344495f3a2b44bfe1d05887e1e77)

9 years agoAdd checks for BRIDGE_VLAN interfaces during link up/down
Roopa Prabhu [Tue, 10 Feb 2015 19:28:53 +0000 (11:28 -0800)]
Add checks for BRIDGE_VLAN interfaces during link up/down

Ticket: CM-4718
Reviewed By:
Testing Done: tested ifup/ifdown of vlan interfaces

9 years agoCheck for zero address on bridge ports before enslaving it to the bridge
Roopa Prabhu [Tue, 10 Feb 2015 19:17:00 +0000 (11:17 -0800)]
Check for zero address on bridge ports before enslaving it to the bridge

Ticket: CM-4859, CM-4382
Reviewed By:
Testing Done: Tested with config which included bond bridge ports with
zero address on the bond.

The bridge driver rejects the port add with -EINVAL.
A bond with no slaves is one usecase where the bond interface
has a zero hw address and is rejected by the bridge.
EINVAL currently is very confusing.

This patch checks for a valid ether add before enslaving the port to the
bridge.

9 years agoAdd dependency on python-argcomplete, python-ipaddr and python-gvgen
Roopa Prabhu [Mon, 9 Feb 2015 21:11:16 +0000 (13:11 -0800)]
Add dependency on python-argcomplete, python-ipaddr and python-gvgen

Ticket: CM-4453
Reviewed By:
Testing Done: Build tested
(cherry picked from commit ee9aa1a1bf510f950030f72cbc12ed41b0bc880d)

9 years agoMove clag_enable setting to ifupdown2 ifenslave.
anuradhak [Mon, 2 Feb 2015 17:54:53 +0000 (09:54 -0800)]
Move clag_enable setting to ifupdown2 ifenslave.

Ticket: CM-4802
Reviewed By:
Testing Done: yes

1. clag_enable needs to be set before slaves are added to the bond. Otherwise
bonding driver will bring the slaves up independent of clagd.
2. also added post_down clagd addon to cleanup the clag-id on ifdown.

9 years ago[Change by Roopa] To prevent ifupdown2 setting clag-bond slave states on ifup.
anuradhak [Mon, 2 Feb 2015 16:46:47 +0000 (08:46 -0800)]
[Change by Roopa] To prevent ifupdown2 setting clag-bond slave states on ifup.

Ticket: CM-4802
Reviewed By: CCR-2507
Testing Done: Yes

1. For clag bonds the slaves are kept down under various conditions (when clagd
is holding the bond in an errDisabled state). ifupdown2 should not set the slave
states for clag bonds.
2. Bonding driver sets the slave states on enslave and release (also for
non-clag bonds) so ifupdown2 doesn't need to set the slave state.

9 years agos/portautoedge/portadminedge/ + configure BA on uplink port
Roopa Prabhu [Thu, 29 Jan 2015 01:06:51 +0000 (17:06 -0800)]
s/portautoedge/portadminedge/ + configure BA on uplink port

Ticket:
Reviewed By:
Testing Done:

9 years agoHandle blank lines correctly in addons.conf
Roopa Prabhu [Thu, 22 Jan 2015 20:56:56 +0000 (12:56 -0800)]
Handle blank lines correctly in addons.conf

Ticket: (Reported by gospo)
Reviewed By:
Testing Done: Tested with blank lines in the file

9 years agoFix typo in comment in default config file
Roopa Prabhu [Fri, 16 Jan 2015 17:54:19 +0000 (09:54 -0800)]
Fix typo in comment in default config file

Ticket:
Reviewed By: trivial
Testing Done: no code change

9 years agoAdded clag-id to the interfaces example file.
anuradhak [Mon, 12 Jan 2015 21:44:54 +0000 (13:44 -0800)]
Added clag-id to the interfaces example file.

Ticket:
Reviewed By:
Testing Done:

9 years agochange ifupdown example for vxlan-learning to the non-default option
Balakrishnan Raman [Wed, 7 Jan 2015 06:12:08 +0000 (22:12 -0800)]
change ifupdown example for vxlan-learning to the non-default option

Ticket: CM-4723
Reviewed By: CCR-2408
Testing Done:

Change example to non-default option - "vxlan-learning off"

9 years agoFix BCM SDK tunnel termination object cleanup on vxlan tunnel delete
Balakrishnan Raman [Wed, 7 Jan 2015 05:16:39 +0000 (21:16 -0800)]
Fix BCM SDK tunnel termination object cleanup on vxlan tunnel delete

Ticket: CM-4723
Reviewed By: CCR-2408
Testing Done: vxlan_fld_test.py:test_bond_vxlinux_convergence_flaps, manual testing

On tunnel delete, tunnel termination object in BCM sdk is not cleaned properly.
As a result, mpls_entry in the hardware is left around even though software has
deleted the tunnel. This prevents subsequent dynamic creation of the same tunnel
and also mac learning, as mpls_entry points to invalid SVP with no CML setting
to do hardware learning.

Also, changes in ifupdown2 to make "vxlan-learning on" as default, so that
user/script doesn't have to explicitly turn on the learning.