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

1145 Commits

Author SHA1 Message Date
60c1cc267d man: ifup: fixing spelling mistake
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-24 00:46:10 +02:00
85fd4a61cf Merge branch 'dev' into release/cl-stable 2016-10-21 23:10:09 +02:00
42e85fc834 [PATCH ifupdown2] addons: addressvirtual: fixup macvlan device enslavements for vrfs
Ticket: CM-12988
Reviewed By: julien, nikhil, dsa
Testing Done: tested ifup and ifdown of vrf devices with address virtual
slaves

This patch fixes up macvlan device enslavements when vrf device
or vrf slave is brought down and up. address virtual macvlan
devices on vrf slaves need to enslaved to the vrf. This
patch checks and fixes up those vrf enslavements for the following
cases:
ifdown <vrf_device> && ifup <vrf_device>
ifdown <vrf_slave> && ifup <vrf_slave>

starting state:
------------
$ip -br link show
myvrf            UP  46:c6:44:db:37:60 <NOARP,MASTER,UP,LOWER_UP>
bridge.901@bridge UP 44:38:39:00:77:88 <UP,BROADCAST,MULTICAST,UP>
bridge-901-v0@bridge.901 UP 00:00:5e:00:01:81 <UP,BROADCAST,MULTICAST,UP>

$ifdown myvrf
$ip -br link show
bridge.901@bridge DOWN           44:38:39:00:77:88 <BROADCAST,MULTICAST>
bridge-901-v0@bridge.901 DOWN    00:00:5e:00:01:81 <BROADCAST,MULTICAST,M-DOWN>

