Commit Graph

1620 Commits

Author SHA1 Message Date
Roopa Prabhu
dbc018d39d ifreload: fix handling(downing) of builtin interfaces on changes
Ticket: CM-8455
Review: CCR-4181
Testing: tested ifreload on builtin interface change

This patch handles removal of builtin interfaces (example swp*.100
below..which dont have iface sections) during a ifreload.

{noformat}
auto bridge
iface bridge
        bridge-vlan-aware yes
        bridge-ports swp3.100 swp15.100
{noformat}

if user changes swp15.100 to another interface and does a ifreload,
before this patch swp15.100 used to be around. This patch makes sure
swp15.100 is deleted in the process

I had to do some cleanup of flags in the process. I might have added
some extra cycles to ifreload. But i dont see an easy way to handle this
case.
2016-02-26 15:41:35 -08:00
Wilson Kok
7b2469dbf3 Removed lacp bypass priority mode
Ticket: CM-9494
Reviewed By: CCR-4184
Testing Done:

Also removed legacy 'fallback' options.
Now lacp bypass is enabled and disabled on a bond with:

    bond-lacp-bypass-allow [0|1]
2016-02-26 07:32:01 -08:00
Balakrishnan Raman
c07383d142 service node address config for vxlan device using "remote" attribute
Ticket: CM-9520
Reviewed By: CCR-4152
Testing Done: verified service node configuration

Use "remote" attribute in iproute2 command to provision
service node address for service node based replication. Changes also
include allowing only one service node per vxlan device, so its user's
responsiblity to select one service node per vxlan device if there
are multiple nodes to distribute the load.
2016-02-25 22:03:06 -08:00
Nikhil
54616d3f51 addons: vrf: support for vrf-default-route attribute
Ticket:CM-9106
Reviewed By: Roopa Prabhu and Dave Olson
Testing Done: Yes, by installing ifupdown and cumulus-tools deb on to cel-e1031-01

This patch adds per vrf default route: "ip route add table <tbid> unreachable default"

It also accepts a policy file with vrf-default-route [yes/no]

This also includes ifquery fixes for running and check.
2016-02-23 16:02:31 -08:00
Nikhil
72c964c2f2 addons: address: fix processing of 'preferred-lifetime' attribute
Ticket: CM-8773
Reviewed By: CCR-4079
Testing Done:Yes, with following cofiguration

auto swp1
iface swp1
	address 71.12.21.43
	address 2001:620:5ca1:160::47
	preferred-lifetime 30

Fix for this is, a small update in address.py method '_inet_address_convert_to_cidr'
where there is a check for different addres attributes.
2016-02-23 16:00:24 -08:00
Wilson Kok
5d0f83e36e Set vlan-filtering on bridge before adding bridge ports
Ticket: CM-6806
Reviewed By: CCR-4126
Testing Done:

Currently, when doing ifup of a bridge, the bridge is created
and ports are added to bridge before vlan_filtering is set on
the bridge. This causes extra churn on switchd which has to
configure the hardware one way and then tear it down and
reconfigure it again in the new way. For mlx, it causes even
more problems.

This patch moves the vlan_filtering setting of bridge to before
member ports are being added to the bridge, and it uses the new
iproute2 command for setting the attribute instead of through
sysfs.
2016-02-19 14:17:16 -08:00
Dave Olson
8f79f54df8 Fix incorrect install location of networking default file
Ticket: none
Reviewed By: roopa,satish
Testing Done: built, installed, verified correct location

The install file resulted in creating /etc/default/networking/ as a
directory and installing the networking.default file in it.  Rename
networking.default to networking, and change the install file.
Normally dh_installinit handles all this, but since the package is
ifupdown2, and the file is networking, that doesn't happen.

