]> git.proxmox.com Git - mirror_ifupdown2.git/log
mirror_ifupdown2.git
7 years agodebian: copyright: fixing merge errors
Julien Fortin [Tue, 6 Sep 2016 23:47:03 +0000 (16:47 -0700)]
debian: copyright: fixing merge errors

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoMerge remote-tracking branch 'cumulus/dev'
Roopa Prabhu [Fri, 2 Sep 2016 22:45:58 +0000 (15:45 -0700)]
Merge remote-tracking branch 'cumulus/dev'

Conflicts:
config/ifupdown2.conf
nlmanager/nllistener.py

7 years agoaddons: vrf: be more friendly to older iproute2 versions
Roopa Prabhu [Fri, 2 Sep 2016 22:10:24 +0000 (15:10 -0700)]
addons: vrf: be more friendly to older iproute2 versions

Ticket: CM-12049
Reviewed By: dsa, julien, nikhil
Testing Done: tested with and without /etc/iproute2/rt_tables.d/

OS does not have /etc/iproute2/rt_tables.d, on errors just info:
$ifreload -a -v
info: unable to save iproute2 vrf to table map ([Errno 2] No such file
or directory: '/etc/iproute2/rt_tables.d/ifupdown2_vrf_map.conf')

info: cannot find /etc/iproute2/rt_tables.d. pls check if your iproute2
version supports rt_tables.d

OS has /etc/iproute2/rt_tables.d, on errors warn:
$ifreload -a
warn: unable to save iproute2 vrf to table map ([Errno 2] No such file

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agonlmanager: changing log level (info->debug) for TXed messages
Julien Fortin [Tue, 23 Aug 2016 23:38:36 +0000 (16:38 -0700)]
nlmanager: changing log level (info->debug) for TXed messages

Ticket: CM-11857
Reviewed By: Roopa, Daniel W
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agordnbrd "Interrupted system call" traceback in nlmanager
Julien Fortin [Sun, 21 Aug 2016 21:35:04 +0000 (14:35 -0700)]
rdnbrd "Interrupted system call" traceback in nlmanager

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: roopa@cumulusnetworks.com
Ticket: CM-12487

7 years agonlmanager: rdnbrd "Interrupted system call" traceback in nlmanager
Julien Fortin [Sun, 21 Aug 2016 03:43:12 +0000 (20:43 -0700)]
nlmanager: rdnbrd "Interrupted system call" traceback in nlmanager

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: roopa@cumulusnetworks.com
Ticket: CM-12487

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: fix running_vids value when cache is stale
Roopa Prabhu [Fri, 19 Aug 2016 18:09:57 +0000 (11:09 -0700)]
addons: bridge: fix running_vids value when cache is stale

Ticket: CM-12552
Reviewed By: julien, nikhil
Testing Done: tested with failing config with bridge-access 1

This is similar to the fix done in the below commit for pvid:
"5061730ea5bf ("addons: bridge: fix default pvid handling in cases where
cache is stale")"

easier steps to reproduce:
- have a vlan aware bridge with more than one ports
- add 'bridge-access 1' to one of the ports
- boot the box with the config
- check that the  vlans are fine
- ifdown <interface_with_bridge_access_1>
- ifreload -a
- the interface with bridge_access 1 does
not have the pvid flag on vlan 1

This patch makes sure we assume the right running
vid and pvid value ie [1] and 1 if the
cache returns no values. vid = [1] and pvid = 1
are the kernel default/initial values for a port.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: vrf: don't delete vrf map file at init if mgmt vrf already exists
Roopa Prabhu [Sat, 13 Aug 2016 06:49:29 +0000 (23:49 -0700)]
addons: vrf: don't delete vrf map file at init if mgmt vrf already exists

Ticket: CM-12084
Reviewed By: julien, nikhil
Testing Done: tested with --allow=mgmt class

This fixes a problem where vrf map file was getting deleted
at boot during the second invocation of ifup. This is because
the code uses PERFMODE to check it is boot..but does
not realize that this may not be the first invocation of
ifup during the boot.

This patch adds additional checks for mgmt netdev to
make sure we delete the vrf map file only the first time.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agonetlink: adding ifacename name at the beginning of log info msg
Julien Fortin [Fri, 12 Aug 2016 15:36:27 +0000 (17:36 +0200)]
netlink: adding ifacename name at the beginning of log info msg

Ticket: None
Reviewed By: Roopa
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdownaddons: modulebase: log_error will log.error or raise an exception
Julien Fortin [Fri, 12 Aug 2016 14:30:53 +0000 (16:30 +0200)]
ifupdownaddons: modulebase: log_error will log.error or raise an exception

Ticket: None
Reviewed By: Roopa, Nikhil G
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agonetlink: logging equivalent iproute2 commands
Julien Fortin [Fri, 12 Aug 2016 13:45:52 +0000 (15:45 +0200)]
netlink: logging equivalent iproute2 commands

Ticket: None
Reviewed By: Roopa, Nikhil G
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: move the default running_pvid assignment to before
Roopa Prabhu [Fri, 12 Aug 2016 05:36:39 +0000 (22:36 -0700)]
addons: bridge: move the default running_pvid assignment to before
pvid_to_del is calculated

Ticket: CM-12355
Reviewed By: julien, nikhil
Testing Done: tested with failing config

My previous fix for the same bug did not fix the problem completly.
In this patch all running pvid calculation
is done before the pvid_to_del is calculated.
This makes sure the old pvid is deleted if it is not
the same as current pvid in all cases

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: vxlan: fix ifquery running to not proceed when vxlan-id is not
Roopa Prabhu [Thu, 11 Aug 2016 23:35:01 +0000 (16:35 -0700)]
addons: vxlan: fix ifquery running to not proceed when vxlan-id is not
available

Ticket: CM-12378
Reviewed By: julien, nikhil
Testing Done: tested ifquery running with examples in the bug

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agomodulebase: dont set iface status to error if raise_err is False
Roopa Prabhu [Thu, 11 Aug 2016 23:30:00 +0000 (16:30 -0700)]
modulebase: dont set iface status to error if raise_err is False

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: vrf: change warn to error if vrf master is not configured
Roopa Prabhu [Thu, 11 Aug 2016 23:20:16 +0000 (16:20 -0700)]
addons: vrf: change warn to error if vrf master is not configured

Ticket: CM-12360
Reviewed By: julien, nikhil
Testing Done: tested vrf slaves without master

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agonlpacket: add new attribute: AttributeStringInterfaceName with length check
Julien Fortin [Thu, 11 Aug 2016 01:05:04 +0000 (03:05 +0200)]
nlpacket: add new attribute: AttributeStringInterfaceName with length check

Ticket: CM-12302
Reviewed By: Daniel, Roopa, Nikhil G
Testing Done: ifupdown2 smoke test

With this pretty straight forward, we introduce a new Attribute in nlmanager,
so that we have single check and no code redundancy for ifname length. This
also prevent loosing time sending a netlink packet for an known error.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: fix default pvid handling in cases where cache is stale
Roopa Prabhu [Wed, 10 Aug 2016 22:35:48 +0000 (15:35 -0700)]
addons: bridge: fix default pvid handling in cases where cache is stale

Ticket: CM-12355
Reviewed By: julien, nikhil
Testing Done: tested with failing config

This can happen if the bridge vlans were
cached before the interface become a bridge port.
and when the interface becomes a bridge port
kernel adds a default pvid of 1. so this patch
assumes a default pvid is 1 if we did not find
anything in the cache. This will delete
the default pvid of 1 if the user has configured a
different pvid.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: address: catching and logging exception coming from `ip` batch execution
Julien Fortin [Wed, 10 Aug 2016 13:08:38 +0000 (15:08 +0200)]
addons: address: catching and logging exception coming from `ip` batch execution

Ticket: CM-8610
Reviewed By: Roopa, Nikhil G
Testing Done:

It used to be a silent exception, but not anymore because we catch it and log
accordingly (error) and flag the ifaceobj so that ifupdown2 returns 1.

$ cat /etc/network/interfaces
auto tap0
iface tap0
      mtu 9000
            address 172.17.28.0/31

$ ifreload -a
$ echo "address 2002:17:27:17/120" >> /etc/network/interfaces
$ ifreload -a
$ echo $?
0
$ # applying this patch
$ ifreload -a
error: tap0: cmd 'ip -force -batch - [addr add 172.17.28.0/31 dev tap0
addr add 2002:17:27:17/120 dev tap0
]' failed: returned 1 (RTNETLINK answers: File exists
Command failed -:1
Error: an inet prefix is expected rather than "2002:17:27:17/120".
)
$ echo $?
1
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown: template: changing error message when import mako fail
Julien Fortin [Wed, 10 Aug 2016 13:15:15 +0000 (15:15 +0200)]
ifupdown: template: changing error message when import mako fail

