1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

41 Commits

Author SHA1 Message Date
d3ad131ee8 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
2015-07-02 17:10:04 -04:00
0532f0a3d3 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
2015-06-21 17:37:27 -07:00
0a3bee28ca 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)
2015-06-04 15:28:57 -04:00
3d44fbd0c9 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)
2015-06-04 15:27:48 -04:00
26434da621 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>
2015-04-27 21:18:14 -07:00
e308cb8280 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)
2015-04-25 19:12:16 -07:00
1cda1e437b rework error message
Ticket: CM-5373
Reviewed By:
Testing Done: tested interfaces file with shared dependents
2015-04-03 22:33:53 -07:00
45ca0b6d42 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
2015-04-03 22:18:32 -07:00
a4912b996e 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.
2015-04-03 20:47:06 -07:00
fa714fa248 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)
2015-03-10 16:54:41 -04:00
496745cdc0 Add checks for BRIDGE_VLAN interfaces during link up/down
Ticket: CM-4718
Reviewed By:
Testing Done: tested ifup/ifdown of vlan interfaces
2015-02-10 11:28:53 -08:00
7bbc934097 Handle blank lines correctly in addons.conf
Ticket: (Reported by gospo)
Reviewed By:
Testing Done: Tested with blank lines in the file
2015-01-22 12:56:56 -08:00
f3b69969e3 Fix link_type flag for objects read from state file + fix link_type
initializations in a few other places

Ticket: CM-4610
Reviewed By:
Testing Done: Tested with the failing sequence of events described in
the bug
2014-12-31 14:10:45 -08:00
cebe79c93a Move link_master_slave flag overrides to /sbin/ifupdown + log a msg to
indicate link_master_slave flag status

Ticket:
Reviewed By:
Testing Done: ifupdown2 sanity tests with link_master_slave feature on/off
2014-12-29 22:10:36 -08:00
61c4d72447 Suppress 'Network down' warnings when link_master_slave feature is on
Ticket: CM-4462
Reviewed By:
Testing Done: Tested with interfaces file given in the bug.

The 'network down' msg from the kernel is when the lower device is not
'admin up'. In CM-4462 it is seen when the vlan interface on the bond
is 'admin up' when the bond is still in 'admin down' state.
The bond is also a bridge port so, bond will be 'admin up' when
the bridge it belongs to is brought up.

As link_master_slave feature is on only when all network interfaces
are brought up/down, the states of all interfaces will eventually
converge to 'admin up', so ignoring such transient 'network down' messages.
2014-12-26 09:57:08 -08:00
7e2e64fbe9 Fix a bug with disabling of config option link_master_slave + turn off
link master slave feature when '-a' is not specified.

Ticket: CM-4408
Reviewed By:
Testing Done: Tested with ifupdown2.conf link_master_slave on/off

This will make the behaviour change mostly invisible to users

Conflicts:
	packages/ifupdown2/ifupdown/ifupdownmain.py
2014-12-26 09:56:39 -08:00
a9ab1b4f10 Rework bridge upperiface handling (to fix some problems with the new
bridge driver and svi config)

Ticket: CM-3346
Reviewed By:
Testing Done: Tested upper interface handling during ifup of
bonds/bridges/svis
2014-12-26 09:53:51 -08:00
97f4cff80c Merge branch 'release-2.5' into CumulusLinux-2.5_br
Conflicts:
	build-config/make/local-pkgs.make
	packages/cafe/clobjects.py
	packages/cafe/clobjects_l3_quagga.py
	packages/cl-basefiles/etc/cumulus/datapath/traffic.conf
	packages/cl-utilities/etc/monit/monitrc.d/cumulus
	packages/clag/ifupdown/clagd.py
	packages/ifupdown2/addons/bridge.py
	packages/ifupdown2/addons/ifenslave.py
	packages/ifupdown2/ifupdown/iface.py
	packages/ifupdown2/ifupdown/ifupdownmain.py
	packages/ifupdown2/ifupdown/scheduler.py
	packages/portwd/portwd
	patches/bcm-sdk/series
	patches/iproute/bridge-increase-netlink-rcv-buf-size.patch
	patches/iproute/series
	patches/kernel/driver-support-sff-8436-eeprom.patch
	patches/kernel/network-bridge-dont-install-local-mac.patch
	patches/kernel/series
	patches/lldpd/series
	patches/mstpd/clag_port_fsm_reset.patch
	patches/mstpd/mstpd_init_system.patch
	patches/mstpd/series
	patches/quagga/series
	rootconf/default/etc/default/cron
	switchd/hal.c
	switchd/hal_bcm.c
	switchd/hal_bcm_config.c
	switchd/hal_bcm_config.h
	switchd/hal_config.c
	switchd/hal_config.h
	switchd/hal_int.h
	switchd/sync.c
	tests/tests/l3/bgp_alpm_test.py
	tests/tests/l3/bgp_path_hunting.py
	tests/tests/l3/bgp_smoke_test.py
	tests/tests/l3/l3_node.py
	tests/tests/l3/mc_snoop_test.py
	tests/tests/lib/decorators.py
	tests/tests/smoke/testifupdown2.py
	utilities/ci/pretest.yml
	utilities/distro-cmd
	utilities/packages/ssim2/setup.py
	utilities/packages/ssim2/ssim2/simlib.py