Also, because we had created a directory with the name of what we want
to install as a file, we need to remove it if it exists.  This addition
of a preinst file should not go upstream, and should be removed in a few
weeks when everybody has re-installed enough.
2016-02-19 14:06:58 -08:00
Roopa Prabhu
5e01fb8056 ifupdownaddons: iproute2: support for vrf linkinfo
Closes: CM-8518
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Acked-by: Nikhil Gajendrakumar <nikhil@cumulusnetworks.com>
2016-02-19 13:47:29 -08:00
Sam Tannous
6c5e92aa70 ifquery running not showing vlan ranges in 3.0
Ticket: CM-9097
Reviewed By: Trivial
Testing Done: Tested on Chris' config

In 3.0, the bridge vlan show command does not print
VLAN ranges unless you use the "-c" option.
This patch modifies the bridge vlan show call in
iproute2.py to use "-c".
2016-02-18 16:49:40 -05:00
Anuradha Karuppiah
1c89fd85ff Remove clag_enable dependancy from ifupdown2.
Ticket: CM-9078
Reviewed By: CCR-4110
Testing Done: clag bond add/del and clag slave add/del

This change basically does the following -
1. Proto-down swpX pre-clag-bond-enslave
2. Proto-up swpX post-clag-bond-release

Setting/clearing of clag-id will result in similar proto-state changes
and those are handled by clagd.

Note:
I really wanted to keep these changes out of ifupdown2 but the
order of setting is critical i.e. protodown has to happen enslave to
prevent additional flaps/STP TCNs. Theoretically #2 can be done by clagd
but there is no easy way to do #1.
2016-02-17 12:54:48 -08:00
John Berezovik
42517ec5f7 Changing source format to git to support revisions 2016-02-15 11:57:10 -08:00
John Berezovik
18f6ded263 Reset version to CL3.0 convention. Package builds from jenkins will come as <base>~<time>.<commit id>. First release is cl3u1 2016-02-15 11:55:30 -08:00
wkok
bb22d4d339 Modified lacp-bypass-all-active support to use the new sysfs
node /sys/class/net/bondx/bonding/lacp_bypass.

Ticket: CM-9266
Reviewed-by: trivial
Testing-done:
2016-02-12 10:19:38 -08:00
wkok
a63b57d5a5 Disable old LACP bypass options
Ticket: CM-9266
Reviewed-by: trivial
Testing-done:

For now disable old LACP bypass options so that ifreload does
not give errors, as the corresponding sysfs nodes do not exist in
the latest 4.1.y kernel.
2016-02-10 20:58:23 -08:00
Dave Olson
57eca61da5 Fixed one more reference to /etc/init.d/networking; remove switchd dependency
Ticket:
Reviewed By: trivial
Testing Done:  built, installed

Don't want to leave incorrect confusing references behind.

Instead of having the networking script depend on switchd, since
ifupdown2 is upstream, I'll add the reverse dependency to the
switchd.service.

Added Documentation line
2016-02-08 20:32:49 -08:00
Sam Tannous
caa23e5fed ifupdown2 needs to set fdelay before maxage in bridge mstpctl.py addon module
Ticket: CM-8725
Reviewed By: roopa
Testing Done: tested with user's config on amd64 platform

When setting mstpctl params from user given fdelay and maxage,
ifreload and ifup is setting maxage before fdelay.

Since there is a check for (Bridge Foward Delay - 1 second) >= Bridge Max Age
fdelay must be set before maxage because the fdelay is a default value.
2016-02-08 19:43:20 -05:00
Dave Olson
9a7878c682 Remove /etc/init.d/networking after all - causes loops during image builds
Ticket:  none
Reviewed By: trivial
Testing Done:  installed, Alex tried for image creations.

apparently with some of our packages like mstpd still using init.d for a
while longer, just having the init.d/networking file causes the original
complaints about loops between services.

So I'm purging it completely.

Also clean up the comments a bit in start-networking
2016-02-08 13:54:17 -08:00
Scott Emery
969aac98f7 ifupdown2: After loading bonding driver, continue to create bond
Ticket: CM-9182
Reviewed By: Trivial
Testing Done: ifup'd bond when bonding module was not yet loaded.

The bond support in ifupdown2 would check to see if the bonding module is
loaded when creating a bond. If it was not it would load the driver and return.
The correct operation is to load the driver and then continue to create the
bond.
2016-02-08 12:48:37 -08:00
Anuradha Karuppiah
e7cd7b3bf1 Cleanup clag enable references.
Ticket: CM-9078
Reviewed By: Trivial
Testing Done: bond ifdown/ifup on s6000