before patch (macvlan device bridge-901-v0 did not come up:
----------------------------------------
$ifup myvrf
$ip -br link show
bridge.901@bridge UP 44:38:39:00:77:88 <UP,BROADCAST,MULTICAST,UP>
bridge-901-v0@bridge.901 DOWN  00:00:5e:00:01:81 <BROADCAST,MULTICAST>
myvrf            UP             ce:a6:e1:85:75:73 <NOARP,MASTER,UP,LOWER_UP>

after patch:
------------
$ifup myvrf
$ip -br link show
bridge.901@bridge UP 44:38:39:00:77:88 <UP,BROADCAST,MULTICAST,UP>
bridge-901-v0@bridge.901 UP 00:00:5e:00:01:81 <UP,BROADCAST,MULTICAST,UP>
myvrf                   UP     ce:a6:e1:85:75:73 <NOARP,MASTER,UP,LOWER_UP>

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-10-19 22:23:05 -07:00
90649d374a addons: addressvirtual: ifquery normalizing ip address to IPNetwork format for comparaisons
Ticket: None
Reviewed By: Roopa
Testing Done:

Test from CM-8736:

auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports swp42
      mstpctl-treeprio 4096
      bridge-stp on
      bridge-vids 5 13 14 20 799 1001-1006
      bridge-pvid 192

auto bridge.20
iface bridge.20
      address 10.7.192.194/27
      address-virtual 44:38:39:ff:00:20 10.7.192.193

$ ifreload -a
$ ifquery bridge.20 -c
auto bridge.20
iface bridge.20                                                     [fail]
      address 10.7.192.194/27                                     [pass]
      address-virtual 44:38:39:ff:00:20 10.7.192.193/32           [fail]
$

it fails because ifquery is comparing : ['10.7.192.193/32'] with ['10.7.192.193']

after the patch:

$ ifquery bridge.20 -c
auto bridge.20
iface bridge.20                                                     [pass]
      address 10.7.192.194/27                                     [pass]
      	      address-virtual 44:38:39:ff:00:20 10.7.192.193              [pass]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-19 00:41:02 +02:00
8e9fc17804 addons: bridge: syntax check for illegal subintf as member of VLAN aware bridge
Ticket: CM-12906
Reviewed By: Roopa, Nikhil G
Testing Done:

$ ifquery br0
auto br0
iface br0
      bridge-vlan-aware yes
      bridge-ports tap0 tap1.100
      bridge-vids 100 200
      bridge-pvid 1
      bridge-stp on

$ ifreload -a -s
error: br0: tap1.100: vlan sub-interface is not supported in a vlan-aware bridge
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-19 00:30:21 +02:00
a5bd56f269 ifupdownmain: missing return statement and fixing 'network down' error checking
Ticket:
Reviewed By: Roopa, Nikhil G

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-10 15:22:30 +02:00
1a1f332dda docs: examples: fixing merge errors
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-05 20:13:28 +02:00
ea18ed2c47 docs: examples: interfaces: fixing merge error
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-05 20:06:19 +02:00
baadcc71e4 docs: examples: adding new example interface file
Ticket: None
Reviewed By: Roopa
Testing Done:

This new interface file uses bridge, vlan, vxlan, bond and vrf interfaces.
It's a good way to try ifupdown2 capabilities.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-05 16:53:46 +02:00
f0c1c7205f docs: examples: adding new example interface file
Ticket: None
Reviewed By: Roopa
Testing Done:

This new interface file uses bridge, vlan, vxlan, bond and vrf interfaces.
It's a good way to try ifupdown2 capabilities.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-05 16:48:00 +02:00
b67cc92d58 addons: vrf: removing ifaceobj.name from exception message
Ticket: None
Reviewed By:
Testing Done:

The function _create_vrf_dev is surrounded by a try/catch as follow:
    try:
        vrf_table = self._create_vrf_dev(ifaceobj, vrf_table)
    except Exception, e:
        self.log_error('%s: %s' %(ifaceobj.name, str(e)), ifaceobj)

Thus we shouldn't include the ifaceobj.name in any error message passed to
log_error(). Since this function will raise an exception by default, it will
result in something like this:

error:br0.4002: red: red: create failed (cmd 'ip link add name red type vrf table 1001' failed: returned 1 ...[snip]
error:red: red: create failed (cmd 'ip link add name red type vrf table 1002' failed: returned 1 ...[snip]

after this patch:
error: red: create failed (cmd 'ip link add name red type vrf table 1002' failed: returned 1 ... [snip]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-05 16:18:29 +02:00
33ebb29d3e ifupdownaddons: bridgeutils: iproute2: skipping unsupported commands
Ticket:
Reviewed By: Roopa, Nikhil G
Testing Done:

When using ifupdown2 on regular distribution (debian/ubuntu etc...) users may
not have the latest iproute2/bridge-utils version. Thus the output parsed from
the various subcommands executed by ifupdown2 might defer and cause exception
to be throwned.
We identified several cases:
/sbin/bridge -c -json vlan show
/sbin/brctl showmcqv4src bridge0
/sbin/brctl showstp bridge0

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-05 16:18:11 +02:00
9054b20ccb addons: removing stale ifenslave.py (was replaced by bond.py)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-05 12:39:27 +02:00
04e4f35239 addons: vrf: cosmetic print statement fix
Ticket: CM-12753
Reviewed By: roopa, julien
Testing Done: used same config mentioned in the bug

Changed %d to %s inorder to print a string.

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2016-10-04 15:36:28 -07:00
de6c88afdf ifupdownaddons: bridgeutils: iproute2: skipping unsupported commands
Ticket:
Reviewed By: Roopa, Nikhil G
Testing Done:

When using ifupdown2 on regular distribution (debian/ubuntu etc...) users may
not have the latest iproute2/bridge-utils version. Thus the output parsed from
the various subcommands executed by ifupdown2 might defer and cause exception
to be throwned.
We identified several cases:
/sbin/bridge -c -json vlan show
/sbin/brctl showmcqv4src bridge0
/sbin/brctl showstp bridge0

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-04 10:18:26 +02:00
9b35cb3e19 addons: vrf: removing ifaceobj.name from exception message
Ticket: None
Reviewed By:
Testing Done:

The function _create_vrf_dev is surrounded by a try/catch as follow:
    try:
        vrf_table = self._create_vrf_dev(ifaceobj, vrf_table)
    except Exception, e:
        self.log_error('%s: %s' %(ifaceobj.name, str(e)), ifaceobj)

Thus we shouldn't include the ifaceobj.name in any error message passed to
log_error(). Since this function will raise an exception by default, it will
result in something like this:

error:br0.4002: red: red: create failed (cmd 'ip link add name red type vrf table 1001' failed: returned 1 ...[snip]
error:red: red: create failed (cmd 'ip link add name red type vrf table 1002' failed: returned 1 ...[snip]

after this patch:
error: red: create failed (cmd 'ip link add name red type vrf table 1002' failed: returned 1 ... [snip]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-10-04 10:13:23 +02:00
5abd95c024 addons may provide a list of ifupdown scripts to ignore
Ticket:
Reviewed By: Roopa, Nikhil G
Testing Done:

ifupdown2's python addons are replacing some/most of the old ifupdown shell
scripts. When addon_scripts_support is set to 1, ifupdown2 will execute every
scripts present in /etc/network/if-$ACTION.d/ if a script exists with a name
identical to an ifupdown2 addon, this script won't be executed.

Sometimes an ifupdown2 addons doesn't have the same name as the ifupdown script
it's supposed to replace. Or maybe one addon is replacing several scripts.
For example: bond.py is replacing /etc/network/if-*.d/ifenslave

Now each addon is able to provide a list of script to ignore.

[16:54:40] root:ifupdown2 # ifquery bond0
iface bond0
      bond-slaves tap0 tap1

[16:54:49] root:ifupdown2 # ifreload -a -d &> /tmp/ifreload.log
[16:54:54] root:ifupdown2 # cat /tmp/ifreload.log | grep ifenslave
debug: tap1: pre-up : running script /etc/network/if-pre-up.d/ifenslave
info: executing /etc/network/if-pre-up.d/ifenslave
debug: tap1: up : running script /etc/network/if-up.d/ifenslave
info: executing /etc/network/if-up.d/ifenslave
debug: lo: pre-up : running script /etc/network/if-pre-up.d/ifenslave
info: executing /etc/network/if-pre-up.d/ifenslave
debug: lo: up : running script /etc/network/if-up.d/ifenslave
info: executing /etc/network/if-up.d/ifenslave
debug: eth0: pre-up : running script /etc/network/if-pre-up.d/ifenslave
info: executing /etc/network/if-pre-up.d/ifenslave
debug: eth0: up : running script /etc/network/if-up.d/ifenslave
info: executing /etc/network/if-up.d/ifenslave
debug: tap0: pre-up : running script /etc/network/if-pre-up.d/ifenslave
info: executing /etc/network/if-pre-up.d/ifenslave
debug: tap0: up : running script /etc/network/if-up.d/ifenslave
info: executing /etc/network/if-up.d/ifenslave
[16:54:55] root:ifupdown2 #
...
apply patch
...
[16:55:16] root:ifupdown2 # ifreload -a -d &> /tmp/ifreload.log
[16:55:18] root:ifupdown2 # cat /tmp/ifreload.log | grep ifenslave
[16:55:19] root:ifupdown2 #

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-27 11:10:26 +02:00
b6b8bd2b77 addons may provide a list of ifupdown scripts to ignore
Ticket:
Reviewed By: Roopa, Nikhil G
Testing Done:

ifupdown2's python addons are replacing some/most of the old ifupdown shell
scripts. When addon_scripts_support is set to 1, ifupdown2 will execute every
scripts present in /etc/network/if-$ACTION.d/ if a script exists with a name
identical to an ifupdown2 addon, this script won't be executed.

Sometimes an ifupdown2 addons doesn't have the same name as the ifupdown script
it's supposed to replace. Or maybe one addon is replacing several scripts.
For example: bond.py is replacing /etc/network/if-*.d/ifenslave

Now each addon is able to provide a list of script to ignore.

[16:54:40] root:ifupdown2 # ifquery bond0
iface bond0
      bond-slaves tap0 tap1

[16:54:49] root:ifupdown2 # ifreload -a -d &> /tmp/ifreload.log
[16:54:54] root:ifupdown2 # cat /tmp/ifreload.log | grep ifenslave
debug: tap1: pre-up : running script /etc/network/if-pre-up.d/ifenslave
info: executing /etc/network/if-pre-up.d/ifenslave
debug: tap1: up : running script /etc/network/if-up.d/ifenslave
info: executing /etc/network/if-up.d/ifenslave
debug: lo: pre-up : running script /etc/network/if-pre-up.d/ifenslave
info: executing /etc/network/if-pre-up.d/ifenslave
debug: lo: up : running script /etc/network/if-up.d/ifenslave
info: executing /etc/network/if-up.d/ifenslave
debug: eth0: pre-up : running script /etc/network/if-pre-up.d/ifenslave
info: executing /etc/network/if-pre-up.d/ifenslave
debug: eth0: up : running script /etc/network/if-up.d/ifenslave
info: executing /etc/network/if-up.d/ifenslave
debug: tap0: pre-up : running script /etc/network/if-pre-up.d/ifenslave
info: executing /etc/network/if-pre-up.d/ifenslave
debug: tap0: up : running script /etc/network/if-up.d/ifenslave
info: executing /etc/network/if-up.d/ifenslave
[16:54:55] root:ifupdown2 #
...
apply patch
...
[16:55:16] root:ifupdown2 # ifreload -a -d &> /tmp/ifreload.log
[16:55:18] root:ifupdown2 # cat /tmp/ifreload.log | grep ifenslave
[16:55:19] root:ifupdown2 #

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-27 11:05:37 +02:00
c7541843b2 fixes #14 addons: usercmds: add environment variables passed to user scripts
$ cat /etc/network/interfaces
auto eth0
iface eth0 inet dhcp
      up /root/test.sh
$
$ cat /root/test.sh
echo 'IFACE=' $IFACE
echo 'LOGICAL=' $LOGICAL
echo 'METHOD=' $METHOD
echo 'ADDRFAM=' $ADDRFAM
$
$ ifreload -a
IFACE= eth0
LOGICAL= eth0
METHOD= dhcp
ADDRFAM= inet
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-26 16:12:41 +02:00
8252491ed0 addons: mstpctl: warning user when using portadminedge attr on bridge vlan aware
Ticket: CM-12478
Reviewed By: Roopa, Nikhil G

Roopa: "For vlan aware bridge, we don't support the port attributes under the
bridge. It was deliberately done when vlan aware bridge config was introduced
because people wanted to get rid of the legacy under the bridge way of decla-
-ring port attributes. It was supported for a bit for evorack...in limited
 form. we should probably just warn the user about this."

auto br100
iface br100
      bridge_ports swp3 swp4 swp5
      mstpctl-portadminedge swp3=yes swp4=yes swp5=yes
      bridge-vlan-aware yes

$ ifreload -a -s
warning: br100: unsupported use of keyword 'mstpctl-portadminedge' when bridge-vlan-aware is on
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-26 15:59:43 +02:00
378c6c2681 ifupdownmain: sending ifaceobj to syntax_check method
Ticket: None
Reviewed By: Roopa, Nikhil G

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-26 10:37:33 +02:00
3fb52fa360 ifupdown: scheduler: ignore errors generated by upperiface bring up
Ticket: CM-12923
Reviewed By: julien, nikhil
Testing Done: tested implicit upperiface bring up

upperiface bringup is best effort, so ignore errors.

$ifquery -c -a
..[snip]...
auto br0
iface br0
        bridge-vlan-aware yes                        [pass]
        bridge-ports vx-14 vx-11 vx-10 vx-13 vx-12   [pass]

$ifdown vx-10
$ifdown vx-11

before patch:
$ifup vx-10
..[snip]...
info: running upperifaces (parent interfaces) if available ..
info: br0: running ops ...
error: br0: bridge port vx-11 does not exist
....

After patch:
$ifup vx-10
..[snip]...
info: running upperifaces (parent interfaces) if available ..
info: br0: running ops ...
....

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-09-22 13:54:16 -07:00
cd45e62956 addons: usercmds: add environment variables passed to user scripts
Ticket: github issue #14
Reviewed By: Roopa, Nikhil G
Testing Done:

$ cat /etc/network/interfaces
auto eth0
iface eth0 inet dhcp
      up /root/test.sh
$
$ cat /root/test.sh
echo 'IFACE=' $IFACE
echo 'LOGICAL=' $LOGICAL
echo 'METHOD=' $METHOD
echo 'ADDRFAM=' $ADDRFAM
$
$ ifreload -a
IFACE= eth0
LOGICAL= eth0
METHOD= dhcp
ADDRFAM= inet
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-20 09:16:57 -07:00
81765e715e debian: changelog: fixup last released and unreleased versions
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-09-19 16:38:55 -07:00
c4df8a5a17 debian: changelog: add cumulus ticket-ids to changelog entries
Adhere to cumulus changelog policy.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
cl3u5
2016-09-19 10:15:47 -07:00
344e50bfbb debian: changelog: update version to 1.1-cl3u5
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-09-16 12:50:42 -07:00
6fa9b969ad Merge branch 'staging3.1.1' into dev 2016-09-16 12:41:06 -07:00
1f5db4a862 fix for passing parameters to templateEngine() class
Signed-off-by: Marek Grzybowski <marek.grzybowski@rtbhouse.com>
2016-09-16 12:39:51 -07:00
64d80a9300 Merge pull request #18 from RTBHOUSE/master
fix for passing parameters to templateEngine() class
2016-09-16 12:37:54 -07:00
1a6bda12ed ifupdownmain: dont catch link_up and link_down errors in ifupdownmain
Ticket: CM-12843
Reviewed By: julien, nikhil
Testing Done: Tested the failing test case in the bug

The scheduler already has some checking for errors from
link_up and link_down introduced by
commit 61c4d7244735 ("Suppress 'Network down' warnings when
link_master_slave feature is on").

The above fix was removed by a recent commit
707aeb737882 ("netlink ip link set up/down may silently fail, adding
try/except statements"). The scheduler does catch these errors.
so we will need to figure out why the scheduler is not catching it.
Right now this is failing an automation test. So the best fix
is to make sure the previous behaviour is restored.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-09-16 11:29:27 -07:00
d2e93ca251 config: enable mako templates by default
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-09-15 13:37:41 -07:00
58db3da458 fix for passing parameters to templateEngine() class 2016-09-15 21:39:16 +02:00
6fbd7444db addons: vrf: close sockets when vrf interface goes down
Ticket: CM-11393
Reviewed By: dsa, julien, nikhil
Testing Done: tested up and down of a vrf interface

$ifdown -v blue
..snip ..
info: executing /usr/lib/vrf/vrf-helper delete blue 1030
info: executing ip link del blue
info: executing /bin/ss -aK "dev == 54"
info: vrf: syncing table map to
/etc/iproute2/rt_tables.d/ifupdown2_vrf_map.conf

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-09-15 10:51:49 -07:00
dc3f4c4507 addons: addressvirtual: fix handling of admin state of macvlan interfaces
Ticket: CM-12823
Reviewed By: julien, nikhil
Testing Done: Tested addressvirtual config with vrfs (as described in
the bug)

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-09-15 08:10:32 -07:00
0493bac6cb addons: addressvirtual: adjusting macvlan mtu based on the lower device
Ticket: CM-11214
Reviewed By: Roopa
Testing Done:

Previously we were adjusting the macvlan mtu based on the wrong device.
We used to do, using the config example bellow:

get_mtu(ifaceobj.lowerifaces[0])
get_mtu("bridge")

instead of doing get_mtu(bridge.20)

$ cat /etc/network/interfaces
auto tap0
iface tap0
      #mtu 9000
      mtu 1500

auto bridge
iface bridge
      bridge-ports tap0

auto bridge.20
iface bridge.20
      address 10.7.192.194/27
      address-virtual 44:38:39:ff:00:20 10.7.192.193
$ ifreload -a
$ ip link show
bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
bridge.20@bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
bridge-20-v0@bridge.20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
$ #change mtu to 9000
$ ifreload -a
$ ip link show
bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP mode DEFAULT group default
bridge.20@bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP mode DEFAULT group default
bridge-20-v0@bridge.20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP mode DEFAULT group default
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-14 17:15:36 -07:00
82908a2d73 normalizing ip address(s) to IPNetwork format for string comparaison
Ticket: CM-12798
Reviewed By: Roopa, Nikhil G
Testing Done:

We are seeing some issue when using IP addresses with inner values padded with
zeros. Such as: 2a01:75e0:0000:09b0::1/64
The kernel will process the ip properly but when we query the kernel again (with
iproute2 or netlink) it returns 2a01:75e0:0:09b0::1/64

Since we are doing string comparaison we are seeing failures. We are now
converting all ip address to a standard format using IPNetwork or IPAddress obj

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-14 16:00:25 -07:00
df4327e9ca Merge remote-tracking branch 'origin/staging3.1.1' into dev 2016-09-13 17:11:38 -07:00
0309264919 addons: address: ignoring iproute2 'rtnetlink file exists' errors
Ticket: CM-12798
Reviewed By: Roopa
Testing Done:

A customer discovered a corner case: the kernel is shrinking/reducing the ip
address fields containing 0s. For example if we configure and address such as
2a01:75e0:0000:09b0::1/64

Then if we query the kernel (using iproute2 or netlink) it will come back as:
2a01:75e0:0:09b0::1/64

Because of this issue we were seeing
root@r4u28:~# ifreload -a
error: bridge.200: cmd 'ip -force -batch - [addr add 10.50.103.193/26 dev bridge.200
addr add 2a01:75e0:0000:09b1::1/64 dev bridge.200
]' failed: returned 1 (RTNETLINK answers: File exists
Command failed -:1
)

Before adding an address to an iface we query it to know if the change is
necessary, since we only do a string comparaison between:
2a01:75e0:0000:09b1::1/64 and 2a01:75e0:0:09b1::1/64

it fails, ifupdown2 thinks that a change is needed. So we try to add the new
address via iproute2. iproute2 will fail because this address in a "shrinked"
format already exists.

This patch hot-fixes this problem by ignoring the error if it's an "exists"
error, we don't want to confuse the user.
A later fix will the real issue by normalizing all ip addr to the IPNetwork
format.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-13 17:03:24 -07:00
abbf513ef4 ifupdown: netlink: removing log message when retrieving ifindex
Ticket: None
Reviewed By: Roopa

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-13 11:27:14 -07:00
346a0d6833 debian: fixing lintian warnings/errors
Ticket:
Reviewed By: Roopa
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-09 12:30:50 -07:00
1bb990bd98 3.2 - nclu - net add bridge alias not taking text in quotes
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   roopa@cumulusnetworks.com

Ticket: CM-12764
2016-09-07 19:13:58 +00:00
2ed2adeb6e 3.2 - nclu - adding v6 gateway followed by v4 - v6 is lost
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   roopa@cumulusnetworks.com

Ticket: CM-12725
2016-09-07 16:57:55 +00:00
d52b3449ed debian: copyright: fixing merge errors
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-09-06 16:47:03 -07:00
89a0bc6512 Merge branch 'eadev' into dev
Conflicts:
	addons/address.py
	addons/bridge.py
	nlmanager/nlmanager.py
2016-09-02 16:06:58 -07:00
0ab836bd27 Merge remote-tracking branch 'cumulus/dev'
Conflicts:
	config/ifupdown2.conf
	nlmanager/nllistener.py
2016-09-02 15:45:58 -07:00
6f5b74f7cc 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>
2016-09-02 15:10:24 -07:00
29d834f6a8 addons: bridge: protect all vids to int calls under try/except
Ticket: CM-12716
Reviewed By: julien, nikhil
Testing Done: tested with non-int vids and pvid

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-09-02 12:35:05 -07:00
19c9569911 nlmanager: fixing error messages when receiving NLMSG_ERROR
Ticket: CM-12596
Reviewed By: Roopa, Daniel W
Testing Done:

before this patch:

$ cat /etc/network/interfaces
auto tapppppppppppp0.42
iface tapppppppppppp0.42
$
$ ifreload -a
warning: /etc/network/interfaces: line8: tapppppppppppp0.42: interface name too long
error: netlink: tapppppppppppp0: cannot create vlan 42: Operation failed with 'None' (RXed  NLMSG_ERROR, pid 3346, seq 6, 108 bytes)
$

after:

$ ifreload -a
warning: /etc/network/interfaces: line8: tapppppppppppp0.42: interface name too long
error: netlink: tapppppppppppp0: cannot create vlan 42: Operation failed with 'Numerical result out of range'
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-08-25 14:57:21 -07:00
26d1e82b2f nlmanager: support for bridge vlan and show commands
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   julien@cumulusnetworks.com

Ticket: CM-12199

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-08-25 14:39:36 -07:00
707aeb7378 netlink ip link set up/down may silently fail, adding try/except statements
Ticket: CM-12609
Reviewed By: Roopa, Nikhil G
Testing Done: ifupdown2 smoke tests

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-08-24 14:20:45 -07:00