]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
5 years agobgpd: simplify json create/free for memleak fix 4772/head
Don Slice [Mon, 5 Aug 2019 11:48:20 +0000 (04:48 -0700)]
bgpd: simplify json create/free for memleak fix

Ticket: CM-25616
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agobgpd: resolve memleak on show bgp vrf all ipv6 unicast summary json
Don Slice [Wed, 31 Jul 2019 16:38:49 +0000 (12:38 -0400)]
bgpd: resolve memleak on show bgp vrf all ipv6 unicast summary json

Problem reported with memory leak when the command "show bgp vrf all
ipv6 unicast summary json" is issued.  Found that the problem only
occurs if the configuration does not actually include the ipv6
address-family but does contain ipv4 unicast peers. If we didn't
match a peer in the address-family being displayed, we would create
the json object but never free it.  This fix actually stops creating
the json object in this section of code and lets the create happen
in the area where the match occurs.

Ticket: CM-25616
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agoMerge pull request #4766 from donaldsharp/redist_small_fix
Mark Stapp [Fri, 2 Aug 2019 11:44:31 +0000 (07:44 -0400)]
Merge pull request #4766 from donaldsharp/redist_small_fix

zebra: Redistribution should be told about the old route

5 years agoMerge pull request #4713 from ton31337/fix/set_comm-list_delete_into_config_memcpy
Sri Mohana Singamsetty [Fri, 2 Aug 2019 04:19:43 +0000 (21:19 -0700)]
Merge pull request #4713 from ton31337/fix/set_comm-list_delete_into_config_memcpy

 bgpd: Strip `delete` keyword when looking up for communities

5 years agozebra: Redistribution should be told about the old route 4766/head
Donald Sharp [Thu, 1 Aug 2019 23:09:59 +0000 (19:09 -0400)]
zebra: Redistribution should be told about the old route

When we are sending a redistribute_update, pass the old_re in
so that if we still have it around we can update the calling protocol.

Test:

router ospf
  redistribute sharp
!

sharp install route 4.5.6.7 nexthop 192.168.201.1 1

Now add a `ip route 4.5.6.7/32 192.168.201.1`.
This causes zebra to replace the sharp route with the static route.
No update is sent to ospf and debug:
2019/08/01 19:02:38.271998 ZEBRA: 0:4.5.6.7/32: Redist update re 0x12fdbda0 (static), old 0x0 (None)

With fix:

2019/08/01 19:15:09.644499 ZEBRA: 0:4.5.6.7/32: Redist update re 0x1ba5bce0 (static), old 0x1beea4e0 (sharp)
2019/08/01 19:15:09.645462 OSPF: ospf_zebra_read_route: from client sharp: vrf_id 0, p 4.5.6.7/32

Ticket: CM-25847
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4672 from abrahambinu83/ldp_label_release
Renato Westphal [Thu, 1 Aug 2019 22:05:12 +0000 (19:05 -0300)]
Merge pull request #4672 from abrahambinu83/ldp_label_release

ldpd: Fix to release MPLS label if its not used anymore

5 years agoMerge pull request #4764 from donaldsharp/doc_v6_doc
Mark Stapp [Thu, 1 Aug 2019 18:50:12 +0000 (14:50 -0400)]
Merge pull request #4764 from donaldsharp/doc_v6_doc

doc: Add warning to doc about v6 ecmp route deletion

5 years agodoc: Add warning to doc about v6 ecmp route deletion 4764/head
Donald Sharp [Thu, 1 Aug 2019 16:53:15 +0000 (12:53 -0400)]
doc: Add warning to doc about v6 ecmp route deletion

Add a warning to the user documentation about v6 ecmp route
deletion and what version of the linux kernel that you should
be using.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4760 from chiragshah6/evpn_dev2
Mark Stapp [Thu, 1 Aug 2019 16:24:30 +0000 (12:24 -0400)]
Merge pull request #4760 from chiragshah6/evpn_dev2

zebra: fix evpn dad clear cmd mac parsing

5 years agoMerge pull request #4758 from donaldsharp/test_epoch
David Lamparter [Thu, 1 Aug 2019 15:07:43 +0000 (17:07 +0200)]
Merge pull request #4758 from donaldsharp/test_epoch

tests: Do not use peerUptime as a measure of if a clear worked

5 years agoMerge pull request #4757 from donaldsharp/import_check_fixup
Renato Westphal [Thu, 1 Aug 2019 14:40:52 +0000 (11:40 -0300)]
Merge pull request #4757 from donaldsharp/import_check_fixup

Import check fixup

5 years agoMerge pull request #4723 from sworleys/List-Del-API
David Lamparter [Thu, 1 Aug 2019 14:31:09 +0000 (16:31 +0200)]
Merge pull request #4723 from sworleys/List-Del-API

List API add const and return object on `*_del`

5 years agoMerge pull request #4755 from donaldsharp/ospf_router_id_doc
Donatas Abraitis [Thu, 1 Aug 2019 07:30:59 +0000 (10:30 +0300)]
Merge pull request #4755 from donaldsharp/ospf_router_id_doc