This needs to be replaced with protodown of clag bond slaves
pre-enslave (TBD; coming soon).
2016-02-05 16:01:59 -08:00
Roopa Prabhu
a1c2368634 addons: vrf: iproute2 only reads .conf files
Fix iproute2 vrf map file to end with .conf

Closes: CM-9137
Reviewed By: Roopa
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
2016-02-04 22:02:30 -08:00
Scott Emery
a0a8d7e094 ifupdown2: Modify implementation of nowait option
Ticket: None
Reviewed By: CCR-4058
Testing Done: ifup'd interface with both dhcp-wait: "no" and dhcp-wait: "yes"
and not specified at all.

A previous patch implemented the nowait option for DHCP. This patch changes the
name of the option to "dhcp-wait" and makes the default, if nothing is specified
in the policy files, to be "yes", which means dhclient will be called without
the "-nw" option, causing it to wait for up to a minute for a response from the
DHCP server before continuing.

The format of the JSON in the policy file for this option was also changed so
that it conforms to the other ifupdown2 policy options. This format is now:

{
    "dhcp": {
        "defaults": { "dhcp-wait": "no" }
    }
}

Also, the documented argument values are "yes" and "no". Any other values, will
be interpreted as "yes".

A subsequent patch in cl-basefiles will be made to include this fragment in
/var/lib/ifupdown2/policy.d/dhcp.json so that Cumulus Linux will default to
not waiting for DHCP to complete.
2016-02-03 16:38:18 -08:00
Roopa Prabhu
28102a01e2 debian: add /var/lib/ifupdown2/policy.d to .dirs file
Fixes: ec205cb3f8b0("policymanager: fix default policy file paths")
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-02-02 22:35:41 -08:00
Scott Emery
6d359159c3 ifupdown2: Add nowait attribute for dhcp addon
Ticket: None
Reviewed By: CCR-4058
Testing Done: ifup'd interface with both nowait=0 and nowait=1 and not specified
at all.

The Mellanox platform, as well as some others probably, has two management
interfaces: eth0 and eth1. The customer may plug a cable into either one of
these interfaces, and very rarely both of them. If only one cable is plugged in
and we don't know which one, then /etc/network/interfaces must be configured
by default to automatically bring up both interfaces using DHCP. But when an
interface does not have link, it stalls the boot process for 60 seconds while
dhclient times out.

This patch changes the default dhclient behavior to not wait for DHCP to
complete, by using the "-nw" option when calling dhclient. This means that
dhclient will immediately return and DHCP will complete in the background.

A module attribute has been added for the DHCP addon called "nowait", which
defaults to 1. If this attribute is set to 0, then dhclient will revert to its
previous behavior and delay up to a minute while DHCP completes. This attribute
can be specified in a policy file, e.g. /etc/network/ifupdown2/policy.d/dhcp.json,
with contents such as:

{
  "dhcp" :
  {
    "nowait" : 0
  }
}
2016-02-01 16:42:28 -08:00
Roopa Prabhu
ec205cb3f8 policymanager: fix default policy file paths
Change policy manager default policy file location:
from /var/lib/ifupdownaddons/policy.d to
/var/lib/ifupdown2/policy.d

This aligns well with the user policy file location:
/etc/network/ifupdown2/policy.d/

Fixes 59dad2ca80("debian: sync debian files with from upstream debian repo")
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-02-01 13:28:54 -08:00
Roopa Prabhu
8465de9077 addons: support for new addon module for vrf
This patch adds initial support for vrf in ifupdown2.

Example interfaces file section:
auto swp1.100
iface swp1.100
    vrf blue

auto blue
iface blue
    vrf-table 10

iproute2 vrf map is generated under:
/etc/iproute2/rt_tables.d/ifupdown2.vrf_map

