mirror_frr.git
7 months agoMerge pull request #3561 from opensourcerouting/northbound-freebsd-fix master
Quentin Young [Thu, 3 Jan 2019 16:48:31 +0000 (11:48 -0500)]
Merge pull request #3561 from opensourcerouting/northbound-freebsd-fix

lib: fix segfault on freebsd when using vsnprintf() incorrectly

7 months agoMerge pull request #3558 from opensourcerouting/silence-ioctl-warning
Russ White [Thu, 3 Jan 2019 02:43:18 +0000 (21:43 -0500)]
Merge pull request #3558 from opensourcerouting/silence-ioctl-warning

zebra: silence harmless ioctl warning when retrieving interface speed

7 months agoMerge pull request #3560 from opensourcerouting/fix-sh-bgp-community
Russ White [Thu, 3 Jan 2019 02:42:50 +0000 (21:42 -0500)]
Merge pull request #3560 from opensourcerouting/fix-sh-bgp-community

bgpd: fix parsing of community number in the "show bgp community" command

7 months agoMerge pull request #3549 from chiragshah6/mdev
Russ White [Thu, 3 Jan 2019 02:39:58 +0000 (21:39 -0500)]
Merge pull request #3549 from chiragshah6/mdev

bgpd: evpn command to restrict to default vrf

7 months agolib: fix segfault on freebsd when using vsnprintf() incorrectly
Renato Westphal [Thu, 3 Jan 2019 00:32:13 +0000 (22:32 -0200)]
lib: fix segfault on freebsd when using vsnprintf() incorrectly

FreeBSD's libc segfaults when vsnprintf() is called with a null
format string. Add a null check before calling vsnprintf() to
resolve this problem.

Fixes #3537

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 months agobgpd: fix parsing of community number in the "show bgp community" command
Renato Westphal [Wed, 2 Jan 2019 21:25:02 +0000 (19:25 -0200)]
bgpd: fix parsing of community number in the "show bgp community" command

Fixes #3545.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 months agozebra: silence harmless ioctl warning when retrieving interface speed
Renato Westphal [Wed, 2 Jan 2019 18:47:51 +0000 (16:47 -0200)]
zebra: silence harmless ioctl warning when retrieving interface speed

zebra uses the SIOCETHTOOL ioctl with the ETHTOOL_GSET command to
fetch the speed of interfaces from the kernel. The only problem is
that ETHTOOL_GSET returns EOPNOTSUPP when the given interface is a
virtual interface. This leads to zebra emitting warnings like this
at startup:

ZEBRA: IOCTL failure to read interface lo speed: 95 Operation not supported
ZEBRA: IOCTL failure to read interface dummy0 speed: 95 Operation not supported
ZEBRA: IOCTL failure to read interface ovs-system speed: 95 Operation not supported

Silence these warnings by ignoring EOPNOTSUPP errors, since we know
they are harmless. This is similar to how we handle EINVAL errors
from the BSD SIOCGIFMEDIA ioctl (commit c69f2c1ff).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 months agoMerge pull request #3553 from opensourcerouting/fix-interface-vrf-update-msg
Quentin Young [Wed, 2 Jan 2019 18:50:47 +0000 (13:50 -0500)]
Merge pull request #3553 from opensourcerouting/fix-interface-vrf-update-msg

zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message

7 months agoMerge pull request #3550 from donaldsharp/sharp_nhg
Renato Westphal [Wed, 2 Jan 2019 16:42:34 +0000 (14:42 -0200)]
Merge pull request #3550 from donaldsharp/sharp_nhg

Sharp nhg

7 months agoMerge pull request #3534 from opensourcerouting/netlink-length-duplicated
Quentin Young [Wed, 2 Jan 2019 15:53:49 +0000 (10:53 -0500)]
Merge pull request #3534 from opensourcerouting/netlink-length-duplicated

zebra: remove duplicated code

7 months agozebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
Renato Westphal [Wed, 2 Jan 2019 15:05:53 +0000 (13:05 -0200)]
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message