Ticket: CM-11590
Reviewed By: Roopa, Nikhil G
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agonlmanager: changing messages logged and raised when RXed NLMSG_ERROR
Julien Fortin [Thu, 11 Aug 2016 00:41:29 +0000 (02:41 +0200)]
nlmanager: changing messages logged and raised when RXed NLMSG_ERROR

Ticket: None
Reviewed By: Roopa, Nikhil G, Daniel
Testing Done: ifupdown2 smokes

The message logged and the exception raised by nlmanager, when receiving
an NLMSG_ERROR packet from the kernel, wasn't super explicit plus if the
error wasn't a netlink related failure we didn't provide any information
Now we use strerror with the provided error code to generate a nice msg.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agonlmanager: wait for ACK after single packet operation
Julien Fortin [Thu, 11 Aug 2016 00:40:24 +0000 (02:40 +0200)]
nlmanager: wait for ACK after single packet operation

Ticket: None
Reviewed By: Roopa, Nikhil G, Daniel
Testing Done: ifupdown2 smoke

We used to have these checks in the old rtnetlink python library.
They were missing in python-nlmanager this was a big regression for
ifupdown2.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdownaddons: iproute2: Cache vxlan remote ip addresses only if
Balakrishnan Raman [Tue, 9 Aug 2016 05:09:32 +0000 (22:09 -0700)]
ifupdownaddons: iproute2: Cache vxlan remote ip addresses only if
statically configured

Ticket: CM-12277
Reviewed By: CCR-5059
Testing Done: ifreload with a VxlanClagClosConfig.py config

get_vxlan_peers gets remote ip addresses if they are statically configured
through ifupdown2 (vxlan-remoteip <address>). These are cached in
ifupdown2's link object so that they can be used in 'ip link set' (if link
exists already), 'ifquery -r' and 'ifquery -c'. ifupdown2 should ignore and
not cache these addresses if they are provisioned by vxrd. Check if vxrd is
running before caching remote ip addresses. This helps in optimizing time
taken to ifreload with 1k bridge/vxlan interfaces (vlan-aware bridge) in a
vxrd/vxsnd setup.

Signed-off-by: Balakrishnan Raman <ramanb@cumulusnetworks.com>
7 years agoaddons: ethtool: skip speed zero from query running
Roopa Prabhu [Tue, 9 Aug 2016 06:15:20 +0000 (23:15 -0700)]
addons: ethtool: skip speed zero from query running

kernel might return running speed 0 if port does
not have carrier

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: address: never reset mtu on lo implicity
Roopa Prabhu [Mon, 8 Aug 2016 22:46:13 +0000 (15:46 -0700)]
addons: address: never reset mtu on lo implicity

we should leave the mtu on lo to the default mtu
if user has not requested to change it. lo has
a larger mtu because it does not really depend on a
physical mtu.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: bridge: use bridge json output for vlan
Roopa Prabhu [Mon, 8 Aug 2016 15:18:34 +0000 (08:18 -0700)]
addons: bridge: use bridge json output for vlan

Ticket: CM-11274
Reviewed By: julien, nikhil
Testing Done: tested with various bridge config

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: vrf: bring up vrf master when ALL or CLASS
Roopa Prabhu [Fri, 5 Aug 2016 18:32:21 +0000 (11:32 -0700)]
addons: vrf: bring up vrf master when ALL or CLASS

Ticket: CM-12084
Reviewed By: julien, nikhil
Testing Done: Tested ifreload/ifup/ifdown --allow=<class>

vrf slave brings up the master if master is not up yet.
Today this is done only when ALL (auto) option is set
just as an optimization. because you dont want to bring
up the master in cases where user just wants to
bring up the vrf slave. eg ifup -v eth0.

This does not work so well, when user uses
--allow classes to bring up vrf master and slaves
together (eg mgmt vrf).

This patch removes the ALL check when bringing
up master and replaces it with an ALL or
CLASS check. ie make sure vrf master belongs to the
same class as you when CLASS is specified.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdown: move IFACE_CLASS ifupdownmain flag to ifupdownflags.CLASS
Roopa Prabhu [Fri, 5 Aug 2016 18:28:28 +0000 (11:28 -0700)]
ifupdown: move IFACE_CLASS ifupdownmain flag to ifupdownflags.CLASS

This patch moves ifupdownmain flag IFACE_CLASS to
ifupdownflags.CLASS. ifupdownflags.CLASS is set to true
if the user is asking for a class of interfaces.
example: ifreload --allow=mgmt

By moving it to ifupdownflags, we make it visible
to add modules.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: vlan: fix checking of vlan device in query-running
Roopa Prabhu [Thu, 4 Aug 2016 16:03:00 +0000 (09:03 -0700)]
addons: vlan: fix checking of vlan device in query-running

