]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
5 years agodocs: Add notes about limited MPLS-TE support 4791/head
Mark Stapp [Tue, 6 Aug 2019 18:59:01 +0000 (14:59 -0400)]
docs: Add notes about limited MPLS-TE support

Add notes to several docs about the limits to FRR's current
MPLS-TE support, which is limited to some routing protocol
LSA/TLV support. It wasn't very clear that FRR does not offer
a complete TE/RSVP-TE solution at this time.

Also removed some stale info about configure script options.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #4790 from opensourcerouting/ctype-cast
Quentin Young [Tue, 6 Aug 2019 17:21:13 +0000 (13:21 -0400)]
Merge pull request #4790 from opensourcerouting/ctype-cast

*: fix ctype casts

5 years agodebian: add .gitignore file 4790/head
David Lamparter [Wed, 24 Jul 2019 21:42:46 +0000 (17:42 -0400)]
debian: add .gitignore file

Ignore the build results when dpkg-buildpackage was run in the source
directory.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
5 years ago*: fix ctype (isalpha & co.) casts
David Lamparter [Tue, 6 Aug 2019 14:54:52 +0000 (16:54 +0200)]
*: fix ctype (isalpha & co.) casts

The correct cast for these is (unsigned char), because "char" could be
signed and thus have some negative value.  isalpha & co. expect an int
arg that is positive, i.e. 0-255.  So we need to cast to (unsigned char)
when calling any of these.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
5 years agoall: remove logical-router functionality (#4774)
David Lamparter [Tue, 6 Aug 2019 14:45:56 +0000 (16:45 +0200)]
all: remove logical-router functionality (#4774)

all: remove logical-router functionality

5 years agoMerge pull request #4776 from pogojotz/write-config-fix
Donald Sharp [Tue, 6 Aug 2019 13:58:42 +0000 (09:58 -0400)]
Merge pull request #4776 from pogojotz/write-config-fix

Replace internal linked-list in vtysh_config with RB-tree

5 years agoMerge pull request #4733 from opensourcerouting/route-map-yang
Russ White [Tue, 6 Aug 2019 13:20:37 +0000 (09:20 -0400)]
Merge pull request #4733 from opensourcerouting/route-map-yang

yang: models for route map and filters

5 years agoMerge pull request #4742 from opensourcerouting/ospfd-default-originate
Russ White [Tue, 6 Aug 2019 12:26:54 +0000 (08:26 -0400)]
Merge pull request #4742 from opensourcerouting/ospfd-default-originate

ospfd: fix & clean up default origination

5 years agoMerge pull request #4785 from mjstapp/fix_notif_queued_flag
David Lamparter [Tue, 6 Aug 2019 09:03:48 +0000 (11:03 +0200)]
Merge pull request #4785 from mjstapp/fix_notif_queued_flag

zebra: clear route QUEUED flag in async notification handler

5 years agoMerge pull request #4777 ("Fix VRRP rarely getting stuck in Initialize")
David Lamparter [Tue, 6 Aug 2019 08:52:30 +0000 (10:52 +0200)]
Merge pull request #4777 ("Fix VRRP rarely getting stuck in Initialize")

... with a one-char typo fix.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agozebra: fix typo
David Lamparter [Tue, 6 Aug 2019 08:52:07 +0000 (10:52 +0200)]
zebra: fix typo

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobgpd: resolve memleak on show bgp vrf all ipv6 unicast summary… (#4772)
David Lamparter [Tue, 6 Aug 2019 08:49:09 +0000 (10:49 +0200)]
bgpd: resolve memleak on show bgp vrf all ipv6 unicast summary… (#4772)

bgpd: resolve memleak on show bgp vrf all ipv6 unicast summary json

5 years agoMerge pull request #4705 from ton31337/fix/set_comm-list_delete_into_config
Quentin Young [Mon, 5 Aug 2019 20:53:45 +0000 (16:53 -0400)]
Merge pull request #4705 from ton31337/fix/set_comm-list_delete_into_config

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

5 years agovrrpd: eliminate potential null deref 4777/head
Quentin Young [Mon, 5 Aug 2019 16:24:45 +0000 (16:24 +0000)]
vrrpd: eliminate potential null deref

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: clear route QUEUED flag in async notification handler 4785/head
Mark Stapp [Mon, 5 Aug 2019 14:07:26 +0000 (10:07 -0400)]
zebra: clear route QUEUED flag in async notification handler

Ensure that the route-entry QUEUED flag is cleared in the async
notification path, as it is in the normal results processing
code path.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
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 agoMerge pull request #4779 from donaldsharp/sharp_repeat_fix
Mark Stapp [Mon, 5 Aug 2019 12:40:10 +0000 (08:40 -0400)]
Merge pull request #4779 from donaldsharp/sharp_repeat_fix

sharpd: Fix repeat sub-command to work

5 years agosharpd: Fix repeat sub-command to work 4779/head
Donald Sharp [Sat, 3 Aug 2019 00:35:16 +0000 (20:35 -0400)]
sharpd: Fix repeat sub-command to work

The repeat sub-command was not properly repeating.  It was starting
the removal during the install:

2019/08/03 00:10:14.351 SHARP: Inserting 300000 routes
2019/08/03 00:13:01.556 SHARP: Installed All Items 167.204747
2019/08/03 00:13:01.556 SHARP: Removing 300000 routes
2019/08/03 00:13:03.126 SHARP: Inserting 300000 routes
2019/08/03 00:14:34.794 SHARP: Removed all Items 91.668040
2019/08/03 00:16:11.743 SHARP: Installed All Items 188.616462
2019/08/03 00:16:11.743 SHARP: Removing 300000 routes
2019/08/03 00:16:14.256 SHARP: Inserting 300000 routes

This command allows the remove to wait till the install is fully
finished and vice versa:

2019/08/03 00:22:54 SHARP: Inserting 10000 routes
2019/08/03 00:22:55 SHARP: Installed All Items 0.572028
2019/08/03 00:22:55 SHARP: Removing 10000 routes
2019/08/03 00:22:55 SHARP: Removed all Items 0.568284
2019/08/03 00:22:55 SHARP: Inserting 10000 routes
2019/08/03 00:22:56 SHARP: Installed All Items 0.567687
2019/08/03 00:22:56 SHARP: Removing 10000 routes
2019/08/03 00:22:56 SHARP: Removed all Items 0.551011

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4752 from chiragshah6/evpn_dev1
Sri Mohana Singamsetty [Fri, 2 Aug 2019 22:56:57 +0000 (15:56 -0700)]
Merge pull request #4752 from chiragshah6/evpn_dev1

zebra: del auto mac when vni is down

5 years agoMerge pull request #4775 from sworleys/Log-Double-Unlock
Mark Stapp [Fri, 2 Aug 2019 17:33:18 +0000 (13:33 -0400)]
Merge pull request #4775 from sworleys/Log-Double-Unlock

lib: Remove double log mutex unlock

5 years agovrrpd: try to bind interfaces on if_down notifications
Quentin Young [Thu, 1 Aug 2019 17:38:46 +0000 (17:38 +0000)]
vrrpd: try to bind interfaces on if_down notifications

Normally we only opportunistically try to bind interfaces to VRRP
instances upon getting if_add and if_up notifications; now that Zebra
sends if_down notifications when interfaces change while they are down,
we should try to bind when we get those as well.

This solves a bug where VRRP would not bind and activate virtual routers
to valid interfaces because their MACs were changed to VRRP macs while
the interface was down.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: send interface updates when down
Quentin Young [Thu, 1 Aug 2019 17:37:05 +0000 (17:37 +0000)]
zebra: send interface updates when down

When interfaces change while they are up, Zebra sends if_up
notifications with the updated interface info. Change Zebra to send
if_down notifications with interface info when the interface changes
while it is down.

VRRP, at the least, needs these to know about MAC changes while an
interface is down.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agovrrpd: add more dbg logs around interfaces
Quentin Young [Thu, 1 Aug 2019 17:35:09 +0000 (17:35 +0000)]
vrrpd: add more dbg logs around interfaces

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agovtysh: Replace linked-list in vtysh_config with RB-tree 4776/head
Juergen Werner [Fri, 2 Aug 2019 15:45:13 +0000 (17:45 +0200)]
vtysh: Replace linked-list in vtysh_config with RB-tree

...for faster look-ups

Fixes: 4673
Signed-off-by: Juergen Werner <juergen@opensourcerouting.org>
5 years agolib: Remove double log mutex unlock 4775/head
Stephen Worley [Fri, 2 Aug 2019 15:12:33 +0000 (11:12 -0400)]
lib: Remove double log mutex unlock

Coverity report caught this log mutex being unlocked twice.
Removing the extra one before the goto statement.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agoall: remove logical-router functionality 4774/head
Igor Ryzhov [Fri, 2 Aug 2019 14:10:11 +0000 (17:10 +0300)]
all: remove logical-router functionality

Signed-off-by: Igor Ryzhov <iryzhov@nfware.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 agoospfd: clean up default route logic 4742/head
David Lamparter [Mon, 29 Jul 2019 12:46:05 +0000 (14:46 +0200)]
ospfd: clean up default route logic

What a mess...

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoospfd: don't ASE with router-ID 0
David Lamparter [Mon, 29 Jul 2019 12:44:44 +0000 (14:44 +0200)]
ospfd: don't ASE with router-ID 0

The ASEs will be generated later by ospf_external_lsa_rid_change().

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoospfd: unset default route external_info
David Lamparter [Mon, 29 Jul 2019 10:43:46 +0000 (12:43 +0200)]
ospfd: unset default route external_info

Need to clear out the external_info for the "always" default route that
we installed in ospf_redistribute_default_set().

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoospfd: remove LSA reorigin on NSM change
David Lamparter [Mon, 29 Jul 2019 10:28:26 +0000 (12:28 +0200)]
ospfd: remove LSA reorigin on NSM change

This is a "workaround" for something broken in LSDB sync that has been
kept around since the beginning of our git history...

(It works correctly without this "workaround".)

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoospfd: re-fix default origination check
David Lamparter [Mon, 29 Jul 2019 12:44:26 +0000 (14:44 +0200)]
ospfd: re-fix default origination check

ospf->external[DEFAULT_ROUTE] and zclient->default_information don't
line up with each other; the former is only used for "originate always".

Fixes: #4237
Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoRevert "ospfd: default route got flushed after lsa refresh timer."
David Lamparter [Mon, 29 Jul 2019 12:04:06 +0000 (14:04 +0200)]
Revert "ospfd: default route got flushed after lsa refresh timer."

This reverts commit a6b4e1fdedb290e8d86f73b0d7f842f7042b26af.

This fix is wrong too.  The zclient->redist & ->mi_redist arrays are
accessed past their size for any external route that is not 0.0.0.0/0.
Also, it is incorrect to check default_information for DEFAULT_ROUTE
since that's "originate always".

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoRevert "ospfd: remove default origin max age lsa"
David Lamparter [Mon, 29 Jul 2019 10:32:32 +0000 (12:32 +0200)]
Revert "ospfd: remove default origin max age lsa"

This reverts commit 313919d6e3db67eedef77960ea4e2ba2a6018ee1.

This is not the correct way to fix this.

- touching the LSDB to explicitly remove a MaxAge LSA is always wrong
  and results in desynchronization of the entire routing domain
- the LSDB code correctly handles replacing a MaxAge LSA with a newly
  issued one
- removing the old LSA resets the sequence numbers, which may cause
  other routers to reject the new LSA as old
- the function was horribly misnamed

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoospfd: kill totally misnamed "timers"
David Lamparter [Mon, 29 Jul 2019 10:27:25 +0000 (12:27 +0200)]
ospfd: kill totally misnamed "timers"

Neither ospf_external_lsa_originate_timer() nor
ospf_default_originate_timer() are actually timers.  They're only
executed on router-ID changes to refresh a particular LSA type.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoospfd: remove t_external_lsa
David Lamparter [Mon, 29 Jul 2019 10:26:23 +0000 (12:26 +0200)]
ospfd: remove t_external_lsa

It's unused...

Signed-off-by: David Lamparter <equinox@diac24.net>
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 agoyang: simplify filter choice by removing cases 4733/head
Rafael Zalamena [Thu, 1 Aug 2019 22:56:46 +0000 (19:56 -0300)]
yang: simplify filter choice by removing cases

Based on @rwestphal feedback, lets remove `case`s where we don't expect
to add more items or items with more than one `leaf`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoyang: use filter types in route-map
Rafael Zalamena [Thu, 25 Jul 2019 20:01:07 +0000 (17:01 -0300)]
yang: use filter types in route-map

Import the new YANG model filter and use its types.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoyang: initial filter YANG model import
Rafael Zalamena [Fri, 5 Jul 2019 14:07:30 +0000 (11:07 -0300)]
yang: initial filter YANG model import

This model contains the description of access-list, prefix-list and
other lists used by route map and other filtering interfaces.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoyang: initial route-map YANG model import
Rafael Zalamena [Tue, 2 Jul 2019 15:13:44 +0000 (12:13 -0300)]
yang: initial route-map YANG model import

New model based on FRR's CLI and data structures.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
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 agozebra: del auto mac when vni is down 4752/head
Chirag Shah [Fri, 26 Jul 2019 21:57:59 +0000 (14:57 -0700)]
zebra: del auto mac when vni is down

Delete an auto MAC with no neighbor associated,
when its VNI is down.

In Following sequence stale MAC entry retained in
FRR (zebra).
- Local MAC-IP pair
- MAC is deleted in bridge fdb table
- VNI is down, triggers IP (neigh) entries removed
from FRR DB.
- MAC retained as AUTO MAC with neigh list count 0.
- When VNI is UP again, stale MAC entry retained in FRR
DB.
When the MAC-IP pair moves behind remote VTEP, local VTEP
fails to add remote entry as its MAC is in auto state.

Ticket:CM-25504
Reviewed By:
Testing Done:

Validated the sequence with fix and auto MAC is deleted
when VNI is down.
When VNI comes up, the remote MAC-IP is added to FRR (Zebra)
and kernel.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agozebra: add info evpn to debugs
Chirag Shah [Thu, 4 Jul 2019 00:03:15 +0000 (17:03 -0700)]
zebra: add info evpn to debugs

Add info info in local mac del debug,
the local sequence and assoicated neigh count.

remote_mac_ip_add modify debug to display
flags value to cover local, remote and auto flags
for the MAC.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
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>