Unlike the other interface zapi messages, ZEBRA_INTERFACE_VRF_UPDATE
identifies interfaces using ifindexes and not interface names. This
is a problem because zebra always sends ZEBRA_INTERFACE_DOWN
and ZEBRA_INTERFACE_DELETE messages before sending
ZEBRA_INTERFACE_VRF_UPDATE, and the ZEBRA_INTERFACE_DELETE callback
from all daemons set the interface index to IFINDEX_INTERNAL. Hence,
when decoding a ZEBRA_INTERFACE_VRF_UPDATE message, the interface
lookup would always fail since the corresponding interface lost
its ifindex. Example (ospfd):

OSPF: Zebra: Interface[rt1-eth2] state change to down.
OSPF: Zebra: interface delete rt1-eth2 vrf default[0] index 8 flags 11143 metric 0 mtu 1500
OSPF: [EC 100663301] INTERFACE_VRF_UPDATE: Cannot find IF 8 in VRF 0

To fix this problem, use interface names instead of ifindexes to
indentify interfaces like the other interface zapi messages do.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 months agosharpd: Allow sharpd to accept nexthop group as part of route install
Donald Sharp [Mon, 31 Dec 2018 22:49:47 +0000 (17:49 -0500)]
sharpd: Allow sharpd to accept nexthop group as part of route install

When installing routes via sharpd 'sharp install route... ' command
add the ability to specify a nexthop-group to use.  This will
allow sharpd to create ECMP routes into zebra.

Nexthop-group:
!
nexthop-group JANELLE
  nexthop 192.168.209.1
  nexthop 192.168.210.1
!

The install:

donna.cumulusnetworks.com# sharp install routes 10.0.50.0 nexthop-group JANELLE 10
donna.cumulusnetworks.com# end
donna.cumulusnetworks.com# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route

K>* 0.0.0.0/0 [0/106] via 10.0.2.2, enp0s3, 00:20:38
C>* 10.0.2.0/24 is directly connected, enp0s3, 00:20:38
D>* 10.0.50.0/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.1/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.2/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.3/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.4/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.5/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.6/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.7/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.8/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.9/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
C>* 192.168.209.0/24 is directly connected, enp0s8, 00:20:38
C>* 192.168.210.0/24 is directly connected, enp0s9, 00:20:38
donna.cumulusnetworks.com#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 months agosharpd/vtysh: Allow sharpd to use nexthop-groups
Donald Sharp [Mon, 31 Dec 2018 22:48:36 +0000 (17:48 -0500)]
sharpd/vtysh: Allow sharpd to use nexthop-groups

Allow the sharp daemon to understand and use nexthop-groups.

This commit is merely to allow sharpd to understand them
when accepted in a future commit

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 months agosharp: Modify route install to take nexthop groups
Donald Sharp [Mon, 31 Dec 2018 22:28:13 +0000 (17:28 -0500)]
sharp: Modify route install to take nexthop groups

Modify the route_add function to take nexthop groups.  Future commits
will allow sharpd to use nexthop groups as the install mechanism
for routes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 months agoMerge pull request #3543 from donaldsharp/eigrp_router_id_is_the_bee
Renato Westphal [Wed, 2 Jan 2019 00:39:03 +0000 (22:39 -0200)]
Merge pull request #3543 from donaldsharp/eigrp_router_id_is_the_bee

Eigrp router id cleanup

7 months agoMerge pull request #3540 from donaldsharp/staic
Renato Westphal [Wed, 2 Jan 2019 00:36:59 +0000 (22:36 -0200)]
Merge pull request #3540 from donaldsharp/staic

staticd: Do not ready prefix for printing till it's decoded

7 months agoMerge pull request #3246 from pguibert6WIND/distribute_vrf_aware
Renato Westphal [Wed, 2 Jan 2019 00:34:59 +0000 (22:34 -0200)]
Merge pull request #3246 from pguibert6WIND/distribute_vrf_aware

Distribute vrf aware

7 months agobgpd: evpn command to restrict to default vrf
Chirag Shah [Mon, 31 Dec 2018 21:18:21 +0000 (13:18 -0800)]
bgpd: evpn command to restrict to default vrf

Certain EVPN configuartions should only be applied
under DEFAULT VRF bgpd instance.

reject the cli for non default bgp instance