Ticket: CM-11804
Reviewed By: julien, nikhil
Testing Done: Tested with failing config in the bug

This patch makes sure macvlan devices are ignored by ifquery -ra

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: address: removing netmask validval
Julien Fortin [Thu, 4 Aug 2016 16:20:50 +0000 (18:20 +0200)]
addons: address: removing netmask validval

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

The syntax: netmask <number> is ifupdown legacy support
We want to deprecate it so we don't want to officially support it.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: fix bridge vid error on ifaces with multiple stanzas
Roopa Prabhu [Wed, 3 Aug 2016 22:35:04 +0000 (15:35 -0700)]
addons: bridge: fix bridge vid error on ifaces with multiple stanzas

Ticket: CM-12151
Reviewed By: julien, nikhil
Testing Done: Tested bridge vid errors with multiple iface stanzas for
ports

This patch just uses the HAS_SIBLINGS and OLDEST_SIBLINGS
flags on an iface to make sure we flag the error
on the last interface ie oldest of the siblings. all interfaces
with multiple iface objects have HAS_SIBLINGS set and the last iface
has OLDEST_SIBLINGS set.

The other way to fix this for the user would be to set ifaceobj_squash=1
in /etc/network/ifupdown2/ifupdown2.conf

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: bridge: reset vlan_filtering when user moves from vlan aware to
Roopa Prabhu [Wed, 3 Aug 2016 19:22:14 +0000 (12:22 -0700)]
addons: bridge: reset vlan_filtering when user moves from vlan aware to
unaware

Ticket: CM-12070
Reviewed By: julien, nikhil
Testing Done: Tested with config in the bug

The bug also talks about removing the vlans during this
transition. If the vlans are removed from the interfaces file,
ifupdown2 will delete them on an ifreload. In any case, once moved to
vlan unaware bridge settings, kernel and switchd
don't look at vlans any more.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdownaddons: fix path to get_reserved_vlan_range.sh hook
Roopa Prabhu [Tue, 2 Aug 2016 01:30:25 +0000 (18:30 -0700)]
ifupdownaddons: fix path to get_reserved_vlan_range.sh hook

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdown: scheduler: add dependency debug dump function
Roopa Prabhu [Fri, 29 Jul 2016 05:55:50 +0000 (22:55 -0700)]
ifupdown: scheduler: add dependency debug dump function

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdown: valivals keyword: remove <auto> and renaming <ipaddr> to <ip>
Julien Fortin [Mon, 1 Aug 2016 15:20:44 +0000 (17:20 +0200)]
ifupdown: valivals keyword: remove <auto> and renaming <ipaddr> to <ip>

Ticket: None
Reviewed By: Daniel Walton
Testing Done:

This commit was need to keep nclu and ifupdown2 consistent.
The naming were differing and we decided to keep nclu version.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoStaging cl3u4 version for merge to stable and release
Julien Fortin [Mon, 1 Aug 2016 07:59:45 +0000 (09:59 +0200)]
Staging cl3u4 version for merge to stable and release

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdownaddons: mstpctl: treeportprio value is cached. It prevents ifupdown2 from...
Julien Fortin [Mon, 1 Aug 2016 07:49:08 +0000 (09:49 +0200)]
ifupdownaddons: mstpctl: treeportprio value is cached. It prevents ifupdown2 from executing mstpctl settreeportprio commands when the running value is the same as the one previously cached

Ticket: CM-11773
Reviewed By: Roopa, Nikhil G
Testing Done: smoke + hand testings :

$ cat /etc/network/interfaces
auto br2
iface br2
      bridge-vlan-aware yes
      bridge-vids 100
      bridge-pvid  1
      bridge-ports swp1 swp4 swp5
      bridge-stp on
$ ifreload -a -v
[...]
info: netlink: set link swp1 up
info: netlink: set link swp4 up
info: netlink: set link swp5 up
info: br2: applying mstp configuration specific to ports
info: br2: processing mstp config for port swp1
info: executing /sbin/mstpctl showportdetail br2 json
info: executing /sbin/mstpctl settreeportprio br2 swp1 0 128
info: br2: processing mstp config for port swp4
info: executing /sbin/mstpctl settreeportprio br2 swp4 0 128
info: br2: processing mstp config for port swp5
info: executing /sbin/mstpctl settreeportprio br2 swp5 0 128
info: netlink: set link br2 up
[...]
$

/sbin/mstpctl settreeportprio br2 swpX 0 128 is executed for every port.
ifupdown2 tries to set this attr to 128 (the default value). This is a
problem at scale. We shouldn't try to set this value if the running value
is already 128.

With the attached patch:

$ ifreload -a
[...]
info: netlink: set link swp1 up
info: netlink: set link swp4 up
info: netlink: set link swp5 up
info: executing /sbin/mstpctl showportdetail br2 json
info: br2: applying mstp configuration specific to ports
info: br2: processing mstp config for port swp1
info: br2: processing mstp config for port swp4
info: br2: processing mstp config for port swp5
info: netlink: set link br2 up
[...]
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoattribute syntax check using validvals/validrange and keywords
Julien Fortin [Mon, 1 Aug 2016 07:19:31 +0000 (09:19 +0200)]
attribute syntax check using validvals/validrange and keywords

Ticket: CM-8101
Reviewed By: CCR-4949
Testing Done: smoke tests + ran ifup -a -s on every interface configuration file from GSS cl-supports collection

This commit is introducing ~20 keywords. The value of the different attributes
will be check against raw values and <keywords>:

'<mac>'
'<text>'
'<ipv4>'
'<ipv6>'
'<auto>': "auto"
'<ipaddr>': ipv4/6 with preflix len
'<number>'
'<interface>'
'<ipv4-vrf-text>': equivalent to: <ipv4> "vrf" <text>
'<number-ipv4-list>': example: "100=172.16.100.1 101=172.16.101.1"
'<interface-list>': example: "swp1 swp2 swp3"
'<ipv4/prefixlen>'
'<ipv6/prefixlen>'
'<ipaddr/prefixlen>'
'<number-range-list>': example: "2000 2200-3000"
'<interface-range-list>': example: "swp1=100 swp2=100" ('validrange' : ['0', '65535'])
'<mac-ipaddr/prefixlen-list>'
'<number-interface-list>': example: "4 swp1 swp2"
'<interface-yes-no-list>': example: "swp1=yes swp2=no"
'<interface-yes-no-0-1-list>'
'<interface-yes-no-auto-list>'

It's possible to combine a keyword with a range from validrange. example:
validrange: 10-50
validvals: <intrface-range-list>
value: swp1=21 swp2=42 ...

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge & mstpctl: avoid printing default and port attributes under vlan aware...
Nikhil [Fri, 29 Jul 2016 20:20:13 +0000 (13:20 -0700)]
addons: bridge & mstpctl: avoid printing default and port attributes under vlan aware bridge