2014-12-24 12:20:53 -08:00
a070c90ec3 Multiple fixes and cleanup
Ticket: CM-3346
Reviewed By:
Testing Done: Tested ifupdown2 sanity

- moved 'admin up' delays that we introduced recently to be
configurable via two ifupdown2.conf attributes
    # Let link master (bridges, bonds) own the link state of slaves
    link_master_slave=1

    # Delay admin state change till the end
    delay_admin_state_change=0

- reduced some redundant traversal of dependency trees

- fixed a few bugs in query check
2014-12-17 12:39:38 -08:00
5be7399dc9 Fix if condition when propagating link_type (old flags check left over from my previous
commit)

Ticket: CM-4408
Reviewed By:
Testing Done: Tested with old bridge driver config (bug reported by
satish)
(cherry picked from commit 11e6ae96aae85591e8d32e1062d979e51de9e424)
2014-12-09 14:24:06 -08:00
c416da6adc Move LINK_MASTER/LINK_SLAVE to a new field link_type (purna hit some
issues with having it in flags) + add check for bond slave being already up

Ticket: CM-4408
Reviewed By:
Testing Done: some bond sanity test
(cherry picked from commit 346b62a41fbf4521008cd8a9b0fa227e75a5d994)
2014-12-09 14:24:05 -08:00
b48ff1a983 This patch moves bond slave link ownership to the bond module and makes
sure that slaves can never be brought admin up on their own when they
are not in the bond

Ticket: CM-4408
Reviewed By: CCR-2323
Testing Done: Tested ifup/ifdown of bond slaves and bond interface

This patch introduces:
- introduces 2 interface flags, LINK_MASTER and LINK_SLAVE.
- The bond module will set LINK_MASTER on the bond iface object
indicating that the bond module owns the link.
- Which means that all lower devices /slaves of the bond get their
link when the bond (aka LINK_MASTER) is processed in the bond module
- The module that queries dependencies propagates the LINK_SLAVE flags
on the dependents of LINK_MASTER.
- The scheduler now acts on the LINK_SLAVE flag. If LINK_SLAVE is set,
it skips setting admin 'up' on that interface. It also makes sure the
interface is not already in the bond.
    ie if an interface is a LINK_SLAVE (bond slave in this case), admin
up will not be executed when the interface is not inside the bond.
(cherry picked from commit 84b5a07a4f7685c7ae2eac5892889d6c0e08b2eb)
2014-12-09 14:24:05 -08:00
33a2e9e9bf Fix if condition when propagating link_type (old flags check left over from my previous
commit)

Ticket: CM-4408
Reviewed By:
Testing Done: Tested with old bridge driver config (bug reported by
satish)
2014-12-09 12:56:45 -08:00
c9bba7539d Move LINK_MASTER/LINK_SLAVE to a new field link_type (purna hit some
issues with having it in flags) + add check for bond slave being already up

Ticket: CM-4408
Reviewed By:
Testing Done: some bond sanity test
2014-12-08 22:59:41 -08:00
7f045fd868 This patch moves bond slave link ownership to the bond module and makes
sure that slaves can never be brought admin up on their own when they
are not in the bond

Ticket: CM-4408
Reviewed By: CCR-2323
Testing Done: Tested ifup/ifdown of bond slaves and bond interface

This patch introduces:
- introduces 2 interface flags, LINK_MASTER and LINK_SLAVE.
- The bond module will set LINK_MASTER on the bond iface object
indicating that the bond module owns the link.
- Which means that all lower devices /slaves of the bond get their
link when the bond (aka LINK_MASTER) is processed in the bond module
- The module that queries dependencies propagates the LINK_SLAVE flags
on the dependents of LINK_MASTER.
- The scheduler now acts on the LINK_SLAVE flag. If LINK_SLAVE is set,
it skips setting admin 'up' on that interface. It also makes sure the
interface is not already in the bond.
    ie if an interface is a LINK_SLAVE (bond slave in this case), admin
up will not be executed when the interface is not inside the bond.
2014-12-08 17:15:57 -08:00
ad25e7bb98 Misc fixes. Add a --skip-upperifaces option to ifup (given the confusion
over ifup handling of upperifaces by default) + some fixes in the
reserved vlan check

Ticket: CM-3346
Reviewed By:
Testing Done: Tested ifupdown sanity.
2014-11-25 10:19:35 -08:00
16d854b461 Fix a few minor ifquery check failures
Ticket: CM-3346
Reviewed By:
Testing Done: Tested ifupdown2 sanity and query check failures.
2014-11-19 17:25:26 -08:00
fac4138bfe Change defaults result strings in ifquery check output
Ticket: CM-3810
Reviewed By:
Testing Done: tested ifquery check