this patch also adds prelimnary support for 'vrf-table auto'.
But this needs more work.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-01-28 22:01:59 -08:00
Dave Olson
07678ee4ce Create a networking service script, so we can run it after switchd
Ticket: CM-8790
Reviewed By: wkok,roopa
Testing Done: built, installed, rebooted

jessie's networking starts as an init.d service.   Trying to force ordering
between init.d and systemd services when there are dependencies doesn't work
well (especially since the init.d/networking service is forced very early
because of the remote filesystem requirement in jesie).

Converting networking to a script run as a systemd service allows us to start
networking after switchd.  The new script is /sbin/start-networking.  I chose
to keep it in /sbin, rather than put it in /usr/cumulus/bin, because it's core
functionaity.

I am not removing /etc/init.d/networking, it just gets ignored unless somebody
types it manually.  If somebody does that, systemctl runs through the lsb
hooks.  The two lost abilities below are just ignored if passed.  I'm
also preventing creating the rc.d symlinks to the init.d/networking
script to reduce future confusion.

We lose some init.d "convenience" functionality because it's not available
through systemd.  What we lose are:
  reload-currently-up - can still be done with ifreload --currently-up
  force-reload - can still be done with ifreload -f -a
We keep start, stop, reload, restart
2016-01-20 13:05:13 -08:00
anuradhak
9022763806 Fix "bridge vlan add vid" setting failure.
Ticket: CM-8845
Reviewed By: Roopa
Testing Done: vlan aware bridge SVI ifup/ifdown

Drop the vid_end parameter from IFLA_BRIDGE_VLAN_INFO attribute
2016-01-15 15:33:05 -08:00
Roopa Prabhu
385107439c networkinterfaces: dont fail if you don't find a sourced interfaces file
before this commit, an error in reading a sourced file would
result in an error. This commit converts it to a warning and continue

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2015-12-23 19:41:21 -08:00
Roopa Prabhu
494d31d26c address: initialize newaddr
Closes: CM-8558
Review: CCR-3921
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
[rp: cherrypick of commit 3af9e9ef535a]
2015-12-23 19:41:14 -08:00
Roopa Prabhu
b695613baa debian: remove systemd networking .service file
This patch temporarily removes systemd networking service
script. This enables ifupdown2 native init script to run.
systemd networking init script will be re-enabled in the
future after we test and claim that it works.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2015-12-22 23:42:34 -08:00
Roopa Prabhu
1642c64bbd ifupdown: sync new path file names from debian upstream
pulls in some path related changes from upstream debian repo.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2015-12-20 23:06:17 -08:00
Roopa Prabhu
59dad2ca80 debian: sync debian files with from upstream debian repo
These include changes that were done to move ifupdown2
to use pybuild and some debian policy fixes

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2015-12-20 23:06:12 -08:00
Roopa Prabhu
bd7d8f4a0e ifupdownconfig: add missing config module ifupdownconfig.py
Add back missing ifupdown/ifupdownconfig.py.
fixes a cherry-pick error.