Ticket: CM-12036
Reviewed By: roopa
Testing Done: used same config from bug

This patch avoids printing port attributes under
vlan-AWARE-bridge on 'ifquer -ra'.

This patch also avoids printing following attributes
on 'ifquer -ra' if not defined:
mstpctl-maxhops
mstpctl-portpathcost
mstpctl-treeportcost

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: addressvirtual: enslave macvlans on vrf slaves to the vrf master
Roopa Prabhu [Mon, 18 Jul 2016 05:50:26 +0000 (22:50 -0700)]
addons: addressvirtual: enslave macvlans on vrf slaves to the vrf master

Ticket: CM-11803
Reviewed By: dsa, scotte, wkok, nikhil, julien
Testing Done: tested config of address-virtual lines on vrf slaves

This patch does the following:
- addressvirtual: enslaves macvlans created on vrf slaves
to the vrf master
- vrf: when looking for stale slaves on vrf master, skip
macvlan devices. This code does basic checking right now
and can be improved to include more cases.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: bridge: Fix KeyError when 'bridge-pvid' is not in the set 'bridge-vid'
Nikhil [Mon, 25 Jul 2016 17:32:47 +0000 (10:32 -0700)]
addons: bridge: Fix KeyError when 'bridge-pvid' is not in the set 'bridge-vid'

Ticket: CM-11998
Reviewed By: roopa
Testing Done: used same config given in bug descreption

When we try to unconditionally remove 'pvid' from 'vids' set,
we run into KeyError if 'vids' set doesn't contain 'pvid'

Example configuration:
auto swp9
iface swp9
   mstpctl-portautoedge no

auto frontnet
iface frontnet
   bridge-vlan-aware yes
   bridge-ports swp9
   bridge-vids 10
   bridge-stp on

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: mstpctl: handle vlan aware bridge port config under port
Nikhil [Mon, 25 Jul 2016 17:31:00 +0000 (10:31 -0700)]
addons: mstpctl: handle vlan aware bridge port config under port

Ticket: CM-8629
Reviewed By: roopa, julien
Testing Done: used same config given in bug description

This patch avoids vlan aware bridge over-writing it's port's
config with default values

Example configuration:

auto swp9
iface swp9
   mstpctl-portautoedge no

auto frontnet
iface frontnet
   bridge-vlan-aware yes
   bridge-ports swp9
   bridge-vids 10
   bridge-stp on

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: address: add both v4 and v6 gateways instead of just one.
Nikhil [Wed, 20 Jul 2016 22:23:13 +0000 (15:23 -0700)]
addons: address: add both v4 and v6 gateways instead of just one.

Ticket: CM-8596, CM-5118
Reviewed By: roopa, julien
Testing Done: used same config mentioned in bug

Previously, only first configured gateway is set as default route.
This patch sets all the configured gateways as default routes.

This patch also removes default route on ifup
after removing 'gateway' from the interface

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: vxlan: localtunnelip check before netlink call, prevent from overwriting...
Julien Fortin [Thu, 21 Jul 2016 00:56:27 +0000 (01:56 +0100)]
addons: vxlan: localtunnelip check before netlink call, prevent from overwriting the anycast ip

Ticket: CM-11867
Reviewed By: Roopa, Balki, Nikhil G
Testing Done: tests/l2/clag_vxlan_aa_test.py

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: fix 'ifquery -c' 'bridge vid error' on vlan aware bridge port
Nikhil [Wed, 13 Jul 2016 21:18:48 +0000 (14:18 -0700)]
addons: bridge: fix 'ifquery -c' 'bridge vid error' on vlan aware bridge port

Ticket: CM-11811
Reviewed By: roopa, julien
Testing Done: used same configuration from ticket

For a VLAN aware bridge, if 'bridge-pvid' is not configured,
auto bridge
iface bridge
    bridge-ports swp7 swp8
    bridge-vids 1-200
    bridge-vlan-aware yes

'1' is would be running pvid and [2-200] would be running vids.
While doing _query_check() we compare configred versus running
vids excluding running 'pvid'. Configured vids here is [1-200]
and running is [2-200], but instead of excluding running 'pvid'
we used to exclued configured 'pvid' which is None in this case.
Comparison used to fail because of this.

This patch excludes running 'pvid' instead of configured 'pvid'
during _query_check()

This patch also fixes 'ifquery -c' error for bridge-pvid if
configured under a port of vlan aware bridge

This patch also avoids printing 'bridge-pvid' on 'ifquery -c'
if bridge-pvid is not configured under vlan aware bridge port

sample configuration:
auto swp4
iface swp4

auto swp7
iface swp7
    bridge-pvid 2

auto swp8
iface swp8
    bridge-pvid 2

auto bridge
iface bridge
    bridge-ports swp4 swp7 swp8
    bridge-vids 1-200
    bridge-pvid 20
    bridge-vlan-aware yes

sample output:
root@dell-s3000-02:~# ifquery -c -a
auto swp4
iface swp4                                                      [pass]
    bridge-pvid 20                                              [pass]

auto swp7
iface swp7                                                      [pass]
    bridge-pvid 2                                               [pass]

auto swp8
iface swp8                                                      [pass]
    bridge-pvid 2                                               [pass]

auto bridge
iface bridge                                                    [pass]
    bridge-vlan-aware yes                                       [pass]
    bridge-ports swp8 swp7 swp4                                 [pass]
    bridge-pvid 20
    bridge-vids 1-200                                               []

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: dhcp: stop IPv6 dhclient on ifdown and add delay before starting dhclient
Nikhil [Fri, 15 Jul 2016 21:21:23 +0000 (14:21 -0700)]
addons: dhcp: stop IPv6 dhclient on ifdown and add delay before starting dhclient

Ticket: CM-11043
Reviewed By: roopa
Testing Done: used the config mentioned in bug

This patch adds a delay before starting IPv6 dhclient to
make sure the configured interface/link in up.

Also, ifdown on a IPv6 interface, this patch makes sure
that the link in up before dhcp release. Dhcp release is
done using a default lease file.

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: bridge: fix 'ifquery -c' 'bridge vid error' on vlan aware bridge port
Nikhil [Wed, 13 Jul 2016 21:18:48 +0000 (14:18 -0700)]
addons: bridge: fix 'ifquery -c' 'bridge vid error' on vlan aware bridge port

Ticket: CM-11811
Reviewed By: roopa, julien
Testing Done: used same configuration from ticket

For a VLAN aware bridge, if 'bridge-pvid' is not configured,
auto bridge
iface bridge
    bridge-ports swp7 swp8
    bridge-vids 1-200
    bridge-vlan-aware yes