Ticket:CM-18950

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
7 months agoMerge pull request #3546 from opensourcerouting/ospf-show-neighbor-fix
Donald Sharp [Mon, 31 Dec 2018 14:26:37 +0000 (09:26 -0500)]
Merge pull request #3546 from opensourcerouting/ospf-show-neighbor-fix

ospfd: fix wrong argv index in the "show ip ospf neighbor" command

7 months agoospfd: convert a couple of "show" commands to DEFPY
Renato Westphal [Mon, 31 Dec 2018 13:11:15 +0000 (11:11 -0200)]
ospfd: convert a couple of "show" commands to DEFPY

DEFPY commands are easier to maintain and less susceptible to
bugs. In the long term we should try to merge the plethora of
"show ip ospf neighbor" commands (total of 14) into a single DEFPY.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 months agoospfd: fix wrong argv index in the "show ip ospf neighbor" command
Renato Westphal [Mon, 31 Dec 2018 13:02:49 +0000 (11:02 -0200)]
ospfd: fix wrong argv index in the "show ip ospf neighbor" command

Fixes Issue #3544.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 months agoeigrpd: Allow eigrp to set/unset the router-id as a value.
Donald Sharp [Mon, 31 Dec 2018 00:59:52 +0000 (19:59 -0500)]
eigrpd: Allow eigrp to set/unset the router-id as a value.

This code addition allows eigrp to set/unset the router-id
value.  At this point I am not 100% sure that we do all the necessary
rework when a router-id changes.  But on startup if read in before
a network statement we should be ok.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 months agoeigrpd: eigrp usage of uint32_t to struct in_addr for router_id data
Donald Sharp [Mon, 31 Dec 2018 00:54:25 +0000 (19:54 -0500)]
eigrpd: eigrp usage of uint32_t to struct in_addr for router_id data

In eigrp we were using a uint32_t to hold the `struct in_addr` data
for the router id values.  This caused us to do unnecessary conversions
pre and post for in/out.  Let's just use the standard `struct in_addr`

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 months agoeigrpd: Write eigrp config even if no network statements yet
Donald Sharp [Mon, 31 Dec 2018 00:44:27 +0000 (19:44 -0500)]
eigrpd: Write eigrp config even if no network statements yet

Let's write the eigrp config even if we have no network statements
as that the other functions return safely if nothing to do here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 months agozebra: replace zlog_err with flog_err
Rafael Zalamena [Sat, 29 Dec 2018 09:14:14 +0000 (07:14 -0200)]
zebra: replace zlog_err with flog_err

Change the logging mechanism for truncated netlink error messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
7 months agostaticd: Do not ready prefix for printing till it's decoded
Donald Sharp [Fri, 28 Dec 2018 02:46:01 +0000 (21:46 -0500)]
staticd: Do not ready prefix for printing till it's decoded

The static daemon is setting up the prefix for printing
before it is decoded when we get notified about our
route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 months agolib, rip, ripng, babel, eigrp: add ctx pointer to distribute api
Philippe Guibert [Tue, 4 Dec 2018 14:45:57 +0000 (15:45 +0100)]
lib, rip, ripng, babel, eigrp: add ctx pointer to distribute api

a distribute_ctx context pointer is returned after initialisation to the
calling daemon. this context pointer will be further used to do
discussion with distribute service. Today, there is no specific problem
with old api, since the pointer is the same in all the memory process.
but the pointer will be different if we have multiple instances. Right
now, this is not the case, but if that happens, that work will be used
for that.
distribute-list initialisation is split in two. the vty initialisation
is done at global level, while the context initialisation is done for
each routing daemon instance.
babel daemon is being equipped with a routing returning the main babel
instance.
also, a delete routine is available when the daemon routing instance is
suppressed.
a list of contexts is used inside distribute_list. This will permit
distribute_list utility to handle in the same daemon to handle more than
one context. This will be very useful in the vrf context.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 months agolib: enforce vrf_name_to_id by returning default_vrf when name is null
Philippe Guibert [Tue, 20 Nov 2018 09:30:47 +0000 (10:30 +0100)]
lib: enforce vrf_name_to_id by returning default_vrf when name is null