Fixes 0582f185ed ("ifupdown2: address: squash addr config and process
them on the youngest sibling")
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2015-12-20 23:06:12 -08:00
Roopa Prabhu
9a8ad21aab ifupdown2: modulebase: fix parse_glob arguments
Ticket: CM-8413
Reviewed By: trivial
Testing Done: Tested failing glob expression in the bug report

Fixes bcca6f753a25 ("ifupdown2: fix a few regex parsing error messages")

(cherry picked from commit 997b0438104bacf12e2db6bdc29c7ea1fec4d91b)
2015-12-09 14:02:54 -05:00
Roopa Prabhu
3fe9e36474 Revert "ifupdown2: address: set addr_config_squash to 1 by default"
This reverts commit de57cf0ce90c15df37fc25589947bbaeadcadd3b.

(cherry picked from commit 1050514fca0a7101eefa1954610211ca0987e29a)
2015-12-09 14:02:40 -05:00
Sam Tannous
b97687bc96 ifupdown not restoring mstpctl attributes (e.g. bpdufilter, bpduguard) in mstpctl
Ticket: CM-7756
Reviewed By: roopa
Testing Done: built powerpc and tested ifupdown2 as well as new tests

Once mstpctl-portbpdufilter or mstpctl-bpduguard is enabled for
an interface, removing the configuration in /etc/network/interfaces
does not toggle the mstpctl state back to no.

The root cause of this problem is that "ifreload" does not check default settings for MSTP configuration
for bridge ports and use a default when that setting is removed from the configuration.

This patch adds a check in the existing loop on attribute values.
If there is no configured value, we check to see if a default exists.
self._modinfo['attrs'][attrname]['default'] exists.
If it exists and it is different then the currently running value
we reset the attribute to its default. This is what a customer would expect if
they removed a configured value.

(also added test in cl-tests to check this functionality)

(cherry picked from commit 63d0f7082d44fedabe002aebbb658751dc655a46)
2015-12-09 14:02:29 -05:00
Roopa Prabhu
2d8b307bac ifupdown2: main: call get dependents handler on all iface stanzas of an interface
Ticket: CM-8330
Reviewed By: balki
Testing Done: Tested with interfaces file in the bug

(cherry picked from commit 14570e6d442d1c9a3742f1dd989f7af673e3cc7f)
2015-12-09 14:02:18 -05:00
Roopa Prabhu
5f8c03e7a1 ifupdown2: mstpctl: check mstpd running just once during init of mstpctl modules
Ticket: CM-8035
Reviewed By: wkok
Testing Done: Tested mstp commands in interfaces file

(cherry picked from commit 2c3471f2082c8adbdcc395cbd0066680f280b9e5)
2015-12-09 14:02:07 -05:00
Roopa Prabhu
eca54a3e5a ifupdown2: address: set addr_config_squash to 1 by default
Ticket: CM-7917
Reviewed By: CCR-3845
Testing Done: Tested address config reloading/purging with multiple
iface stanzas

We have had enough cases with address purging with multiple interfaces,
so turning this on by default

(cherry picked from commit de57cf0ce90c15df37fc25589947bbaeadcadd3b)
2015-12-09 14:01:50 -05:00
Roopa Prabhu
200453838b ifupdown2: clagd: check clag service restart status and print warning if
not running

Ticket: CM-8211
Reviewed By: CCR-3876
Testing Done: Tested clagd parameters change from ifupdown2

$ifquery bond10.4094
auto bond10.4094
iface bond10.4094
    address 169.254.0.27/24
    clagd-peer-ip 169.254.0.28
    clagd-sys-mac 44:38:39:ff:40:94
    clagd-backup-ip 172.27.28.1
    clagd-priority 4096
    clagd-args --peerTimeout 4o

$ifup -v  bond10.4094
info: Executing /usr/sbin/service clagd restart
info: executing /usr/sbin/service clagd status
[FAIL] clagd is not running ... failed!
warning: bond10.4094: clagd failed to start..Please check clagd log for
details

$tail -f /var/log/clagd.log
2015-11-25T22:14:44.014582+00:00 cel-redxp-06 clagd[30875]: Invoked
with: /usr/sbin/clagd --daemon 169.254.0.28 bond10.4094
44:38:39:ff:40:94 --priority 4096 --backupIp 172.27.28.1 --peerTimeout
4o
2015-11-25T22:14:44.020579+00:00 cel-redxp-06 clagd[30875]: There was an
error in the command line parameters.
2015-11-25T22:14:44.020609+00:00 cel-redxp-06 clagd[30875]: argument
--peerTimeout/-t: invalid int value: '4o'
2015-11-25T22:14:44.020618+00:00 cel-redxp-06 clagd[30875]: exit with
status -1

(cherry picked from commit ac4f4a129a9125eeaf17a48a200ad8ac44bf7ef6)

Conflicts:
	packages/clag/ifupdown/clagd.py
2015-12-09 14:00:58 -05:00
Roopa Prabhu
cfa06db648 ifupdown2: syntax-check: exit with 1 if syntax errors
Ticket: CM-7995
Reviewed By: CCR-3850
Testing Done: Tested exit code on syntax errors

This patch adds members 'errors' and 'warns' to networkinterfaces.py
to track errors and warns during parsing interfaces file.

This patch also adds --syntax-check option to ifreload
given people seem to use ifreload more than ifup these days.

$ ifreload --syntax-check -a
error: /etc/network/interfaces: iface swp1.200: unsupported keyword (roopa-attr)
$ echo $?
1

(cherry picked from commit e643a136fcf5d387ff0f9a31cb6a6af4983e1012)
2015-12-09 13:53:55 -05:00
Roopa Prabhu
ff28a49e7d ifupdown2: bridge: try to interpret bridge port add rtnetlink return strings from
iproute and print meaningful error

Ticket: CM-6278
Reviewed By: CCR-3851
Testing Done: Tested error cases for bridge with multiple vlans when
net.bridge.bridge-allow-multiple-vlans is zero

new error message with the patch:

$ifquery br-vlan0502
auto br-vlan0502
iface br-vlan0502
    bridge-ports swp2.502 swp3.12
    bridge-stp on
    mstpctl-portadminedge swp2.502=yes
    mstpctl-portbpdufilter swp2.502=yes
    address 3.50.2.1/24

$ifup br-vlan0502

<snip>
error: br-vlan0502: net.bridge.bridge-allow-multiple-vlans not set, multiple
vlans not allowed
error: br-vlan0502: failed to execute cmd 'ip -force -batch - [link set
dev swp3.12 master br-vlan0502
addr flush dev swp3.12
]'(RTNETLINK answers: Invalid argument
Command failed -:1)