doc: Fix ospf router-id doc suggestion

5 years agozebra: fix evpn dad clear cmd mac parsing 4760/head
Chirag Shah [Wed, 31 Jul 2019 01:58:44 +0000 (18:58 -0700)]
zebra: fix evpn dad clear cmd mac parsing

The changes came as part of PR #4730, checks
only variable mac, which is never null. Even
for ip version of cli hits "mac" case statement
and failing the clear cli.

Testing Done:

Before Fix:

VTEP-03# show evpn arp-cache vni 1002 duplicate
VNI 1002 #ARP (IPv4 and IPv6, local and remote) 1

IP                        Type   State    MAC               Remote VTEP
Seq #'s
11.11.11.11               remote active   aa:22:aa:aa:aa:aa 27.0.0.16
7/8

VTEP-03# clear evpn dup-addr vni 1002 ip 11.11.11.11
% Requested MAC does not exist in VNI 1002

Post fix:

VTEP-03# clear evpn dup-addr vni 1002 ip 11.11.11.11
VTEP-03#

VTEP-03# show evpn mac vni all duplicat
VNI 1002 #MACs (local and remote) 1

MAC               Type   Intf/Remote VTEP      VLAN  Seq #'s
aa:aa:aa:aa:aa:aa remote 27.0.0.16                   7/8

Post fix:

VTEP-03# clear evpn dup-addr vni 1002 mac aa:aa:aa:aa:aa:aa
VTEP-03#

VTEP-03# clear evpn dup-addr vni 1002 ip 11.11.11.11
VTEP-03#

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agoMerge pull request #4690 from donaldsharp/staticstuff
Mark Stapp [Wed, 31 Jul 2019 18:38:00 +0000 (14:38 -0400)]
Merge pull request #4690 from donaldsharp/staticstuff

Improve staticd handling of nexthops and nht to improve scale

5 years agoMerge pull request #4754 from opensourcerouting/gen-northbound-improvements
Donald Sharp [Wed, 31 Jul 2019 18:28:45 +0000 (14:28 -0400)]
Merge pull request #4754 from opensourcerouting/gen-northbound-improvements

tools: improve gen_northbound_callbacks

5 years agotests: Do not use peerUptime as a measure of if a clear worked 4758/head
Donald Sharp [Wed, 31 Jul 2019 16:29:32 +0000 (12:29 -0400)]
tests: Do not use peerUptime as a measure of if a clear worked

The peerUptime data received from a `show bgp ipv4 uni summ json`
gives you the time in seconds since the peer has come up.
The clear_bgp_and_verify function is checking the peerUptime
for before and after and if they are the same then the test
was declaring a clear failure.

The problem with this is of course that the tests can run fast
enough that the peerUptime is the same for before and after the clear.

Modify the test case to use peerUptimeEstablishedEpoch.
This value is the seconds since the epoch since the establishment
of the peer.  This will allow us to know that a clear happened.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Add const to _count() in new list APIs 4723/head
Stephen Worley [Wed, 31 Jul 2019 00:26:31 +0000 (20:26 -0400)]
lib: Add const to _count() in new list APIs

Add const to the datastructure being passed to the new list APIs
for the `_count()` calls.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agolib: Add identifiers to RB declarations
Stephen Worley [Wed, 24 Jul 2019 15:37:08 +0000 (11:37 -0400)]
lib: Add identifiers to RB declarations

Checkpatch was complaining about the lack of identifiers here, so
added some.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agotests: Add asserts to check return on list *_del
Stephen Worley [Tue, 23 Jul 2019 20:33:48 +0000 (16:33 -0400)]
tests: Add asserts to check return on list *_del

Add some asserts where `list_del()` is called to verify they object
was found when it was deleted.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agolib: Impelement the `*_del` list API.
Stephen Worley [Tue, 23 Jul 2019 16:23:25 +0000 (12:23 -0400)]
lib: Impelement the `*_del` list API.

The new list api did not implement the `*_del` endpoint as
it was described in the docs here:

http://docs.frrouting.org/projects/dev-guide/en/latest/lists.html#c.Z_del

This patch implements the endpoints to return the object deleted if
found, otherwise NULL for all but the atomic lists.

The atomic list `*_del` code is marked as TODO and will remain undefined
for now.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Fix display of `show ip import-check A.B.C.D` 4757/head
Donald Sharp [Wed, 31 Jul 2019 15:07:58 +0000 (11:07 -0400)]
zebra: Fix display of `show ip import-check A.B.C.D`

The 'show ip import-check A.B.C.D` code was generating
a /32 prefix for comparison.  Except import-check was
being used by bgp to track networks.  So they could
have received a /24( or anything the `network A.B.C.D/M`
statement specifies ).

Consequently when we do a `show ip import-check A.B.C.D`
we would never find the network but a `show ip import-check |
grep A.B.C.D` would find it.