in order to enforce the vrf_id to return, from a vrf name, a check is
done on the vrf_name_to_id callback.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 months agoMerge pull request #3535 from kareiva/master
Quentin Young [Thu, 27 Dec 2018 21:25:26 +0000 (16:25 -0500)]
Merge pull request #3535 from kareiva/master

Fix typos in BGPd sample configuration file

7 months agoFix typos in BGPd sample configuration file
Simonas [Thu, 27 Dec 2018 07:13:55 +0000 (09:13 +0200)]
Fix typos in BGPd sample configuration file

7 months agozebra: remove duplicated code
Rafael Zalamena [Wed, 26 Dec 2018 18:57:46 +0000 (16:57 -0200)]
zebra: remove duplicated code

Remove duplicated netlink error message length check.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
8 months agoMerge pull request #3527 from opensourcerouting/ldpd-bsd-fixes
Donald Sharp [Sat, 22 Dec 2018 01:20:48 +0000 (20:20 -0500)]
Merge pull request #3527 from opensourcerouting/ldpd-bsd-fixes

ldpd: *BSD fixes

8 months agoldpd: fix startup on OpenBSD
Rafael Zalamena [Fri, 21 Dec 2018 22:59:18 +0000 (20:59 -0200)]
ldpd: fix startup on OpenBSD

We must open the PF_KEY socket before dropping privileges, otherwise the
socket creation will fail with permission problems.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
8 months agozebra: fix compilation on OpenBSD
Rafael Zalamena [Fri, 21 Dec 2018 19:03:05 +0000 (17:03 -0200)]
zebra: fix compilation on OpenBSD

OpenBSD doesn't define RTM_LOCK anymore:
https://marc.info/?l=openbsd-tech&m=153018811429193&w=2

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
8 months agoldpd: add support for FreeBSD IP_BINDANY
Rafael Zalamena [Fri, 21 Dec 2018 14:27:44 +0000 (12:27 -0200)]
ldpd: add support for FreeBSD IP_BINDANY

Add yet another way to setsockopt a socket to listen to a foreign
address.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
8 months agoMerge pull request #3499 from donaldsharp/topotest_inheritance
Rafael Zalamena [Thu, 20 Dec 2018 17:52:03 +0000 (15:52 -0200)]
Merge pull request #3499 from donaldsharp/topotest_inheritance

Topotest inheritance

8 months agoMerge pull request #3327 from adeg/feature/bgp-lu-auto-labels
Renato Westphal [Thu, 20 Dec 2018 15:59:28 +0000 (13:59 -0200)]
Merge pull request #3327 from adeg/feature/bgp-lu-auto-labels

bgpd, zebra: auto assign labels to regular labeled-unicast prefixes

8 months agobgpd, zebra: auto assign labels from label pool to regular prefixes in BGP labeled...
Anton Degtyarev [Wed, 14 Nov 2018 03:14:04 +0000 (06:14 +0300)]
bgpd, zebra: auto assign labels from label pool to regular prefixes in BGP labeled unicast

This commit is the last missing piece to complete BGP LU support in bgpd. To this moment, bgpd (and zebra) supported auto label assignment only for prefixes leaked from VRFs to vpn and for MPLS SR prefixes. This adds auto label assignment to other routes types in bgpd. The following enhancements have been made:
* bgp_route.c:bgp_process_main_one() now sets implicit-null local_label to all local, aggregate and redistributed routes.
* bgp_route.c:bgp_process_main_one() now will request a label from the label pool for any prefix that loses the label for some reason (for example, when the static label assignment config is removed)
* bgp_label.c:bgp_reg_dereg_for_label() now requests labels from label pool for routes which have no associated label index
* zebra_mpls.c:zebra_mpls_fec_register() now expects both label and label_index from the calling function, one of which must be set to MPLS_INVALID_LABEL or MPLS_INVALID_LABEL_INDEX, based on this it will decide how to register the provided FEC.

Signed-off-by: Anton Degtyarev <anton@cumulusnetworks.com>
8 months agoMerge pull request #3516 from qlyoung/doc-ip-nht-resolve-via-default
Renato Westphal [Thu, 20 Dec 2018 12:05:01 +0000 (10:05 -0200)]
Merge pull request #3516 from qlyoung/doc-ip-nht-resolve-via-default