'1' is would be running pvid and [2-200] would be running vids.
While doing _query_check() we compare configred versus running
vids excluding running 'pvid'. Configured vids here is [1-200]
and running is [2-200], but instead of excluding running 'pvid'
we used to exclued configured 'pvid' which is None in this case.
Comparison used to fail because of this.

This patch excludes running 'pvid' instead of configured 'pvid'
during _query_check()

This patch also fixes 'ifquery -c' error for bridge-pvid if
configured under a port of vlan aware bridge

sample configuration:
auto swp4
iface swp4

auto swp7
iface swp7
    bridge-pvid 2

auto swp8
iface swp8
    bridge-pvid 2

auto bridge
iface bridge
    bridge-ports swp4 swp7 swp8
    bridge-vids 1-200
    bridge-pvid 20
    bridge-vlan-aware yes

sample output:
root@dell-s3000-02:~# ifquery -c -a
auto swp4
iface swp4                                                      [pass]
    bridge-pvid 20                                              [pass]

auto swp7
iface swp7                                                      [pass]
    bridge-pvid 2                                               [pass]

auto swp8
iface swp8                                                      [pass]
    bridge-pvid 2                                               [pass]

auto bridge
iface bridge                                                    [pass]
    bridge-vlan-aware yes                                       [pass]
    bridge-ports swp8 swp7 swp4                                 [pass]
    bridge-pvid 20
    bridge-vids 1-200                                               []

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoRevert "Revert "addons: bond: reverting validvals "<mac>" change""
Julien Fortin [Mon, 18 Jul 2016 20:00:12 +0000 (21:00 +0100)]
Revert "Revert "addons: bond: reverting validvals "<mac>" change""

This reverts commit b19c6c100a3ccec5c858342b8349f1ee441bf153.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoRevert "fixes #14 addons: usercmds: adding environment variables passed by the ifupdo...
Julien Fortin [Mon, 18 Jul 2016 10:30:12 +0000 (11:30 +0100)]
Revert "fixes #14 addons: usercmds: adding environment variables passed by the ifupdown2 to user scripts"

This reverts commit 779efca3e29b0aed9e0360da84e9eb31f6572bdc.

7 years agonlmanager: changing log level to debug for RXed messages
Julien Fortin [Mon, 18 Jul 2016 09:45:45 +0000 (10:45 +0100)]
nlmanager: changing log level to debug for RXed messages

Ticket: CM-11857
Reviewed By: Daniel, Roopa
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoRevert "addons: usercmds: adding environment variables passed by the ifupdown2 to...
Roopa Prabhu [Mon, 18 Jul 2016 05:04:01 +0000 (22:04 -0700)]
Revert "addons: usercmds: adding environment variables passed by the ifupdown2 to user scripts"

This reverts commit cfc51ed18be9aee902cbc89a57350d9e99a1950d.

this commit seems to have broken usercmds. reverting it until it is
fixed.

Closes: CM-11856
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: bridge: batch bridge commands
Roopa Prabhu [Sun, 10 Jul 2016 23:34:34 +0000 (16:34 -0700)]
addons: bridge: batch bridge commands

Ticket: CM-11274
Reviewed By: julien, nikhil, wkok
Testing Done: tested with vxlan scale config

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdownaddons: iproute2: add bridge_commit_batch api to batch bridge
Roopa Prabhu [Fri, 8 Jul 2016 15:13:37 +0000 (08:13 -0700)]
ifupdownaddons: iproute2: add bridge_commit_batch api to batch bridge
commands

Ticket: CM-11274
Testing Done: julien, wkok, nikhil

It uses and goes with the the other batch variables and apis.
This one just calls the 'bridge -batch' command instead
of the 'ip -batch' command.

This can be used to batch bridge commands.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: ethtool: ignore logical interfaces with link_kind
Roopa Prabhu [Sat, 16 Jul 2016 23:09:37 +0000 (16:09 -0700)]
addons: ethtool: ignore logical interfaces with link_kind

Ticket: CM-11517
Reviewed By: julien, nikhil, jtoppins
Testing Done: ethtool sanity test

ethtool module should really care only about
physical interfaces. so, this patch makes ethtool
module ignore all logical interfaces, ie interfaces
with link_kind set.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agofixes #14 addons: usercmds: adding environment variables passed by the ifupdown2...
Julien Fortin [Fri, 15 Jul 2016 16:05:40 +0000 (17:05 +0100)]
fixes #14 addons: usercmds: adding environment variables passed by the ifupdown2 to user scripts

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: usercmds: adding environment variables passed by the ifupdown2 to user scripts
Julien Fortin [Fri, 15 Jul 2016 16:00:09 +0000 (17:00 +0100)]
addons: usercmds: adding environment variables passed by the ifupdown2 to user scripts

Ticket: None
Reviewed By: Roopa
Testing Done: with a dummy script I printed the value passed by ifupdown
After the changes I did the same with ifupdown2 and checksd if the values
matched correctly.

This issue was reported on the github repository.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdownaddons: bridgeutils: build cache only if bridge-utils installed
Roopa Prabhu [Mon, 11 Jul 2016 01:34:45 +0000 (18:34 -0700)]
ifupdownaddons: bridgeutils: build cache only if bridge-utils installed

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddon: handle unsupported modules
Roopa Prabhu [Mon, 11 Jul 2016 03:23:17 +0000 (20:23 -0700)]
addon: handle unsupported modules

Example: If /sbin/ethtool is not installed dont run the
ethtool addon module.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdown: disable template execution by default
Roopa Prabhu [Mon, 11 Jul 2016 03:28:53 +0000 (20:28 -0700)]
ifupdown: disable template execution by default

User will have to enable it by enabling it in
/etc/network/ifupdown2.conf template_enable=1

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoconfig: enable template by default for cumulus
Roopa Prabhu [Mon, 11 Jul 2016 03:30:24 +0000 (20:30 -0700)]
config: enable template by default for cumulus

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoman.rst: fix spelling mistakes as reported by lintian and Piotr
Roopa Prabhu [Fri, 21 Aug 2015 04:17:00 +0000 (21:17 -0700)]
man.rst: fix spelling mistakes as reported by lintian and Piotr

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdown: fixes to make addon scripts work via special config options
Roopa Prabhu [Mon, 11 Jul 2016 05:48:42 +0000 (22:48 -0700)]
ifupdown: fixes to make addon scripts work via special config options