Fix the exact comparison to a match.

For the `show ip nht A.B.C.D` case we are comparing
a /32 to a /32 so prefix_match will work still.
While a `show ip import-check A.B.C.D` will now show
the expected behavior as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agodoc: Update documentation to reflect new `sharp watch import` changes
Donald Sharp [Wed, 31 Jul 2019 14:50:24 +0000 (10:50 -0400)]
doc: Update documentation to reflect new `sharp watch import` changes

Update the documentation to reflect the reality on the ground.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agosharpd: Update 'sharp watch import` to allow prefix
Donald Sharp [Wed, 31 Jul 2019 14:47:46 +0000 (10:47 -0400)]
sharpd: Update 'sharp watch import` to allow prefix

Instead of defaulting the import-check to a /32
allow the tester to specify any prefix that they want
when doing an import-check.

Test:

donna.cumulusnetworks.com# sharp watch import
  A.B.C.D/M   The v4 prefix for import check to watch
  X:X::X:X/M  The v6 prefix to signal for watching
donna.cumulusnetworks.com# sharp watch import 4.5.6.0/24
donna.cumulusnetworks.com# show ip import-check
4.5.6.0
 resolved via kernel
 via 10.50.11.1, enp0s3
 Client list: sharp(fd 21)
donna.cumulusnetworks.com# sharp watch import 4:5:6::0/64
donna.cumulusnetworks.com# show ipv6 import-check
4:5:6::
 resolved via kernel
 fe80::cad7:19ff:fe0a:fdfd, via enp0s3
 fe80::ce37:abff:fe4f:a601, via enp0s3
 Client list: sharp(fd 21)
donna.cumulusnetworks.com# sharp watch nexthop
  A.B.C.D   The v4 address to signal for watching
  X:X::X:X  The v6 nexthop to signal for watching
donna.cumulusnetworks.com# sharp watch nexthop 4.5.6.7
donna.cumulusnetworks.com# sharp watch nexthop 4:5::6:7
donna.cumulusnetworks.com# show ip nht
4.5.6.7
 unresolved
 Client list: sharp(fd 21)
donna.cumulusnetworks.com# show ipv6 nht
4:5::6:7
 unresolved
 Client list: sharp(fd 21)

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4756 from vincentbernat/fix/doc-aspath
Donald Sharp [Wed, 31 Jul 2019 14:45:35 +0000 (10:45 -0400)]
Merge pull request #4756 from vincentbernat/fix/doc-aspath

doc: fix "match as-path" documentation

5 years agodoc: fix "match as-path" documentation 4756/head
Vincent Bernat [Wed, 31 Jul 2019 14:40:02 +0000 (16:40 +0200)]
doc: fix "match as-path" documentation

The documentation says "match aspath" to match an AS path in a
route-map while the directive is "match as-path".

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
5 years agodoc: Fix ospf router-id doc suggestion 4755/head
Donald Sharp [Tue, 30 Jul 2019 21:13:55 +0000 (17:13 -0400)]
doc: Fix ospf router-id doc suggestion

The v2 and v3 ospf documentation was suggesting
that the user should use a deprecated command.

Fixes: #4734
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agotools: generate code that handles all cases 4754/head
Rafael Zalamena [Mon, 29 Jul 2019 22:30:33 +0000 (19:30 -0300)]
tools: generate code that handles all cases

Help developers to start implementing northbound with more complete
callbacks.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #4671 from abrahambinu83/pim_endianness
Russ White [Tue, 30 Jul 2019 15:18:33 +0000 (11:18 -0400)]
Merge pull request #4671 from abrahambinu83/pim_endianness

pimd: handle endianness in pim header structure

5 years agoMerge pull request #4650 from pguibert6WIND/show_ip_route_table_all
Russ White [Tue, 30 Jul 2019 15:18:10 +0000 (11:18 -0400)]
Merge pull request #4650 from pguibert6WIND/show_ip_route_table_all

zebra: add show ip route all command to dump all unicast tables

5 years agoMerge pull request #4750 from dslicenc/bgp-remove-replace-as
Russ White [Tue, 30 Jul 2019 15:12:56 +0000 (11:12 -0400)]
Merge pull request #4750 from dslicenc/bgp-remove-replace-as

bgpd: stop removing and replacing private asn if it matches the peer

5 years agoMerge pull request #4746 from donaldsharp/zebra_rib_improvements
Russ White [Tue, 30 Jul 2019 15:11:41 +0000 (11:11 -0400)]
Merge pull request #4746 from donaldsharp/zebra_rib_improvements

Zebra rib improvements

5 years agoMerge pull request #4732 from qlyoung/ercode-oncec
Russ White [Tue, 30 Jul 2019 14:58:45 +0000 (10:58 -0400)]
Merge pull request #4732 from qlyoung/ercode-oncec

vtysh: only show error codes once

5 years agoMerge pull request #4721 from dslicenc/bgpd-fix-nexthop
Russ White [Tue, 30 Jul 2019 14:50:32 +0000 (10:50 -0400)]
Merge pull request #4721 from dslicenc/bgpd-fix-nexthop