doc: add `ip nht resolve-via-default`

8 months agoMerge pull request #3517 from qlyoung/doc-exclude-snmptrap
Renato Westphal [Thu, 20 Dec 2018 12:04:13 +0000 (10:04 -0200)]
Merge pull request #3517 from qlyoung/doc-exclude-snmptrap

doc: exclude snmptrap.rst from build

8 months agoMerge pull request #3515 from mjstapp/fix_rib_wq_timer
Donald Sharp [Wed, 19 Dec 2018 20:33:56 +0000 (15:33 -0500)]
Merge pull request #3515 from mjstapp/fix_rib_wq_timer

zebra: reduce rib workqueue retry timeout

8 months agodoc: exclude snmptrap.rst from build
Quentin Young [Wed, 19 Dec 2018 18:08:42 +0000 (18:08 +0000)]
doc: exclude snmptrap.rst from build

This doc is .. include::'d in snmp.rst and needs to be ignored as part
of the main toctree build. This patch squashes a Sphinx build warning.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 months agodoc: add `ip nht resolve-via-default`
Quentin Young [Wed, 19 Dec 2018 17:55:05 +0000 (17:55 +0000)]
doc: add `ip nht resolve-via-default`

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 months agoMerge pull request #3513 from mjstapp/fix_dplane_q_include
Quentin Young [Wed, 19 Dec 2018 17:11:24 +0000 (12:11 -0500)]
Merge pull request #3513 from mjstapp/fix_dplane_q_include

zebra: include lib/queue.h in zebra dataplane

8 months agoMerge pull request #3492 from donaldsharp/no_set_community
Russ White [Wed, 19 Dec 2018 16:57:01 +0000 (11:57 -0500)]
Merge pull request #3492 from donaldsharp/no_set_community

bgpd: Allow 'no set community`

8 months agozebra: reduce rib workqueue retry timeout
Mark Stapp [Wed, 19 Dec 2018 16:51:41 +0000 (11:51 -0500)]
zebra: reduce rib workqueue retry timeout

Reduce the zebra rib workqueue retry timeout, used when the queue
towards the zebra dataplane has reached its limit. Lowering the
value was reported to improve update throughput on some platforms.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
8 months agoMerge pull request #3502 from donaldsharp/socket_to_me_baby
Russ White [Wed, 19 Dec 2018 16:48:42 +0000 (11:48 -0500)]
Merge pull request #3502 from donaldsharp/socket_to_me_baby

BSD route socket refactoring/cleanup

8 months agozebra: Fixup spaces/tabs issue found by CI in rt_socket.c
Donald Sharp [Wed, 19 Dec 2018 00:32:14 +0000 (19:32 -0500)]
zebra: Fixup spaces/tabs issue found by CI in rt_socket.c

Cleanup the space/tabs issues found by CI in rt_socket.c so
it stops complaining at us.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agozebra: Make label processing guaranteed to be unique
Donald Sharp [Wed, 19 Dec 2018 00:34:22 +0000 (19:34 -0500)]
zebra: Make label processing guaranteed to be unique

The label processing for socket installs was not ensuring
that each nexthop would not accidently use the last
nexthops value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agozebra: include lib/queue.h in zebra dataplane
Mark Stapp [Wed, 19 Dec 2018 14:03:33 +0000 (09:03 -0500)]
zebra: include lib/queue.h in zebra dataplane

Replace direct use of one of the platform-specific xxx-queue.h
headers - use the wrapper queue.h instead.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
8 months agozebra: Convert gate in kernel_rtm to a bool
Donald Sharp [Mon, 17 Dec 2018 23:34:26 +0000 (18:34 -0500)]
zebra: Convert gate in kernel_rtm to a bool

Convert the gate test int to a bool as that we use it this way.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agozebra: The mask and sin_mask are a bit redundant for kernel_rtm
Donald Sharp [Mon, 17 Dec 2018 23:31:09 +0000 (18:31 -0500)]
zebra: The mask and sin_mask are a bit redundant for kernel_rtm