(cherry picked from commit 3d06230cba47e8d8244439ea4d07dbdf05011067)
2015-12-09 13:53:43 -05:00
Roopa Prabhu
307e06bb2c ifupdown2: bridge: fix bridge-pvid under bridge 'notfound' during ifquery --check
Ticket:
Reviewed By:
Testing Done: Tested ifquery --check with bridge-pvid

bridge-pvid and bridge-vids on a bridge does
not correspond directly to a running config
on the bridge. They correspond to default
values for the bridge ports. And they are
already checked against running config of the
bridge port and reported against a bridge port.
So, This patch ignores these attributes under the bridge.
Uses '2' for ignore today. XXX: '2' will be
mapped to a defined value in subsequent patches.

Before:
auto bridge
iface bridge
[fail]
    bridge-vlan-aware yes                                       [pass]
    bridge-ports swp3 swp4                                      [pass]
    bridge-pvid notfound                                        [fail]

After:
auto bridge
iface bridge
[pass]
    bridge-vlan-aware yes                                       [pass]
    bridge-ports swp3 swp4                                      [pass]
    bridge-pvid 20

(cherry picked from commit 29e70abbf7920cf94c3ebd738dd757c2ca27b35c)
2015-12-09 13:53:30 -05:00
Roopa Prabhu
0582f185ed ifupdown2: address: squash addr config and process them on the youngest sibling
Ticket: CM-7917
Reviewed By: CCR-3845
Testing Done: Tested changing address and ifreloading on multiple iface stanzas

In presence of multiple iface stanzas, current ifupdown2 does not purge
existing addresses.
Because each ifaceobject processing looks at only its stanzas and it is
afraid that it may purge running addresses that does not belong to
itself. Historically multiple iface stanzas are processed individually
than squashing them as a single interface. Squashing iface stanzas into
a single iface stanza has been a problem in the past and also does not
work well with iface stanzas that are supported by ifupdown (I dont have
a specific problem example right now...but)

This patch processes all address attributes when processing the first iface
object (or iface stanza). Unsure if this can be a surprise to existing
users. It should not but cant say sometimes people have weird things in
their pre-up/post-up commands. Hence this is controlled by a ifupdown2.conf
variable addr_config_squash=0 set to off by default. still debating if this
can be on by default.

When addr_config_squash=0 and existing addresses are not purged a
warning is displayed:
"warning: swp1: interface has multiple iface stanzas skip purging
existing addresses"