bgpd: encode implicit next-hop-self in some vrf route leaking scenarios

5 years agoMerge pull request #4649 from ton31337/feature/access-list_sequence
Russ White [Tue, 30 Jul 2019 14:40:42 +0000 (10:40 -0400)]
Merge pull request #4649 from ton31337/feature/access-list_sequence

filter: Introduce sequence number for access-list

5 years agoMerge pull request #4582 from donaldsharp/do_not_warn
Russ White [Tue, 30 Jul 2019 14:38:25 +0000 (10:38 -0400)]
Merge pull request #4582 from donaldsharp/do_not_warn

bgpd: Do not display to end user not found afi/safi's

5 years agoMerge pull request #4698 from opensourcerouting/frr-reload-fix-misc-cmds
Donald Sharp [Tue, 30 Jul 2019 14:11:04 +0000 (10:11 -0400)]
Merge pull request #4698 from opensourcerouting/frr-reload-fix-misc-cmds

frr-reload.py: fix reload with different settings

5 years agoMerge pull request #4560 from lkrishnamoor/filter_vni_changes_jun
Donald Sharp [Tue, 30 Jul 2019 13:41:22 +0000 (09:41 -0400)]
Merge pull request #4560 from lkrishnamoor/filter_vni_changes_jun

bgp: Route-map VNI in-filter filters out all the routes for EVPN

5 years agoMerge pull request #4751 from qlyoung/fix-vrrp-iface-del-badfix
Mark Stapp [Tue, 30 Jul 2019 13:38:59 +0000 (09:38 -0400)]
Merge pull request #4751 from qlyoung/fix-vrrp-iface-del-badfix

vrrpd: set interface ifindex to internal upon interface deletion

5 years agotools: generate northbound code without warnings
Rafael Zalamena [Mon, 29 Jul 2019 22:28:59 +0000 (19:28 -0300)]
tools: generate northbound code without warnings

Use the alternate struct instantiation that does not generates warning
on old compilers.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agotools: allow YANG model path specification
Rafael Zalamena [Mon, 29 Jul 2019 21:59:20 +0000 (18:59 -0300)]
tools: allow YANG model path specification

This allows developer to set a temporary YANG model directory path for
generating northbound for models not yet installed.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agovrrpd: set interface ifindex to internal upon interface deletion 4751/head
Quentin Young [Mon, 29 Jul 2019 18:16:14 +0000 (18:16 +0000)]
vrrpd: set interface ifindex to internal upon interface deletion

That fix line should have been in a different place.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: stop removing and replacing private asn if it matches the peer 4750/head
Don Slice [Thu, 25 Jul 2019 15:35:06 +0000 (11:35 -0400)]
bgpd: stop removing and replacing private asn if it matches the peer

Problems reported that if multiple peers have "remove-private-AS
replace-AS" with each other and all are using private asns, the as-path
gets hosed and continues to grow when a prefix is removed.  This fix
disallows removing and replacing the private asn if it matches the
peer's ASN so that normal as-path loop prevention will operate correctly.

Ticket: CM-25489
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agozebra, tests: Remove ROUTE_ENTRY_NEXTHOPS_CHANGED 4746/head
Donald Sharp [Mon, 29 Jul 2019 18:53:58 +0000 (14:53 -0400)]
zebra, tests: Remove ROUTE_ENTRY_NEXTHOPS_CHANGED

The flag ROUTE_ENTRY_NEXTHOPS_CHANGED is only ever set or unset.
Since this flag is not used for anything useful, remove from system.