The test we were using to ensure that a mask was sent in
is a bit redundant, let's just always send it in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agozebra: Refactor kernel_rtm to be a bit smarter about how it handles options
Donald Sharp [Mon, 17 Dec 2018 23:21:38 +0000 (18:21 -0500)]
zebra: Refactor kernel_rtm to be a bit smarter about how it handles options

The ADD/DELETE messages are the only ones we support, so leave
early from the function, in other words don't check it every
nexthop loop.

Additionally nexthops only care about non recursive active flags.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agozebra: Refactor kernel_socket kernel_rtm_ipv4 and ipv6 functions
Donald Sharp [Mon, 17 Dec 2018 19:23:02 +0000 (14:23 -0500)]
zebra: Refactor kernel_socket kernel_rtm_ipv4 and ipv6 functions

Refactor both v4 and v6 functions down to 1 install function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agozebra: Move sin6_masklen to earlier in the file
Donald Sharp [Mon, 17 Dec 2018 21:28:47 +0000 (16:28 -0500)]
zebra: Move sin6_masklen to earlier in the file

I'm going to rearrage the kernel_rtm_ipv4 and v6 functions
so the sin6_masklen needs to be moved a bit earlier.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agozebra: Convert socket interface to use `union sockunion`
Donald Sharp [Mon, 17 Dec 2018 18:57:04 +0000 (13:57 -0500)]
zebra: Convert socket interface to use `union sockunion`

The write function converted to v4 and v6 functions to a union sockunion
via casting.  Just use `union sockunion` instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agobgpd: Allow shortened 'no set large-community' and 'no set large-comm-list'
Donald Sharp [Wed, 19 Dec 2018 12:30:01 +0000 (07:30 -0500)]
bgpd: Allow shortened 'no set large-community' and 'no set large-comm-list'

These two commands previously required the whole original command but
we should allow the user to shorten out this since the data at the
end is not required to figure out what to delete.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agobgpd: Allow `no set extcommunity [rt|soo]`
Donald Sharp [Wed, 19 Dec 2018 12:22:26 +0000 (07:22 -0500)]
bgpd: Allow `no set extcommunity [rt|soo]`

The ability to shorten the extended community commands for routemaps
upon removal should be allowed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agobgpd: Allow 'no set community`
Donald Sharp [Sun, 16 Dec 2018 18:54:41 +0000 (13:54 -0500)]
bgpd: Allow 'no set community`

Allow user to enter `no set community` to remove the community
set for the route-map.

Fixes: #3491
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agoMerge pull request #3448 from chiragshah6/evpn_dev1
Sri Mohana Singamsetty [Wed, 19 Dec 2018 02:12:18 +0000 (18:12 -0800)]
Merge pull request #3448 from chiragshah6/evpn_dev1

bgpd: l3vni add-del handle non-defualt route-target

8 months agoMerge pull request #3507 from opensourcerouting/master-init-fixes
Donald Sharp [Wed, 19 Dec 2018 00:21:39 +0000 (19:21 -0500)]
Merge pull request #3507 from opensourcerouting/master-init-fixes

[master] minor tools/ fixes

8 months agoMerge pull request #3503 from qlyoung/fix-bgpd-show-ip-neigh-json-double-free
David Lamparter [Tue, 18 Dec 2018 17:01:48 +0000 (18:01 +0100)]
Merge pull request #3503 from qlyoung/fix-bgpd-show-ip-neigh-json-double-free

bgpd: fix json double free when showing neighbors

8 months agozebra: Allow ns delete to happen after under/over flow checks
Donald Sharp [Mon, 17 Dec 2018 02:36:49 +0000 (21:36 -0500)]
zebra: Allow ns delete to happen after under/over flow checks

Allow the ns deletion event to happen *after* the data validity
checks.

Please note this probably still leaves a weird hole if we receive
multiple namespace events ( as the for loop implies ).  We will
stop handling anything after a namespace deletion notification.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 months agoMerge pull request #3485 from dslicenc/frr-reload-delete-vrf
David Lamparter [Tue, 18 Dec 2018 16:54:28 +0000 (17:54 +0100)]
Merge pull request #3485 from dslicenc/frr-reload-delete-vrf

tools: stop frr-reload.py from trying to delete the vrf context