(cherry picked from commit 7aaa75674547392f2abb8273b18671f0795b3eaf)
2015-12-09 13:53:20 -05:00
Roopa Prabhu
0c8332bc5e ifupdown2: fix a few regex parsing error messages
Ticket:
Reviewed By: CCR-3804
Testing Done: Tested regex parsing failures

This is mostly a cosmetic fix. we were failing with weird/unclear errors
on unable to parse regex expressions correctly.
This patch mainly adds the interface name to the message and plus adds
an info message showing the actual regex being used in searches.

example config:
{noformat}
auto br-roopa
iface br-roopa
  bridge-vlan-aware yes
  bridge-ports regex '(\\Aswp3\\Z|\\Aswp4\\Z)'
  bridge-pvid 20
{noformat}

before the patch:
warning: br-roopa: error getting dependent interfaces (unbalanced
parenthesis)

after the patch (not pretty but easier to debug)

info: br-roopa: evaluating port expr '['regex', "'(", 'Aswp3', 'Z|',
'Aswp4', "Z)'"]'
warning: br-roopa: error getting dependent interfaces (br-roopa: error
searching regex ''(' in swp38 (unbalanced parenthesis))

(cherry picked from commit bcca6f753a25494666d53f1f2f3c855ffa41d7f0)
2015-12-09 13:53:07 -05:00
Sam Tannous
2722bb1972 Revert "ifupdown not restoring mstpctl attributes (e.g. bpdufilter, bpduguard) in mstpctl"
This reverts commit bbd11771f5571c67c8f110c2b464817ce31155b9.

This introduced an error where if the config has old bridge driver
and configures port attributes on the bridge, the attributes are reset
to defaults after they are configured by the bridge settings.

(cherry picked from commit 651d1980de02fb108975900ed007087d9a79934c)
2015-12-09 13:52:53 -05:00
Sam Tannous
3482d41e4d Revert "Patch for errors warning "global name 'get_mod_subattr' is not defined"
This reverts commit 5649f0a28422794081e6a6ba1dd889364760ccf0.

(cherry picked from commit bfbb33815ce0e5d0584ce0a10ed38f04234eb43d)
2015-12-09 13:52:00 -05:00
Sam Tannous
5df79763d3 Virtual interfaces for VRR bounced during ifreload -a
Ticket: CM-8143
Reviewed By: scotte, roopa
Testing Done: ssim and powerpc

This was first seen as a side issue with switchd terminating and not restarting (filed as CM-8109).

When ifreload -a is issued, all of the vrr interfaces were bounced, even though there were not any
configuration changes.

In keeping with the philosphy of making ifreload non-disruptive, this patch no longer
disrupts vrrs if the existing config has not changed.
2015-11-16 23:43:39 -05:00
Sam Tannous
54713cee98 Patch for errors warning "global name 'get_mod_subattr' is not defined
Ticket: CM-8248
Reviewed By: Trivial
Testing Done: None

Fix for

On bootup and during service network restart these warning messages are thrown out.
root@cel-ken-01:/var/log# service networking restart
[....] Reconfiguring network interfaces...warning: global name 'get_mod_subattr' is not defined
warning: global name 'get_mod_subattr' is not defined
warning: global name 'get_mod_subattr' is not defined

warning messages in ifupdown2
2015-11-16 22:22:44 -05:00
Sam Tannous
267c4cba58 ifupdown not restoring mstpctl attributes (e.g. bpdufilter, bpduguard) in mstpctl
Ticket: CM-7756
Reviewed By: roopa
Testing Done: Tested ssim and powerpc images

Once mstpctl-portbpdufilter or mstpctl-bpduguard is enabled for
an interface, removing the configuration in /etc/network/interfaces
does not toggle the mstpctl state back to no.

The root cause of this problem is that "ifreload" does not check default settings for MSTP configuration
for bridge ports and use a default when that setting is removed from the configuration.

This patch adds a check in the existing loop on attribute values.
If there is no configured value, we check to see if a default exists.
self._modinfo['attrs'][attrname]['default'] exists.
If it exists and it is different then the currently running value
we reset the attribute to its default. This is what a customer would expect if
they removed a configured value.
2015-11-16 14:25:56 -05:00