By changing this flag we have re-ordered `internalStatus' of json
output of zebra rib routes.  Go through and fix up tetsts to
use the new values.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agovtysh: style nits for error code cli handler 4732/head
Quentin Young [Mon, 29 Jul 2019 17:19:05 +0000 (17:19 +0000)]
vtysh: style nits for error code cli handler

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agovtysh: only show error codes once
Quentin Young [Tue, 8 Jan 2019 21:33:49 +0000 (21:33 +0000)]
vtysh: only show error codes once

When using `show error` commands, show errors shared between multiple
daemons only once.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #4728 from ton31337/fix/next-hop-self_force_alias_for_ipv6
Quentin Young [Mon, 29 Jul 2019 16:41:55 +0000 (12:41 -0400)]
Merge pull request #4728 from ton31337/fix/next-hop-self_force_alias_for_ipv6

bgpd: Add hidden `next-hop-self all` for all address families

5 years agoMerge pull request #4736 from dslicenc/zebra-skip-queued-entry
Mark Stapp [Mon, 29 Jul 2019 16:31:03 +0000 (12:31 -0400)]
Merge pull request #4736 from dslicenc/zebra-skip-queued-entry

zebra: skip queued entries when resolving nexthop

5 years agoMerge pull request #4740 from opensourcerouting/omgwtfbbq
Donald Sharp [Mon, 29 Jul 2019 16:14:39 +0000 (12:14 -0400)]
Merge pull request #4740 from opensourcerouting/omgwtfbbq

lib: OMGWTFBBQ Ã— 2

5 years agozebra: Remove repeated enqueueing of system routes for rethinking
Donald Sharp [Mon, 29 Jul 2019 15:36:03 +0000 (11:36 -0400)]
zebra: Remove repeated enqueueing of system routes for rethinking

The code as written before this code change point would enqueue
every system route type to be refigured when we have an
interface event.  I believe this was to originally handle bugs
in the way nexthop tracking was handled, mainly that if you keep
asking the question you'll eventually get the right answer.

Modify the code to not do this, we have fixed nexthop tracking
to not be so brain dead and to know when it needs to refigure
a route that it is tracking.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Fix route replace v4 semantics with new system route
Donald Sharp [Mon, 29 Jul 2019 15:10:25 +0000 (11:10 -0400)]
zebra: Fix route replace v4 semantics with new system route

When a new system route comes in and we have a pre-existing
non-system route we are not deleting the current system
route from the linux kernel.

Modify the code such that when a route replace is sent
to the kernel with a new route as a system route and
the old route as a non-system route do a delete of
the old route so it is no longer in the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4729 from idryzhov/master
Donald Sharp [Mon, 29 Jul 2019 14:14:50 +0000 (10:14 -0400)]
Merge pull request #4729 from idryzhov/master

vtysh: send vtysh_quit_nexthop_group to pbrd and sharpd

5 years agolib: fix prefix_copy() for clang-SA 4740/head
David Lamparter [Mon, 29 Jul 2019 13:49:49 +0000 (15:49 +0200)]
lib: fix prefix_copy() for clang-SA

https://bugs.llvm.org/show_bug.cgi?id=42811

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #4737 from opensourcerouting/bgp-path-attr-fix
Donald Sharp [Mon, 29 Jul 2019 12:57:06 +0000 (08:57 -0400)]
Merge pull request #4737 from opensourcerouting/bgp-path-attr-fix

topotest: fix bgp-path-attributes-topology

5 years agoMerge pull request #4735 from dslicenc/bgp-clear-interface
Donatas Abraitis [Mon, 29 Jul 2019 08:30:22 +0000 (11:30 +0300)]
Merge pull request #4735 from dslicenc/bgp-clear-interface

bgpd: solve invalid error message when clearing interface peer

5 years agolib: fix misplaced brace in typesafe lists
David Lamparter [Sun, 28 Jul 2019 07:27:03 +0000 (09:27 +0200)]
lib: fix misplaced brace in typesafe lists

OMGWTFBBQ no. 2...

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agolib: use some more transparent unions for prefixes
David Lamparter [Sun, 28 Jul 2019 07:26:21 +0000 (09:26 +0200)]
lib: use some more transparent unions for prefixes

... so we can pass prefix_ipv4/prefix_ipv6 in.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agolib: fix prefix_cmp() return values
David Lamparter [Sun, 28 Jul 2019 07:24:00 +0000 (09:24 +0200)]
lib: fix prefix_cmp() return values

OMGWTFBBQ

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotopotest: fix bgp-path-attributes-topology 4737/head
Rafael Zalamena [Fri, 26 Jul 2019 20:32:48 +0000 (17:32 -0300)]
topotest: fix bgp-path-attributes-topology

The first RIB check wants to assert that we don't have the r7's routes
in r1, so right after that code the routers r2 and r3 are configured
then `verify_rib` is called again to check for those routes.

This test never passed, but it didn't cause failures because of the
`try`/`except`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agozebra: skip queued entries when resolving nexthop 4736/head
Don Slice [Mon, 1 Jul 2019 17:17:46 +0000 (17:17 +0000)]
zebra: skip queued entries when resolving nexthop

Problem reported where certain routes were not being passed on to
clients if they were operated on while still queued for kernel
installation.   Changed it to defer working on entries that were
queued to dplane so we could operate on them after getting an
answer back from kernel installatino.

Ticket: CM-25480
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agobgpd: solve invalid error message when clearing interface peer 4735/head
Don Slice [Wed, 24 Jul 2019 15:52:03 +0000 (15:52 +0000)]
bgpd: solve invalid error message when clearing interface peer

Problem reported that if "clear bgp swp1" is issued, an error
message is received saying the name or address is malformed. This
was because of a change in bgp_vty.c that removed the storing
and passing of the interface name for this command. Commit that
caused the problem was ac5dec7e88ce2f8cd2943bb61437046718fb34c2.

Ticket: CM-25737
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agotopotests: Check if set-comm-list is working under route-map scope 4713/head
Donatas Abraitis [Fri, 26 Jul 2019 06:16:49 +0000 (09:16 +0300)]
topotests: Check if set-comm-list is working under route-map scope

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: Convert to network byte order before passing value to `community_del_val`
Donatas Abraitis [Fri, 19 Jul 2019 13:15:52 +0000 (16:15 +0300)]
bgpd: Convert to network byte order before passing value to `community_del_val`

community_val_get() returns ntohl(val) which is used in more places like
community_include(), community_add_val(), but community_del_val() is missing
back conversion htonl().

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #4730 from idryzhov/fix
Quentin Young [Thu, 25 Jul 2019 15:57:07 +0000 (11:57 -0400)]
Merge pull request #4730 from idryzhov/fix

lib: fix missing M:A:C to X:X:X:X:X:X changes

5 years agolib: fix missing M:A:C to X:X:X:X:X:X changes 4730/head
Igor Ryzhov [Thu, 25 Jul 2019 12:35:46 +0000 (15:35 +0300)]
lib: fix missing M:A:C to X:X:X:X:X:X changes

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
5 years agobgpd: Add hidden `next-hop-self all` for all address families 4728/head
Donatas Abraitis [Wed, 24 Jul 2019 16:05:51 +0000 (19:05 +0300)]
bgpd: Add hidden `next-hop-self all` for all address families

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agovtysh: send vtysh_quit_nexthop_group to pbrd and sharpd 4729/head
Igor Ryzhov [Thu, 25 Jul 2019 08:59:27 +0000 (11:59 +0300)]
vtysh: send vtysh_quit_nexthop_group to pbrd and sharpd

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
5 years agoMerge pull request #4691 from donaldsharp/pim_upstream_ref
Jafar Al-Gharaibeh [Wed, 24 Jul 2019 20:32:15 +0000 (15:32 -0500)]
Merge pull request #4691 from donaldsharp/pim_upstream_ref

Pim upstream ref

5 years agoMerge pull request #4725 from idryzhov/master
Quentin Young [Wed, 24 Jul 2019 15:19:19 +0000 (11:19 -0400)]
Merge pull request #4725 from idryzhov/master

vtysh: send "exit-vrf" command to staticd

5 years agovtysh: send "exit-vrf" command to staticd 4725/head
Igor Ryzhov [Wed, 24 Jul 2019 12:41:20 +0000 (15:41 +0300)]
vtysh: send "exit-vrf" command to staticd

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
5 years agofrr-reload.py: fix reload with different settings 4698/head
Rafael Zalamena [Wed, 17 Jul 2019 13:09:25 +0000 (10:09 -0300)]
frr-reload.py: fix reload with different settings

Add `allow-external-route-update` and `domainname` to the one line
context list, otherwise reload will fail when those commands show up in
the running configuration.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #4708 from opensourcerouting/topotest-common-improvement
Quentin Young [Tue, 23 Jul 2019 20:47:10 +0000 (16:47 -0400)]
Merge pull request #4708 from opensourcerouting/topotest-common-improvement

topotest: attempt to stabilize CI system

5 years agobgpd: encode implicit next-hop-self in some vrf route leaking scenarios 4721/head
Don Slice [Wed, 17 Jul 2019 17:19:08 +0000 (13:19 -0400)]
bgpd: encode implicit next-hop-self in some vrf route leaking scenarios

Problem reported that when vrf route-leaking between an unnumbered
peer in one vrf to a numbered peer in another vrf, the nexthop
attribute was missing from the update, causing the session to fail.
determined that we needed to expand the  mechanism for verifying if
the route has been learned in the other vrf without an ipv4 nexthop.

Ticket: CM-25610
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agotopotest: improve common_config.py 4708/head
Rafael Zalamena [Mon, 22 Jul 2019 16:16:35 +0000 (13:16 -0300)]
topotest: improve common_config.py

Don't wait for `True` results when the return type is a string.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agotopotest: add new run_and_expect variant
Rafael Zalamena [Mon, 22 Jul 2019 16:12:08 +0000 (13:12 -0300)]
topotest: add new run_and_expect variant

The new `run_and_expect` variant - called `run_and_expect_type` - tests
the return value type of the test function and optionally the return
value.

Now we can implement tests from test functions that return different
return types.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agotopotest: improve reliability of `verify_rib`
Rafael Zalamena [Wed, 17 Jul 2019 21:39:03 +0000 (18:39 -0300)]
topotest: improve reliability of `verify_rib`

Attempt to run the function multiple times to make sure we got the
result we expected. This is a middle ground between big sleeps and short
test intervals.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agotopotest/bgp_l3vpn_to_bgp_vrf: stabilize test
Rafael Zalamena [Thu, 18 Jul 2019 14:30:42 +0000 (11:30 -0300)]
topotest/bgp_l3vpn_to_bgp_vrf: stabilize test

Increase wait times between commands execution to help avoid bogus test
failures.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agotopotest: adjust luCommand to accept wait_time
Rafael Zalamena [Thu, 18 Jul 2019 14:29:33 +0000 (11:29 -0300)]
topotest: adjust luCommand to accept wait_time

Allow users of `luCommand` to specify wait time between commands
execution and simplify the `wait` method implementation.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agotopotest: fix Lou's framework command wait
Rafael Zalamena [Thu, 18 Jul 2019 13:56:50 +0000 (10:56 -0300)]
topotest: fix Lou's framework command wait

Fix two main issues:

  * Don't use float to figure out if we spent the time user asked;
  * Don't depend on system clock to find we reached the end of time;

The fix is basically pre caculating the amount of wait cycles we are
going to peform and use a counter.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #4699 from donaldsharp/tests_do_not_faile_me
Martin Winter [Mon, 22 Jul 2019 16:55:26 +0000 (18:55 +0200)]
Merge pull request #4699 from donaldsharp/tests_do_not_faile_me

Add more debugging to ci log files to figure out what is going on.

5 years agobgpd: Route-map VNI in-filter filters out all the routes for EVPN 4560/head
Lakshman Krishnamoorthy [Wed, 19 Jun 2019 21:29:34 +0000 (14:29 -0700)]
bgpd: Route-map VNI in-filter filters out all the routes for EVPN

Issue1: When a vni in-filter eg:"neighbor X.X.X.X route-map RM-VNI-FILTER in"
is configured under evpn address-family, all the received routes are dropped
regardless of whether the route has a matching vni or not.
(Where RM-VNI-FILTER contains "match evpn vni 100")

Issue2: Routes with 2 labels are not filtered correctly

Issue3: This filter should not get applied for MPLS routes. For MPLS routes,
we need route-map to handle a 3rd state besides match/nomatch called: noop.

Fix1: The handler bgp_update() that services the received route ignored the
route's label while deciding whether to filter it or not.
As part of the fix, the handler now uses the label info to make the
decision about whether to filter the route or not.

Fix2: route_match_vni() now tries to match both the labels within the route

Fix3: route_match_vni() should return noop when it encounters an mpls based
route. For this, route_map library should handle this 3rd state: RMAP_NOOP.

Related fix : Extract tunnel type
This fix relies on PR 4314 #4314 to extract the tunnel type from bgp extended
communities. The information about the route's tunnel type (vxlan or mpls)
is needed to apply "match evpn vni xx" rule.  This rule is applicable to
vxlan routes, and should exit safely for mpls based evpn routes.

Signed-off-by: Lakshman Krishnamoorthy lkrishnamoor@vmware.com
5 years agolib: Introducing a 3rd state for route-map match cmd: RMAP_NOOP
Lakshman Krishnamoorthy [Wed, 19 Jun 2019 21:04:36 +0000 (14:04 -0700)]
lib: Introducing a 3rd state for route-map match cmd: RMAP_NOOP

Introducing a 3rd state for route_map_apply library function: RMAP_NOOP

Traditionally route map MATCH rule apis  were designed to return
a binary response, consisting of either RMAP_MATCH or RMAP_NOMATCH.
(Route-map SET rule apis return RMAP_OKAY or RMAP_ERROR).
Depending on this response, the following statemachine decided the
course of action:

State1:
If match cmd returns RMAP_MATCH then, keep existing behaviour.
If routemap type is PERMIT, execute set cmds or call cmds if applicable,
otherwise PERMIT!
Else If routemap type is DENY, we DENYMATCH right away

State2:
If match cmd returns RMAP_NOMATCH, continue on to next route-map. If there
are no other rules or if all the rules return RMAP_NOMATCH, return DENYMATCH

We require a 3rd state because of the following situation:

The issue - what if, the rule api needs to abort or ignore a rule?:
"match evpn vni xx" route-map filter can be applied to incoming routes
regardless of whether the tunnel type is vxlan or mpls.
This rule should be N/A for mpls based evpn route, but applicable to only
vxlan based evpn route.
Also, this rule should be applicable for routes with VNI label only, and
not for routes without labels. For example, type 3 and type 4 EVPN routes
do not have labels, so, this match cmd should let them through.

Today, the filter produces either a match or nomatch response regardless of
whether it is mpls/vxlan, resulting in either permitting or denying the
route.. So an mpls evpn route may get filtered out incorrectly.
Eg: "route-map RM1 permit 10 ; match evpn vni 20" or
"route-map RM2 deny 20 ; match vni 20"

With the introduction of the 3rd state, we can abort this rule check safely.
How? The rules api can now return RMAP_NOOP to indicate
that it encountered an invalid check, and needs to abort just that rule,
but continue with other rules.

As a result we have a 3rd state:
State3:
If match cmd returned RMAP_NOOP
Then, proceed to other route-map, otherwise if there are no more
rules or if all the rules return RMAP_NOOP, then, return RMAP_PERMITMATCH.

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
5 years agoMerge pull request #4688 from qlyoung/alpine-docker-rpki
Donatas Abraitis [Fri, 19 Jul 2019 19:21:29 +0000 (22:21 +0300)]
Merge pull request #4688 from qlyoung/alpine-docker-rpki

docker: build alpine docker w/ rpki enabled

5 years agobgpd: Strip `delete` keyword when looking up for communities
Donatas Abraitis [Fri, 19 Jul 2019 12:56:58 +0000 (15:56 +0300)]
bgpd: Strip `delete` keyword when looking up for communities

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #4695 from donaldsharp/zebra_zapi_msgs
Mark Stapp [Thu, 18 Jul 2019 13:38:12 +0000 (09:38 -0400)]
Merge pull request #4695 from donaldsharp/zebra_zapi_msgs

Zebra zapi msgs - improve debugs

5 years agopimd: Always create upstream reference when adding channel oil 4691/head
Donald Sharp [Tue, 9 Jul 2019 00:00:43 +0000 (00:00 +0000)]
pimd: Always create upstream reference when adding channel oil

Modify the code to create an upstream reference whenever the code
creates an channel_oil via the pim_mroute.c code.  This code also
starts a keep alive timer to clean up the reference if we do
nothing with it after the normal time.

I've left alone the source->channel_oil creation because these
are kept and tracked independently already.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: pim_upstream *always* creates a channel_oil
Donald Sharp [Mon, 8 Jul 2019 23:57:01 +0000 (19:57 -0400)]
pimd: pim_upstream *always* creates a channel_oil

Modify code base so that pim_upstream *always* creates a channel_oil
and as such we do not need to create it later or play other games.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Add pim_channel_oil_change_iif
Donald Sharp [Mon, 8 Jul 2019 23:46:01 +0000 (19:46 -0400)]
pimd: Add pim_channel_oil_change_iif

Add a function that allows you to modify the channel oil's incoming
interface and to appropriately install/remove it from the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoTest: Add back a bit more debugging to see what is going on 4699/head
Donald Sharp [Wed, 17 Jul 2019 15:23:25 +0000 (11:23 -0400)]
Test: Add back a bit more debugging to see what is going on

All debug logging has been thrown to the floor in this loop.
Add it back in and additionally add a bit more debugging to
know what is going on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4704 from mjstapp/fix_ip2str_const
Donald Sharp [Wed, 17 Jul 2019 22:59:08 +0000 (18:59 -0400)]
Merge pull request #4704 from mjstapp/fix_ip2str_const

lib: use const in ipaddr2str

5 years agolib: use const in ipaddr2str 4704/head
Mark Stapp [Wed, 17 Jul 2019 20:59:41 +0000 (16:59 -0400)]
lib: use const in ipaddr2str

Use const more

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #4680 from donaldsharp/test_longer
Mark Stapp [Wed, 17 Jul 2019 17:34:51 +0000 (13:34 -0400)]
Merge pull request #4680 from donaldsharp/test_longer

tests: Topotests are not giving sufficient time to propagate data

5 years agopbrd: Do not install nexthop group until we have nexthops 4695/head
Donald Sharp [Wed, 17 Jul 2019 00:41:01 +0000 (20:41 -0400)]
pbrd: Do not install nexthop group until we have nexthops

The creation of a nexthop group results in a callback with
just the nexthop group name.  At this point in time we
do not have any nexthop information so there is nothing to
install.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Print out client who sent us bad data
Donald Sharp [Wed, 17 Jul 2019 00:24:26 +0000 (20:24 -0400)]
zebra: Print out client who sent us bad data

A client was sending zebra a route with no nexthops!  Update the
error message to tell us *Which* daemon is doing this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Guard debug messages
Donald Sharp [Wed, 17 Jul 2019 00:17:05 +0000 (20:17 -0400)]
zebra: Guard debug messages

A bunch of debug code has snuck in that is unguarded.
Fix this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4685 from chiragshah6/ospf_vrf_dev
Russ White [Tue, 16 Jul 2019 23:50:23 +0000 (19:50 -0400)]
Merge pull request #4685 from chiragshah6/ospf_vrf_dev

ospfd: no router ospf crash fix

5 years agoMerge pull request #4669 from opensourcerouting/bfd-isis-northbound
Russ White [Tue, 16 Jul 2019 13:17:51 +0000 (09:17 -0400)]
Merge pull request #4669 from opensourcerouting/bfd-isis-northbound

isisd: migrate BFD command to northbound

5 years agoMerge pull request #4684 from donaldsharp/various_fixes
Russ White [Tue, 16 Jul 2019 13:14:30 +0000 (09:14 -0400)]
Merge pull request #4684 from donaldsharp/various_fixes

Various fixes

5 years agostaticd: Track state of where we are and limit installs/updates to min 4690/head
Donald Sharp [Tue, 16 Jul 2019 12:27:31 +0000 (08:27 -0400)]
staticd: Track state of where we are and limit installs/updates to min

Track the state of the route and how we have installed it or not.
This commit limits the number of installs/updates/deletes to a
minimum number instead of repeated sends to zebra.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agostatic: Start state tracking to know what we think the route is doing
Donald Sharp [Tue, 16 Jul 2019 12:01:17 +0000 (08:01 -0400)]
static: Start state tracking to know what we think the route is doing

We need to track the state information in staticd of what we think
the route is.  Add the enum for this state and place it into
the si.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>