8 months agoMerge pull request #3422 from pguibert6WIND/license_gplv3_rule
David Lamparter [Tue, 18 Dec 2018 16:42:27 +0000 (17:42 +0100)]
Merge pull request #3422 from pguibert6WIND/license_gplv3_rule

doc: add a community rule to permit usage of GPLv3

8 months agoMerge pull request #3337 from manuhalo/isis_nb
Donald Sharp [Tue, 18 Dec 2018 16:33:40 +0000 (11:33 -0500)]
Merge pull request #3337 from manuhalo/isis_nb

IS-IS northbound conversion - configuration and notifications only

8 months agoisisd: suppress maybe uninitialized warnings
Emanuele Di Pascale [Tue, 11 Dec 2018 09:55:32 +0000 (10:55 +0100)]
isisd: suppress maybe uninitialized warnings

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd, yang: set default network-type to broadcast
Emanuele Di Pascale [Mon, 10 Dec 2018 14:18:25 +0000 (15:18 +0100)]
isisd, yang: set default network-type to broadcast

isisd has both a circ_type and a circ_type_config variable to track
the network tpye of an interface. The former has no default, but the
latter defaults to broadcast. Adding that default makes sure that the
yang leaf won't be deleted, which is something that would not make
sense from an isisd perspective. We will need to add an operational
state leaf to match the potential difference between the configured
network type and the actual network type, since the latter might be
different based on the interface flags received from zebra.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: formatting fixes in isis_cli.c
Emanuele Di Pascale [Mon, 10 Dec 2018 13:56:16 +0000 (14:56 +0100)]
isisd: formatting fixes in isis_cli.c

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: fix 'no router isis' on candidate config
Emanuele Di Pascale [Mon, 10 Dec 2018 13:54:48 +0000 (14:54 +0100)]
isisd: fix 'no router isis' on candidate config

if we are using the transactional CLI, we might be trying to
delete an area that has not been actually created in isisd.
So rather than relying on isis_area_lookup, check the candidate
config for the presence of the corresponding area instance.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: retrieve default values from the yang model
Emanuele Di Pascale [Mon, 10 Dec 2018 13:30:40 +0000 (14:30 +0100)]
isisd: retrieve default values from the yang model

also fix a minor issue with isis_config_write where we were
not incrementing the write variable, which is used to append
a new line at the end of the vty string

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agolib: add frr-isisd to the native models
Emanuele Di Pascale [Mon, 10 Dec 2018 11:07:54 +0000 (12:07 +0100)]
lib: add frr-isisd to the native models

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement sighup handler
Emanuele Di Pascale [Mon, 10 Dec 2018 11:02:32 +0000 (12:02 +0100)]
isisd: implement sighup handler

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd, yang: change type empty leafs to booleans
Emanuele Di Pascale [Mon, 10 Dec 2018 10:44:30 +0000 (11:44 +0100)]
isisd, yang: change type empty leafs to booleans

As requested by the reviewers. Additionally, added a check when
setting a circuit on an interface to see if it is a loopback,
and in that case, set it to passive.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: embed the isisd yang model
Emanuele Di Pascale [Mon, 3 Dec 2018 09:38:12 +0000 (10:38 +0100)]
isisd: embed the isisd yang model

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implemented the 'own-lsp-purge' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 15:27:51 +0000 (16:27 +0100)]
isisd: implemented the 'own-lsp-purge' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implemented the 'sequence-number-skipped' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 15:09:43 +0000 (16:09 +0100)]
isisd: implemented the 'sequence-number-skipped' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: add the 'lsp-error-detected' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 15:05:57 +0000 (16:05 +0100)]
isisd: add the 'lsp-error-detected' notification