ifupdown2 can invoke scripts under /etc/network/if-*.d/*
in the required order with the required environment variables.
This patch includes fixes to execute these scripts.

The following attributes in /etc/network/ifupdown2/ifupdown.conf
can influence the execution behaviour of python-addon modules
and /etc/network/if-*.d/*

<ifupdown.conf>
addon_syntax_check=0

addon_scripts_support=1

addon_python_modules_support=1
</ifupdown.conf>

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdown: networkinterfaces: making sure template engine will only be initialized...
Julien Fortin [Fri, 15 Jul 2016 11:18:36 +0000 (12:18 +0100)]
ifupdown: networkinterfaces: making sure template engine will only be initialized once.

Ticket: None
Reviewed By: Roopa
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown: networkinterfaces: not importing template engine if no mako keyword found
Julien Fortin [Thu, 14 Jul 2016 19:09:42 +0000 (20:09 +0100)]
ifupdown: networkinterfaces: not importing template engine if no mako keyword found

Ticket: CM-11807
Reviewed By: Roopa, Daniel
Testing Done:

Loading the default template engine (mako) is adding an extra overhead: 100ms
We also import the template engine even if we are dealing with a json input
The overhead is noticable when using NCLU.

With this change we are now important the template engine when a keyword is
found in the configuration file.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown: fixes to make addon scripts work via special config options
Roopa Prabhu [Mon, 11 Jul 2016 05:48:42 +0000 (22:48 -0700)]
ifupdown: fixes to make addon scripts work via special config options

ifupdown2 can invoke scripts under /etc/network/if-*.d/*
in the required order with the required environment variables.
This patch includes fixes to execute these scripts.

The following attributes in /etc/network/ifupdown2/ifupdown.conf
can influence the execution behaviour of python-addon modules
and /etc/network/if-*.d/*

<ifupdown.conf>
addon_syntax_check=0

addon_scripts_support=1

addon_python_modules_support=1
</ifupdown.conf>

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoman.rst: fix spelling mistakes as reported by lintian and Piotr
Roopa Prabhu [Fri, 21 Aug 2015 04:17:00 +0000 (21:17 -0700)]
man.rst: fix spelling mistakes as reported by lintian and Piotr

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoconfig: enable template by default for cumulus
Roopa Prabhu [Mon, 11 Jul 2016 03:30:24 +0000 (20:30 -0700)]
config: enable template by default for cumulus

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdown: disable template execution by default
Roopa Prabhu [Mon, 11 Jul 2016 03:28:53 +0000 (20:28 -0700)]
ifupdown: disable template execution by default

User will have to enable it by enabling it in
/etc/network/ifupdown2.conf template_enable=1

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddon: handle unsupported modules
Roopa Prabhu [Mon, 11 Jul 2016 03:23:17 +0000 (20:23 -0700)]
addon: handle unsupported modules

Example: If /sbin/ethtool is not installed dont run the
ethtool addon module.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoifupdownaddons: bridgeutils: build cache only if bridge-utils installed
Roopa Prabhu [Mon, 11 Jul 2016 01:34:45 +0000 (18:34 -0700)]
ifupdownaddons: bridgeutils: build cache only if bridge-utils installed

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: addressvirtual: allowing address-virtual attr for vrf slave interfaces
Julien Fortin [Wed, 13 Jul 2016 22:25:07 +0000 (23:25 +0100)]
addons: addressvirtual: allowing address-virtual attr for vrf slave interfaces

Ticket: CM-11745
Reviewed By: Roopa, Nikhil G
Testing Done: configuration provided in the bug

User was attempting to configure a traditional bridge under a VRF with VRR.
When issuing ifreload -a, the configuration failed to apply with an error.

Applying an address-virtual keyword to an interface with upper interfaces
or parent interfaces was not allowed. But now we are allowing the use of
this keyword only for vrf slaves.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons may implement `syntax_check` method to perform specific syntax checks
Julien Fortin [Tue, 12 Jul 2016 15:31:29 +0000 (16:31 +0100)]
addons may implement `syntax_check` method to perform specific syntax checks
and validation

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

The goal of this commit is to provide the addons a new way to perform their
own specific syntax checks. By implementing `syntax_check` method.

The addons will have to make sure the provided ifaceobj is valid.
e.g. vxlan.py:syntax_check(ifaceobj) should check:
self._is_vxlan_device(ifaceobj)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoimporting: "nlmanager: changing log level info->debug for TXed messages"
Julien Fortin [Mon, 11 Jul 2016 23:39:44 +0000 (00:39 +0100)]
importing: "nlmanager: changing log level info->debug for TXed messages"

Ticket: CM-11708
Reviewed By: Roopa, Daniel
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoimporting: "nlmanager: removing IFLA_VXLAN_LINK attribute from packet when creating...
Julien Fortin [Mon, 11 Jul 2016 23:34:56 +0000 (00:34 +0100)]
importing: "nlmanager: removing IFLA_VXLAN_LINK attribute from packet when creating vxlan"

Ticket:
Reviewed By: Roopa, Daniel
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoRevert "addons: bond: reverting validvals "<mac>" change"
Julien Fortin [Mon, 11 Jul 2016 19:37:41 +0000 (20:37 +0100)]
Revert "addons: bond: reverting validvals "<mac>" change"

This reverts commit 3861c72cf6132ba79147911c7fe3498cab57de3e.

7 years agoaddons: vxlan: fixing wrong vxlan-id range
Julien Fortin [Mon, 11 Jul 2016 19:36:18 +0000 (20:36 +0100)]
addons: vxlan: fixing wrong vxlan-id range

Ticket: None
Reviewed By: Roopa, Daniel
Testing Done: This is not affecting ifupdown2 yet
the validvals attribute is only used by ifedit

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdownaddons: iproute2: fix 'ifquery -c' fail for 'bridge-pvid' on bridge ports
Nikhil [Sat, 2 Jul 2016 06:07:19 +0000 (23:07 -0700)]
ifupdownaddons: iproute2: fix 'ifquery -c' fail for 'bridge-pvid' on bridge ports

Ticket: CM-11624
Reviewed By: roopa, julien
Testing Done: using configuration mentioned in the bug

This patch fixes 'ifquery -c' failure for 'bridge-pvid' on
all bridge ports.

The following format of '/sbin/bridge -c vlan show' output was not handled properly
by iproute2

port  vlan ids
swp1   600
       700-710
       711 PVID Egress Untagged
       712-900

iproute2 was parsing the '/sbin/bridge -c vlan show' output with the assumption that
pvid line '711 PVID Egress Untagged' appears before all the vland ids.

Something like this:
port  vlan ids
swp1   711 PVID Egress Untagged
       600
       700-710
       712-900

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agoaddons: mstpctl: complete ifquery -r support
Nikhil [Thu, 30 Jun 2016 23:10:04 +0000 (16:10 -0700)]
addons: mstpctl: complete ifquery -r support

Ticket: CM-7841
Reviewed By: roopa, julien
Testing Done: tested all the bridge attributes

added 'ifquery -r' support for 'mstpctl-portpathcost', 'mstpctl-treeportcost', 'mstpctl-portautoedge', 'mstpctl-portbpdufilter', 'mstpctl-portnetwork'

Below is the sample configuration and output

root@dell-s3000-02:~# ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto br0
iface br0
  bridge-vlan-aware yes
  bridge-ports swp42 swp43
  mstpctl-fdelay 14
  mstpctl-txholdcount 5
  mstpctl-forcevers rstp
  mstpctl-maxhops 14
  mstpctl-treeprio 32768
  mstpctl-maxage 19
  mstpctl-hello 3
  mstpctl-ageing 200

auto swp42
iface swp42
  mstpctl-portadminedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portnetwork yes
  mstpctl-portautoedge yes
  mstpctl-treeportprio 127
  mstpctl-portpathcost 10
  mstpctl-portrestrtcn yes
  mstpctl-portrestrrole yes
  mstpctl-bpduguard yes
  mstpctl-treeportcost 100
  mstpctl-portp2p yes

auto swp43
iface swp43
  mstpctl-portadminedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portnetwork yes
  mstpctl-portautoedge yes
  mstpctl-treeportprio 127
  mstpctl-portpathcost 10
  mstpctl-portrestrtcn yes
  mstpctl-portrestrrole yes
  mstpctl-bpduguard yes
  mstpctl-treeportcost 100
  mstpctl-portp2p yes

root@dell-s3000-02:~# ifquery -ra
auto swp42
iface swp42
  mstpctl-portautoedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portpathcost 10
  mstpctl-treeportcost 100
  mstpctl-portnetwork yes
  mstpctl-portadminedge yes
  mstpctl-portp2p yes
  mstpctl-portrestrrole yes
  mstpctl-portrestrtcn yes
  mstpctl-bpduguard yes
  link-speed 0
  link-duplex half
  link-autoneg off

auto swp43
iface swp43
  mstpctl-portautoedge yes
  mstpctl-portbpdufilter yes
  mstpctl-portpathcost 10
  mstpctl-treeportcost 100
  mstpctl-portnetwork yes
  mstpctl-portadminedge yes
  mstpctl-portp2p yes
  mstpctl-portrestrrole yes
  mstpctl-portrestrtcn yes
  mstpctl-bpduguard yes
  link-speed 0
  link-duplex half
  link-autoneg off

auto br0
iface br0
  vxlan-ageing 300
  bridge-vlan-aware yes
  bridge-mcqifaddr 0
  bridge-mcquerier 0
  bridge-mcsnoop 1
  bridge-mcrouter 1
  bridge-stp yes
  bridge-ports swp43 swp42
  mstpctl-portadminedge  swp42=yes swp43=yes
  mstpctl-fdelay 14
  mstpctl-portnetwork  swp42=yes swp43=yes
  mstpctl-txholdcount 5
  mstpctl-maxage 19
  mstpctl-portbpdufilter  swp42=yes swp43=yes
  mstpctl-maxhops 14
  mstpctl-portrestrtcn  swp42=yes swp43=yes
  mstpctl-portpathcost  swp42=10 swp43=10
  mstpctl-portautoedge  swp42=yes swp43=yes
  mstpctl-hello 3
  mstpctl-portrestrrole  swp42=yes swp43=yes
  mstpctl-bpduguard  swp42=yes swp43=yes
  mstpctl-ageing 200
  mstpctl-treeportcost  swp42=100 swp43=100
  mstpctl-portp2p  swp42=yes swp43=yes

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agonlmanager: nlpacket: vxlan dstport config incorrect
Julien Fortin [Sun, 10 Jul 2016 02:40:25 +0000 (03:40 +0100)]
nlmanager: nlpacket: vxlan dstport config incorrect

Ticket: CM-11735
Reviewed By: Roopa, Daniel
Testing Done: creating a vxlan with ifupdown then checking the dstport with
ip -d link show $vlxanName

When creating a vxlan nlmanager didn't re-order/byte swap the dstport value
to little endian

46354 instead of 4789

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown2 defaults for link attributes are not applied
Sam Tannous [Fri, 8 Jul 2016 00:16:22 +0000 (17:16 -0700)]
ifupdown2 defaults for link attributes are not applied

Ticket: CM-11718
Reviewed By: CCR-4931
Testing Done: Tested complete regression suite on hardnode in 3.0.

This patch fixes a problem in the ethtool addon module where a single iface stanza was
configured for a link-speed (1G) other then the default (10G). The link-speed config is then
removed or commented out but the link-speed is not restored to its default value (10G) because of
incorrect logic.

7 years agoaddons: moving vxlan creation from iproute2 to netlink (via nlmanager)
Julien Fortin [Tue, 5 Jul 2016 12:45:08 +0000 (14:45 +0200)]
addons: moving vxlan creation from iproute2 to netlink (via nlmanager)

Ticket: CM-8035
Reviewed By: CCR-4896
Testing Done: ifupdown smoke, -t vxlan tests

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agonetlink: adding support for netlink vxlan call via nlmanager
Julien Fortin [Tue, 5 Jul 2016 12:42:54 +0000 (14:42 +0200)]
netlink: adding support for netlink vxlan call via nlmanager

Ticket: CM-8035
Reviewed By: CCR-4896
Testing Done: ifupdown smoke, -t vxlan tests

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agopython-nlamanger: importing vxlan creation support commit
Julien Fortin [Tue, 5 Jul 2016 12:40:19 +0000 (14:40 +0200)]
python-nlamanger: importing vxlan creation support commit

Ticket: CM-8035
Reviewed By: CCR-4896
Testing Done: ifupdown smoke, -t vxlan tests

julien@hydra-01:~$ time runtests.sh -d cel-redxp-06 -r result_vxlan_all.txt -f . -T vxlan_all.log -l INFO -k $VM_BASE_KERNEL -i $VM_BASE_IMG $TESTS_HOME/tests/ -t vxlan

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bridge: ifquery -c fix for port attributes
Nikhil [Wed, 29 Jun 2016 23:38:50 +0000 (16:38 -0700)]
addons: bridge: ifquery -c fix for port attributes

Ticket: CM-11195
Reviewed By: roopa, julien
Testing Done: used the configuration mentioned in bug description

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
running values for bridge-portmcrouter, bridge-portmcfl, and bridge-portprios
were accessed using invalid keys.

7 years agoaddons: vrf: remove the FIB rules for vrf devices
Nikhil [Wed, 22 Jun 2016 19:06:42 +0000 (12:06 -0700)]
addons: vrf: remove the FIB rules for vrf devices

Ticket: CM-11392
Reviewed By: roopa, dsa, julien
Testing Done: multiple vrf devices on dell-s3000-02

Now that the l3mdev FIB rule is in the CL3.1 kernel tree,
ifupdown2 no longer needs to manage FIB rules for VRF devices.

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
7 years agonlmanager: nlpacket: throw an error if the user of nlmanager tries to encode an attri...
Julien Fortin [Sun, 26 Jun 2016 23:24:18 +0000 (00:24 +0100)]
nlmanager: nlpacket: throw an error if the user of nlmanager tries to encode an attribute that we haven't added an encode() method for
+ adding one byte attribute class for protodown operations.

Ticket: CM-11581
Reviewed By: CCR-4721
Testing Done: Smoke + custom interface file with clag bond that requires protodown.

- nlmanager will now throw an exception if a user is trying to use the default
attribute class when in fact he should use a more specific attribute class.

- The protodown implementation needed to use a one byte attribute to set the protodown state

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoifupdown2: Disable IPv6 duplicate address detection on VRR interfaces
Scott Emery [Thu, 23 Jun 2016 21:58:14 +0000 (14:58 -0700)]
ifupdown2: Disable IPv6 duplicate address detection on VRR interfaces

Ticket: CM-11511
Reviewed By: CCR-4890
Testing Done: Used "address-virtual" keyword to create VRR interface with IPv6
address. Checked sysctl and dad failures.

In a VRR setup, both switches are programmed with the same IPv6 address and that
address is active on both switches. This causes the IPv6 duplicate address
detection to kick in and diable the use of one of the address on one of the
switches. This patch causes duplicate address detection to be disabled on VRR
interfaces by setting the net.ipv6.conf.<ifname>.accept_dad and
net.ipv6.conf.<ifname>.dad_transmits sysctl's to 0. The only IPv6 addresses
which are defined on these interfaces are the virtual addresses and the link
local address (which is unused). No other operational IPv6 addresses should ever
be assigned to these interfaces. Instead, operational IPv6 addresses should be
assigned to the "base", or lower, interface of the VRR interface.

7 years ago'this is an ACK' message should be log.debug() not log.info()
Julien Fortin [Thu, 23 Jun 2016 23:51:26 +0000 (00:51 +0100)]
'this is an ACK' message should be log.debug() not log.info()

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoAttribute 20 is not defined in Route.attribute_to_class
Julien Fortin [Thu, 23 Jun 2016 23:48:13 +0000 (00:48 +0100)]
Attribute 20 is not defined in Route.attribute_to_class

Ticket: CM-11515

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoRemove dependancy on tabulate
Julien Fortin [Tue, 21 Jun 2016 21:03:10 +0000 (22:03 +0100)]
Remove dependancy on tabulate

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: roopa@cumulusnetworks.com
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoRemove dependancy on tabulate
Julien Fortin [Tue, 21 Jun 2016 21:03:10 +0000 (22:03 +0100)]
Remove dependancy on tabulate

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: roopa@cumulusnetworks.com
7 years agoman: fix merge errors
Roopa Prabhu [Tue, 21 Jun 2016 17:28:09 +0000 (10:28 -0700)]
man: fix merge errors

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agodelete generated stale files
Roopa Prabhu [Tue, 21 Jun 2016 17:25:14 +0000 (10:25 -0700)]
delete generated stale files

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
7 years agoaddons: vlan: ifquery will try to get the vlan-id from the ifacename if vlan-id attr...
Julien Fortin [Tue, 21 Jun 2016 14:17:09 +0000 (15:17 +0100)]
addons: vlan: ifquery will try to get the vlan-id from the ifacename if vlan-id attr is missing

Ticket: CM-11485
Reviewed By: Roopa
Testing Done: config from the github issue

First reported here https://github.com/CumulusNetworks/ifupdown2/issues/10
ifquery just like ifupdown should try to get the vlan-id from the iface name
if vlan-id attr is not specified.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: vrf: moving replacing rtnetlink_api call with the new netlink api
Julien Fortin [Thu, 16 Jun 2016 02:39:12 +0000 (03:39 +0100)]
addons: vrf: moving replacing rtnetlink_api call with the new netlink api

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: bond: reverting validvals "<mac>" change
Julien Fortin [Tue, 7 Jun 2016 17:47:54 +0000 (18:47 +0100)]
addons: bond: reverting validvals "<mac>" change

Ticket: CM-11331
Reviewed By:
Testing Done:

7 years agosmall easy: support (0|1) or (off|on) attribute while keeping backward compatibility
Julien Fortin [Tue, 7 Jun 2016 17:37:40 +0000 (18:37 +0100)]
small easy: support (0|1) or (off|on) attribute while keeping backward compatibility

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

added support for:
* bond-lacp-bypass-allow (0|1)
* bond-use-carrier (0|1)
* bridge-mcqifaddr (0|1)
* bridge-mcquerier (0|1)
* bridge-mcrouter (0|1)
* bridge-mcsnoop (0|1)
* bridge-portmcrouter (0|1)
* link-autoneg (off|on)
* vxlan-learning (off|on)

these 2 are not yet supported by ifupdown2:
* bond-lacp-bypass-all-active (0|1)
* bond-lacp-fallback-allow (0|1)

This one is left untouched. yes/no doesn't make sense for this attribute.
* bond-lacp-rate (0|1)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoAdd validvals to addons, to be used by iface/ifedit wrapper
Daniel Walton [Tue, 31 May 2016 20:12:21 +0000 (13:12 -0700)]
Add validvals to addons, to be used by iface/ifedit wrapper

Ticket: CM-8669
Reviewed By: Julien
Testing Done:

<DETAILED DESCRIPTION (REPLACE)>

7 years agoImport python-nlmanager mirror copy
Julien Fortin [Sun, 29 May 2016 17:06:23 +0000 (18:06 +0100)]
Import python-nlmanager mirror copy

Ticket: CM-7360
Reviewed By: CCR-4721
Testing Done: smoke / testifreload / Tested on amd64 platform (by Sam)

For now, we use a mirror copy of nlmanager sources to make sure we don't
depend on it as an external package

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoReplace rtnetlink modules with python-nlmanager calls
Julien Fortin [Sun, 29 May 2016 17:04:23 +0000 (18:04 +0100)]
Replace rtnetlink modules with python-nlmanager calls

Ticket: CM-7360
Reviewed By: CCR-4721
Testing Done: smoke / testifreload / Tested on amd64 platform (by Sam)

This patch replaces all calls to rtnetlink with python-nlmanager.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
7 years agoaddons: vrf: Fix to kill current ssh on 'sudo ifreload -a' to enable mgmt VRF
Nikhil [Wed, 25 May 2016 23:16:22 +0000 (16:16 -0700)]
addons: vrf: Fix to kill current ssh on 'sudo ifreload -a' to enable mgmt VRF

Ticket: CM-11080
Reviewed By: roopa, dsa, dave olson, daniel, julien
Testing Done: yes, with mgmt VRF configured

This patch parses '/usr/bin/pstree -Aps <pid>' output to find
the pid of current ssh session, and send 'sudo ifreload -a'
to background before killing itself.

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>