defaults from /etc/network/ifupdown2/ifupdown2.conf
ifquery_check_success_str=(OK)
ifquery_check_error_str=(FAIL)
ifquery_check_unknown_str=
2014-11-15 23:34:02 -08:00
97382e8841 Fix auto flag handling during reload
Ticket: CM-4204
Reviewed By:
Testing Done: Tested ifreload with interfaces file in the bug

My last checkin moved the auto flag around causing the breakage
2014-11-12 22:43:24 -08:00
2da58137d8 Misc fixes + ifreload new option + cleanups + more ifquery support etc
Ticket: CM-3346, CM-3784, CM-3841
Reviewed By:
Testing Done: various ifupdown2 tests
2014-11-11 21:58:12 -08:00
8e113d6319 misc query and fdb/vlan add fixes
Ticket: CM-3346
Reviewed By:
Testing Done: ifupdown2 sanity
2014-11-03 17:55:51 -08:00
cb46a2082f misc bug fixes for svi address propagation, svi query etc
Ticket: CM-3346
Reviewed By:
Testing Done: Tested new format with new bridge driver

- add/del vlan aware bridge svi mac addresses from bridge
- shorten macvlan interface names to <bridge>-<vid>-v<n>
- fix query check for address-virtual interfaces
- fix query check for vlan interfaces
2014-10-28 23:04:40 -07:00
e160136944 Bug fixes and some query support
Ticket: CM-3346
Reviewed By:
Testing Done: sanity testing and syntax testing for new bridge driver
2014-10-28 16:10:00 -07:00
84ca006f82 First phase checkin for new format for vlan aware bridge
Ticket: CM-3346
Reviewed By:
Testing Done: Sanity test + test new bridge format

There are a bunch of open issues with `vlan` interface handling.
Below is the format.

auto swp1
iface swp1
    bridge-access 300
    mstpctl-pathcost 0
    mstpctl-adminedge yes
    mstpctl-autoedge yes
    mstpctl-p2p yes
    mstpctl-bpduguard yes
    mstpctl-treeprio 64
    mstpctl-network yes
    mstpctl-bpdufilter yes

auto swp2
iface swp2
    bridge-vids 301
    bridge-pvid 302
    bridge-pathcost 10
    bridge-priority 10
    bridge-multicast-router 0
    bridge-multicast-fast-leave 1

auto br0
iface br0
    bridge-vlan-aware yes
    bridge-stp on
    bridge-ports swp1 swp2
    bridge-vids 2001

auto br0.2001
iface br0.2001
    address 10.0.14.2
    hwaddress 00:03:00:00:00:12
    address-virtual 00:00:5e:00:01:01 11.0.4.1/24

auto br0.2001
vlan br0.2001
    bridge-igmp-querier-src 172.16.101.1
2014-10-24 10:11:07 -07:00
e74d01e1b2 Add rtnetlink api's for link creates
Ticket: CM-3346
Reviewed By:
Testing Done:
2014-10-12 13:50:05 -07:00
e57b12e75a Replace check mark by none and cross mark by ascii 'x' in --check output
Ticket: CM-3810
Reviewed By:
Testing Done:

These are configurable via strings check_success_str and check_error_str
in /etc/network/ifupdown2/ifupdown2.conf
2014-10-10 14:52:11 -07:00
8c13865cd4 Fix a few ordering issues + fix following upperiface for bridge device
Ticket: CM-3346
Reviewed By:
Testing Done: sanity test
2014-10-10 14:05:19 -07:00
679e656768 more support and fixes to support new format for vlan filtering bridge
Ticket: CM-3346
Reviewed By:
Testing Done: Tested with old and new formats

Details of the format are attached to the bug.
2014-10-09 12:58:16 -07:00
41febf8975 support for new bridge driver syntax
Ticket: CM-3346
Reviewed By:
Testing Done: tested vmware interfaces file with old and new formats

details:
- move bridge port membership to under the port
- move bridge port attributes under ports
- bridge attributes continue to remain under bridge
- special vlan interface for vlan attributes and svi config (iface
vlan-<vlanid/range>)
- maintain backward compatibility with all previously released bridge
config formats for vlan aware bridge

Open issues:
- check and running support will be done part of CM-3784
- ifquery currently expands and prints all the vlan-* interfaces.
2014-10-06 11:11:10 -07:00
ee3fcf4431 Minor fixes for multiple interfaces with the same config + performance
fix for the dependency graph generator code

Ticket:
Reviewed By:
Testing Done: sanity test
2014-09-26 14:23:15 -07:00
904908bc5f Documentation cleanup
Ticket:
Reviewed By:
Testing Done:

- these changes are mainly related to api doc generation using sphinx
2014-07-22 11:15:56 -07:00