Note that we do not return the actual tlv_type and offset
of the erroneous TLV. This is because unpacking tlvs currently
uses a chain of function calls, where the notification can only
be sent at the start of the chain, but the tlv_type and offset
information are only available at the end. Unless we change the
code to propagate those values, we have no way to feed them to
the notification. So these leafs are not generated.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'version-skew' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:30:46 +0000 (15:30 +0100)]
isisd: implement the 'version-skew' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'id-len-mismatch' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:29:55 +0000 (15:29 +0100)]
isisd: implement the 'id-len-mismatch' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'lsp-generation' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:28:55 +0000 (15:28 +0100)]
isisd: implement the 'lsp-generation' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'lsp-received' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:28:12 +0000 (15:28 +0100)]
isisd: implement the 'lsp-received' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'area-mismatch' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:27:10 +0000 (15:27 +0100)]
isisd: implement the 'area-mismatch' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'rejected-adjacency' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:25:54 +0000 (15:25 +0100)]
isisd: implement the 'rejected-adjacency' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'adjacency-state-change' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:24:00 +0000 (15:24 +0100)]
isisd: implement the 'adjacency-state-change' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the authentication failure notifications
Emanuele Di Pascale [Wed, 14 Nov 2018 14:20:38 +0000 (15:20 +0100)]
isisd: implement the authentication failure notifications

the original isisd code did not distinguish between
authentication_failure and authentication_type_failure, so
additional code had to be added to differentiate between the two
and to return the raw_pdu as requested by the IETF YANG model.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement 'max-area-addresses-mismatch' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:12:15 +0000 (15:12 +0100)]
isisd: implement 'max-area-addresses-mismatch' notification

Note that the original IETF YANG model also included
a requirement to throttle such notifications so that they would
not be sent more often than once every 5 seconds. I did not
implement any throttling mechanism yet, mostly because I am
not sure whether this limit should apply to the entire isis daemon,
to each area, to each neighbor etc.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'attempt-to-exceed-max-sequence' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:08:26 +0000 (15:08 +0100)]
isisd: implement the 'attempt-to-exceed-max-sequence' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'corrupted-lsp-detected' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:06:43 +0000 (15:06 +0100)]
isisd: implement the 'corrupted-lsp-detected' notification

However it is not currently called anywhere, as I could not find a
place in the code where it felt appropriate.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'if-state-change' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:04:51 +0000 (15:04 +0100)]
isisd: implement the 'if-state-change' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'lsp-too-large' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 14:03:24 +0000 (15:03 +0100)]
isisd: implement the 'lsp-too-large' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: implement the 'database-overload' notification
Emanuele Di Pascale [Wed, 14 Nov 2018 13:55:48 +0000 (14:55 +0100)]
isisd: implement the 'database-overload' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: modify config_write funcs to use the northbound
Emanuele Di Pascale [Wed, 14 Nov 2018 13:50:53 +0000 (14:50 +0100)]
isisd: modify config_write funcs to use the northbound

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: retrofit the 'log-adjacency-changes' command
Emanuele Di Pascale [Wed, 14 Nov 2018 13:44:07 +0000 (14:44 +0100)]
isisd: retrofit the 'log-adjacency-changes' command

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: retrofit the 'isis priority' command
Emanuele Di Pascale [Wed, 14 Nov 2018 13:39:18 +0000 (14:39 +0100)]
isisd: retrofit the 'isis priority' command

remove isis_vty_isisd.c as it is no longer needed

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: retrofit the 'isis network' command
Emanuele Di Pascale [Wed, 14 Nov 2018 13:35:43 +0000 (14:35 +0100)]
isisd: retrofit the 'isis network' command

remove the return value and redundant validations from
isis_circuit_circ_type_set(), since they are no longer needed.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: retrofit the 'isis circuit-type' command
Emanuele Di Pascale [Thu, 15 Nov 2018 11:11:19 +0000 (12:11 +0100)]
isisd: retrofit the 'isis circuit-type' command

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: retrofit the 'isis topology' command
Emanuele Di Pascale [Wed, 14 Nov 2018 13:27:33 +0000 (14:27 +0100)]
isisd: retrofit the 'isis topology' command

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: retrofit the 'isis [c|p]snp-interval' commands
Emanuele Di Pascale [Wed, 14 Nov 2018 13:21:46 +0000 (14:21 +0100)]
isisd: retrofit the 'isis [c|p]snp-interval' commands

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
8 months agoisisd: retrofit the 'isis hello-padding' command
Emanuele Di Pascale [Wed, 14 Nov 2018 13:16:41 +0000 (14:16 +0100)]
isisd: retrofit the 'isis hello-padding' command

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>