]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agoisisd: clean ipv4/6 circuit config on destroy
Emanuele Di Pascale [Mon, 9 Dec 2019 17:22:25 +0000 (18:22 +0100)]
isisd: clean ipv4/6 circuit config on destroy

when deleting an isis interface config with 'no [ip|ipv6] router isis'
we are destroying the isis yang container for that interface, but the
actual circuit struct is kept, and so are the flgs determining whether
that circuit is configured for ipv4 and/or ipv6. This caused issues
when removing and re-adding configuration, as the area counters for
ip circuits were not correctly updated and the topology was never
populated.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agoMerge pull request #5498 from mjstapp/sharp_with_labels
Donald Sharp [Sat, 7 Dec 2019 16:44:02 +0000 (11:44 -0500)]
Merge pull request #5498 from mjstapp/sharp_with_labels

lib,sharpd: support labelled nexthop-groups in sharpd

4 years agoMerge pull request #5499 from sworleys/Pbr-Detail
Jafar Al-Gharaibeh [Sat, 7 Dec 2019 00:02:08 +0000 (18:02 -0600)]
Merge pull request #5499 from sworleys/Pbr-Detail

pbrd: make the show pbr map output better

4 years agoMerge pull request #5421 from sworleys/PBR-Del-Mark-All-Seq
Jafar Al-Gharaibeh [Fri, 6 Dec 2019 23:49:56 +0000 (17:49 -0600)]
Merge pull request #5421 from sworleys/PBR-Del-Mark-All-Seq

pbrd: only remove interface after all seq uninstalled

4 years agoMerge pull request #5355 from AnuradhaKaruppiah/pim-state-machine-fixes
Jafar Al-Gharaibeh [Fri, 6 Dec 2019 23:47:07 +0000 (17:47 -0600)]
Merge pull request #5355 from AnuradhaKaruppiah/pim-state-machine-fixes

PIM state machine fixes

4 years agoMerge pull request #4765 from opensourcerouting/defaults-v2
Donald Sharp [Fri, 6 Dec 2019 19:07:42 +0000 (14:07 -0500)]
Merge pull request #4765 from opensourcerouting/defaults-v2

lib/*: new config defaults system, v2

4 years agopbrd: use yes/no for pbr map validity vty output
Stephen Worley [Thu, 5 Dec 2019 22:19:20 +0000 (17:19 -0500)]
pbrd: use yes/no for pbr map validity vty output

Change the pbr map validity state to indicate yes/no
rather than 1/0 in the `show pbr map` command.

Humans aren't robots, so don't use binary.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: use spaces in show pbr map vty output
Stephen Worley [Thu, 5 Dec 2019 22:00:32 +0000 (17:00 -0500)]
pbrd: use spaces in show pbr map vty output

We were using a mix of spaces and tabsin show pbr map vty output.
Tabs can be inconsistent depending on the system settings.
Using spaces is a safer option for more consistent output.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agodoc: add show pbr map doc
Stephen Worley [Thu, 5 Dec 2019 21:26:37 +0000 (16:26 -0500)]
doc: add show pbr map doc

Add some doc for the `show pbr map [NAME] [detail]` command.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: make vty nexthop/nexthop-group output consistent
Stephen Worley [Thu, 5 Dec 2019 21:17:42 +0000 (16:17 -0500)]
pbrd: make vty nexthop/nexthop-group output consistent

The vty output for pbr maps with a nexthop-group was not
consistent with those configured with an individual nexthop.
Fix that so its easier for users to read.

alfred# show pbr map
  pbr-map TEST1 valid: 1
    Seq: 222 rule: 521
        Installed: yes Reason: Valid
        SRC Match: 2.2.2.2/32
        Nexthop-Group: blue
                Installed: yes Tableid: 10000
    Seq: 333 rule: 632
        Installed: yes Reason: Valid
        SRC Match: 3.3.3.3/32
        Nexthop-Group: blue
                Installed: yes Tableid: 10000
    Seq: 444 rule: 743
        Installed: yes Reason: Valid
        SRC Match: 4.4.4.4/32
        Nexthop-Group: blue
                Installed: yes Tableid: 10000
    Seq: 555 rule: 854
        Installed: yes Reason: Valid
        SRC Match: 5.5.5.5/32
        Nexthop-Group: red
                Installed: yes Tableid: 10001
    Seq: 666 rule: 965
        Installed: yes Reason: Valid
        SRC Match: 6.6.6.6/32
        nexthop 1.1.1.1
                Installed: yes Tableid: 10002
alfred#

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: make show pbr map detail actually work
Stephen Worley [Thu, 5 Dec 2019 20:52:08 +0000 (15:52 -0500)]
pbrd: make show pbr map detail actually work

The `detail` keyword was doing literally nothing. Changed the
default show to be a bit more user friendly and detail
to give the information you might would need for
debugging.

alfred# show pbr map
  pbr-map TEST1 valid: 1
    Seq: 222 rule: 521
    Installed: yes Reason: Valid
        SRC Match: 2.2.2.2/32
        Nexthop-Group: blue(10000) Installed: yes
    Seq: 333 rule: 632
    Installed: yes Reason: Valid
        SRC Match: 3.3.3.3/32
        Nexthop-Group: blue(10000) Installed: yes
    Seq: 444 rule: 743
    Installed: yes Reason: Valid
        SRC Match: 4.4.4.4/32
        Nexthop-Group: blue(10000) Installed: yes
    Seq: 555 rule: 854
    Installed: yes Reason: Valid
        SRC Match: 5.5.5.5/32
        Nexthop-Group: red(10001) Installed: yes
    Seq: 666 rule: 965
    Installed: yes Reason: Valid
        SRC Match: 6.6.6.6/32
     nexthop 1.1.1.1
        Installed: yes Tableid: 10002
alfred# show pbr map detail
  pbr-map TEST1 valid: 1
    Seq: 222 rule: 521
    Installed: 1(1) Reason: Valid
        SRC Match: 2.2.2.2/32
        Nexthop-Group: blue(10000) Installed: 1(1)
    Seq: 333 rule: 632
    Installed: 1(2) Reason: Valid
        SRC Match: 3.3.3.3/32
        Nexthop-Group: blue(10000) Installed: 1(1)
    Seq: 444 rule: 743
    Installed: 1(3) Reason: Valid
        SRC Match: 4.4.4.4/32
        Nexthop-Group: blue(10000) Installed: 1(1)
    Seq: 555 rule: 854
    Installed: 1(4) Reason: Valid
        SRC Match: 5.5.5.5/32
        Nexthop-Group: red(10001) Installed: 1(1)
    Seq: 666 rule: 965
    Installed: 1(5) Reason: Valid
        SRC Match: 6.6.6.6/32
     nexthop 1.1.1.1
        Installed: 1(1) Tableid: 10002
alfred#

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: refactor vty map show output into functions
Stephen Worley [Thu, 5 Dec 2019 20:32:26 +0000 (15:32 -0500)]
pbrd: refactor vty map show output into functions

Refactor the pbr_map and pbr_map_sequence vty output
into some functions to make the code a bit easier to read.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,sharpd: support labelled nexthop-groups in sharpd
Mark Stapp [Fri, 6 Dec 2019 18:44:15 +0000 (13:44 -0500)]
lib,sharpd: support labelled nexthop-groups in sharpd

Update sharpd's zapi client code to support labelled nexthops if
they're present in a nexthop-group.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5332 from mjstapp/remove_zapi_label_flag
Donald Sharp [Fri, 6 Dec 2019 18:19:34 +0000 (13:19 -0500)]
Merge pull request #5332 from mjstapp/remove_zapi_label_flag

*: revise zapi nexthop encoding

4 years agoMerge pull request #5462 from dslicenc/ipv6-ra-lifetime-0
David Lamparter [Fri, 6 Dec 2019 17:23:39 +0000 (18:23 +0100)]
Merge pull request #5462 from dslicenc/ipv6-ra-lifetime-0

zebra: send RA lifetime of 0 before ceasing to advertise RAs

4 years agoMerge pull request #5226 from donaldsharp/interface_fixup
David Lamparter [Fri, 6 Dec 2019 17:21:51 +0000 (18:21 +0100)]
Merge pull request #5226 from donaldsharp/interface_fixup

Interface fixup

4 years agoMerge pull request #5468 from qlyoung/bgpd-remove-bgp-attr-dup
David Lamparter [Fri, 6 Dec 2019 17:19:28 +0000 (18:19 +0100)]
Merge pull request #5468 from qlyoung/bgpd-remove-bgp-attr-dup

bgpd: remove bgp_attr_dup

4 years agoMerge pull request #5218 from mjstapp/fix_topo_kernel_5
David Lamparter [Fri, 6 Dec 2019 17:18:28 +0000 (18:18 +0100)]
Merge pull request #5218 from mjstapp/fix_topo_kernel_5

topotests: Adapt to linux kernel 5+

4 years ago*: revise zapi nexthop encoding
Mark Stapp [Wed, 13 Nov 2019 21:06:06 +0000 (16:06 -0500)]
*: revise zapi nexthop encoding

Use a per-nexthop flag to indicate the presence of labels; add
some utility zapi encode/decode apis for nexthops; use the zapi
apis more consistently.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agolib: use const in several stream lib apis
Mark Stapp [Fri, 15 Nov 2019 19:32:18 +0000 (14:32 -0500)]
lib: use const in several stream lib apis

Add some const to some stream apis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5438 from sworleys/PBR-Fixes
Renato Westphal [Fri, 6 Dec 2019 15:04:05 +0000 (12:04 -0300)]
Merge pull request #5438 from sworleys/PBR-Fixes

pbrd: Assorted Fixes

4 years agoMerge pull request #5439 from mjstapp/nhg_add_labels
Renato Westphal [Fri, 6 Dec 2019 14:17:10 +0000 (11:17 -0300)]
Merge pull request #5439 from mjstapp/nhg_add_labels

lib: support labelled nexthops in nexthop_groups

4 years agotopojson: use empty vtysh.conf for frr-reload.py
David Lamparter [Mon, 2 Dec 2019 22:23:16 +0000 (23:23 +0100)]
topojson: use empty vtysh.conf for frr-reload.py

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agotools/frr-reload.py: remove stderr redirects
David Lamparter [Tue, 13 Aug 2019 16:24:11 +0000 (18:24 +0200)]
tools/frr-reload.py: remove stderr redirects

These make no sense.  stderr=subprocess.STDOUT means that vtysh's stdout
and stderr are combined and returned by check_output.  We don't expect
errors in that, and we certainly don't log them.

Leaving vtysh's stderr as stderr is perfectly fine, it'll be captured
for logging just like stderr output from frr-reload.py.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agoospfd: use new defaults mechanism (v2)
David Lamparter [Thu, 1 Aug 2019 16:49:50 +0000 (18:49 +0200)]
ospfd: use new defaults mechanism (v2)

Some preprocessor constants converted to enums to make the names usable
in the preprocessor.

v2: better isolation between core and vty code to make future northbound
conversion easier.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoospfd: remove minor WTF in instance creation
David Lamparter [Thu, 1 Aug 2019 16:39:19 +0000 (18:39 +0200)]
ospfd: remove minor WTF in instance creation

Well, "obviously" this condition block is pointless, since
ospf_router_id_update is called afterwards unconditionally...

(And even if it were needed, it would need to go in ospf_get too.)

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agobgpd: use new defaults system (v2)
David Lamparter [Thu, 1 Aug 2019 16:50:56 +0000 (18:50 +0200)]
bgpd: use new defaults system (v2)

This moves all the DFLT_BGP_* stuff over to the new defaults mechanism.
bgp_timers_nondefault() added to get better file-scoping.

v2: moved everything into bgp_vty.c so that the core BGP code is
independent of the CLI-specific defaults.  This should make the future
northbound conversion easier.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agobgpd: move config-write to bgp_vty.c
David Lamparter [Thu, 1 Aug 2019 15:44:23 +0000 (17:44 +0200)]
bgpd: move config-write to bgp_vty.c

There's no good reason to have this in bgpd.c;  it's just there
historically.  Move it to bgp_vty.c where it makes more sense.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agodoc: document defaults mechanism
David Lamparter [Mon, 29 Oct 2018 19:26:53 +0000 (20:26 +0100)]
doc: document defaults mechanism

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agobuild: apply DFLT_NAME/profiles in init script
David Lamparter [Fri, 26 Oct 2018 17:33:20 +0000 (19:33 +0200)]
build: apply DFLT_NAME/profiles in init script

Hopefully at some point we can get rid of the --enable-datacenter switch
and just have the init script do magic.  Should already work for Cumulus
as it is.

NB: the profile name can't be baked into the package.  The whole point
is to make the package profile-agnostic;  in theory at some point the
exact same package files should work on both, say, a Cumulus switch and
a Linux software BGP DFZ router.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib/defaults: add bool variable support
David Lamparter [Wed, 4 Dec 2019 03:20:55 +0000 (04:20 +0100)]
lib/defaults: add bool variable support

(I hadn't initially added this because I thought it superfluous, but it
kinda makes things nicer.)

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib: new defaults logic
David Lamparter [Fri, 26 Oct 2018 16:41:00 +0000 (18:41 +0200)]
lib: new defaults logic

Since we've been writing out "frr version" and "frr defaults" for about
a year and a half now, we can now actually use them to manage defaults.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib: add frr_version_cmp()
David Lamparter [Fri, 26 Oct 2018 13:25:25 +0000 (15:25 +0200)]
lib: add frr_version_cmp()

This just compares 2 version strings.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib: rename memory_vty.c to lib_vty.c
David Lamparter [Fri, 6 Dec 2019 13:38:55 +0000 (14:38 +0100)]
lib: rename memory_vty.c to lib_vty.c

And memory_init() to lib_cmd_init().

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agotopotests: Adapt to linux kernel 5+
Mark Stapp [Wed, 23 Oct 2019 16:42:19 +0000 (12:42 -0400)]
topotests: Adapt to linux kernel 5+

Make a few changes to try to support topotests with vrfs
on kernel 5 and later.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5288 from SumitAgarwal123/bfd_docs
Rafael Zalamena [Fri, 6 Dec 2019 12:35:13 +0000 (09:35 -0300)]
Merge pull request #5288 from SumitAgarwal123/bfd_docs

doc: Adding new CLI and updating existing show output

4 years agoMerge pull request #5493 from ton31337/fix/doc_underline_too_short
Quentin Young [Fri, 6 Dec 2019 06:54:49 +0000 (01:54 -0500)]
Merge pull request #5493 from ton31337/fix/doc_underline_too_short

doc: Add moaar dashes to underline line

4 years agodoc: Add moaar dashes to underline line
Donatas Abraitis [Fri, 6 Dec 2019 06:33:30 +0000 (08:33 +0200)]
doc: Add moaar dashes to underline line

doc/user/bgp.rst:420: WARNING: Title underline too short.
Reject routes with AS_SET or AS_CONFED_SET types
-------------------------------

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5464 from qlyoung/fix-bgp-prefix-orf-heap-overflow
Donatas Abraitis [Fri, 6 Dec 2019 06:15:49 +0000 (08:15 +0200)]
Merge pull request #5464 from qlyoung/fix-bgp-prefix-orf-heap-overflow

lib: fix heap buf overflow when adding prefix orf

4 years agoMerge pull request #5478 from mjstapp/fix_ospf_apiserver_sa
Donald Sharp [Fri, 6 Dec 2019 01:56:12 +0000 (20:56 -0500)]
Merge pull request #5478 from mjstapp/fix_ospf_apiserver_sa

ospfd: clean up SA warning

4 years agoMerge pull request #5476 from qlyoung/fix-init-script-bleh
Mark Stapp [Thu, 5 Dec 2019 21:41:48 +0000 (16:41 -0500)]
Merge pull request #5476 from qlyoung/fix-init-script-bleh

tools: [ [ is not valid shell test syntax

4 years agoospfd: clean up SA warning
Mark Stapp [Thu, 5 Dec 2019 21:12:09 +0000 (16:12 -0500)]
ospfd: clean up SA warning

remove an unneeded initialization to clear up an SA report.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agotools: [ [ is not valid test syntax
Quentin Young [Thu, 5 Dec 2019 17:57:45 +0000 (12:57 -0500)]
tools: [ [ is not valid test syntax

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agobgpd: remove bgp_attr_dup
Quentin Young [Tue, 3 Dec 2019 21:01:19 +0000 (16:01 -0500)]
bgpd: remove bgp_attr_dup

yeah

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5472 from mjstapp/fix_dplane_prov_flags
Donatas Abraitis [Thu, 5 Dec 2019 12:03:35 +0000 (14:03 +0200)]
Merge pull request #5472 from mjstapp/fix_dplane_prov_flags

zebra: capture dplane plugin flags

4 years agoMerge pull request #5471 from sworleys/Doc-Sign-Off
Mark Stapp [Wed, 4 Dec 2019 19:56:58 +0000 (14:56 -0500)]
Merge pull request #5471 from sworleys/Doc-Sign-Off

doc: add doc for easy commit sign-off with `-s`

4 years agozebra: capture dplane plugin flags
Mark Stapp [Wed, 4 Dec 2019 19:54:38 +0000 (14:54 -0500)]
zebra: capture dplane plugin flags

The flags can be important - like "threaded" - so we need to
actually capture them when plugins are registered.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoeigrpd, ospfd, pimd: Fix assumption that interface may not be up
Donald Sharp [Thu, 24 Oct 2019 19:09:18 +0000 (15:09 -0400)]
eigrpd, ospfd, pimd: Fix assumption that interface may not be up

Commit: ddbf3e60604019d4b38d51226700e2244cc531b6

This commit modified the interface up handling code in
ZAPI such that the zclient handled the decoding for you.
Prior to this commit ospf assumed that it could use the
old ifp pointer to know state before reading the stream.
This lead to a situation where ospf would `smartly` track
and do the right thing in this situation.  This commit
changed this assumption and in certain scenarios, say
a interface was changed after it was already up would
lead to situations where ospf would not properly handle
the new interface up.

Modify ospf to track data that is important to it in
it's interface->info pointer.

This code pattern was followed in both eigrp and pim.
In eigrp's case it was just behaving weirdly in any event
so fixing this pattern is not a big deal.  In pim's
case it was not properly using this so it's a no-op
to fix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoospfd: interface name and ip address can be 32 bytes
Donald Sharp [Fri, 25 Oct 2019 13:06:26 +0000 (09:06 -0400)]
ospfd: interface name and ip address can be 32 bytes

We are only saving 20 bytes of string output for ospf neighbor
commands.  Fixed output:

act-7326-05# show ip ospf vrf vrf1012 neighbor all
VRF Name: vrf1012

Neighbor ID     Pri State           Dead Time Address         Interface                        RXmtL RqstL DBsmL
9.9.12.11         1 Full/DROther      39.973s 200.254.2.10    swp49s0.2:200.254.2.9                4     0     0
9.9.12.12         1 Full/DROther      39.995s 200.254.2.14    swp49s1.2:200.254.2.13               9     0     0
9.9.12.13         1 Exchange/DROthe   39.981s 200.254.2.18    swp49s2.2:200.254.2.17             157     0     0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5416 from mjstapp/re_nhe_pointer
Donald Sharp [Wed, 4 Dec 2019 19:11:04 +0000 (14:11 -0500)]
Merge pull request #5416 from mjstapp/re_nhe_pointer

lib,zebra: use shared nexthop-group in route_entry

4 years agodoc: add doc for easy commit sign-off with `-s`
Stephen Worley [Wed, 4 Dec 2019 16:27:30 +0000 (11:27 -0500)]
doc: add doc for easy commit sign-off with `-s`

Add some doc to let developers know about the `-s` flag
with `git commit`.

We were seeing some people writing the sign-off manually.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,zebra: use nhg_hash_entry pointer in route_entry
Mark Stapp [Fri, 22 Nov 2019 20:30:53 +0000 (15:30 -0500)]
lib,zebra: use nhg_hash_entry pointer in route_entry

Replace the existing list of nexthops (via a nexthop_group
struct) in the route_entry with a direct pointer to zebra's
new shared group (from zebra_nhg.h). This allows more
direct access to that shared group and the info it carries.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5352 from donaldsharp/5013_cleanup_merge_issues
Rafael Zalamena [Wed, 4 Dec 2019 12:28:41 +0000 (09:28 -0300)]
Merge pull request #5352 from donaldsharp/5013_cleanup_merge_issues

5013 cleanup merge issues

4 years agoMerge pull request #5341 from rbauduin/patch-1
Donatas Abraitis [Wed, 4 Dec 2019 11:56:42 +0000 (13:56 +0200)]
Merge pull request #5341 from rbauduin/patch-1

mention allow-outbound-policy for route reflectors

4 years agoMerge pull request #5430 from taruta811/build-docker-centos
Donatas Abraitis [Wed, 4 Dec 2019 11:42:12 +0000 (13:42 +0200)]
Merge pull request #5430 from taruta811/build-docker-centos

docker: Make docker image on CentOS 7

4 years agoMerge pull request #5305 from ton31337/feature/draft-ietf-idr-deprecate-as-set-confed-set
Donald Sharp [Wed, 4 Dec 2019 02:29:09 +0000 (21:29 -0500)]
Merge pull request #5305 from ton31337/feature/draft-ietf-idr-deprecate-as-set-confed-set

bgpd: Reject incoming and outgoing UPDATES for AS_SET and AS_CONFED_SET

4 years agobfdd: Json fields for multiplier
SumitAgarwal123 [Tue, 29 Oct 2019 05:25:34 +0000 (22:25 -0700)]
bfdd: Json fields for multiplier

Adding fields "detect-multiplier" and "remote-detect-multiplier"
for JSON to to reflect changes in "show bfd peers output"

Signed-off-by: Sayed Mohd Saquib sayed.saquib@broadcom.com
4 years agobfdd: Adding new CLI, show bfd peers brief
SumitAgarwal123 [Thu, 19 Sep 2019 07:35:17 +0000 (00:35 -0700)]
bfdd: Adding new CLI, show bfd peers brief

Added new CLI to display all BFD peer in brief format

Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
4 years agobfdd: Adding new cli, clear bfd counters
SumitAgarwal123 [Thu, 19 Sep 2019 07:20:31 +0000 (00:20 -0700)]
bfdd: Adding new cli, clear bfd counters

Adding new CLI clear bfd counters,
This CLI wil only reset Rx/Tx counters,
it will not reset session UP/DOWN and Zebra event count

Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
4 years agobfdd: Adding new fields to display show bfd peer
SumitAgarwal123 [Thu, 19 Sep 2019 07:02:17 +0000 (00:02 -0700)]
bfdd: Adding new fields to display show bfd peer

Adding 2 two new fields
1. Peer type, configured/dynamic
2. Detect multiplier

Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
4 years agopbrd: make vty `match *` code more readable
Stephen Worley [Tue, 3 Dec 2019 21:59:21 +0000 (16:59 -0500)]
pbrd: make vty `match *` code more readable

Make the vty match src|dst|mark code a bit more readable
in its conditonal logic.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: support labelled nexthops in nexthop_groups
Mark Stapp [Wed, 27 Nov 2019 18:02:23 +0000 (13:02 -0500)]
lib: support labelled nexthops in nexthop_groups

Add support for labelled nexthops in nexthop-group
vtysh configuration. Also update the PBR doc where
the cli is described.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agopbrd: consolidate rule_notify debugs into one call
Stephen Worley [Tue, 3 Dec 2019 21:25:40 +0000 (16:25 -0500)]
pbrd: consolidate rule_notify debugs into one call

Consolidate the rule_notify_owner() debugs based on type
into one call, making use of zapi_rule_notify_owner2str()
to do so.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Add zapi_rule_notify_owner2str() function
Stephen Worley [Tue, 3 Dec 2019 21:14:34 +0000 (16:14 -0500)]
lib: Add zapi_rule_notify_owner2str() function

Add a function for converting the zapi_rule_notify_owner enum
type to a string for ease of use.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: Add newlines in `set nexthop*` vty output
Stephen Worley [Mon, 25 Nov 2019 20:25:08 +0000 (15:25 -0500)]
pbrd: Add newlines in `set nexthop*` vty output

We were missing some newlines in handling vty outputs
for the `set nexthop*` commands. Add them in there.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: use dst string in match dst-ip vty description
Stephen Worley [Mon, 25 Nov 2019 20:22:35 +0000 (15:22 -0500)]
pbrd: use dst string in match dst-ip vty description

The vty description for the `set match dst-ip` command was
using "src ip" in its description. Change it to use "dst ip".

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: don't silently fail on atomic match MARK change attempts
Stephen Worley [Mon, 25 Nov 2019 20:16:35 +0000 (15:16 -0500)]
pbrd: don't silently fail on atomic match MARK change attempts

Also don't silently fail when we attempt to atomically change
a match MARK to a new one.

We would overwrite the frist one but never actually install it.

Change it to explicitly fail if a config is already present for
now.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: don't silently fail on atomic match IP change attempts
Stephen Worley [Mon, 25 Nov 2019 19:45:02 +0000 (14:45 -0500)]
pbrd: don't silently fail on atomic match IP change attempts

Currently pbrd does not support the abilitity to make atomic
changes to a config.

ex)
`match src-ip 1.1.1.1/32`
`match src-ip 1.1.1.0/24`

We would overwrite the first one but never actually install it.

In the `set nexthop commands` we explicitly fail if there is
already a `set nexthop` config present. This patch extends the
match src/dest-ip configs to do the same.

In the future we should make all these commands atomic but for
now its better to not fail silently at the very least.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: don't set rule removed on fail
Stephen Worley [Mon, 25 Nov 2019 05:45:24 +0000 (00:45 -0500)]
pbrd: don't set rule removed on fail

Don't treat a remove failure as a successful remove.

This can cause us to get out of sync with the kernel.
Pbrd makes decisions on rule handling based on its installed
state so this needs to be as close to accurate as possible.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: fix heap buf overflow when adding prefix orf
Quentin Young [Tue, 3 Dec 2019 18:12:25 +0000 (13:12 -0500)]
lib: fix heap buf overflow when adding prefix orf

Don't lose your way

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5442 from opensourcerouting/mpls-label-stacks
Russ White [Tue, 3 Dec 2019 16:25:53 +0000 (11:25 -0500)]
Merge pull request #5442 from opensourcerouting/mpls-label-stacks

zebra: support LSPs with multiple outgoing labels

4 years agobgpd: Autocomplete neighbor for clear bgp (#5434)
David Lamparter [Tue, 3 Dec 2019 16:13:21 +0000 (17:13 +0100)]
bgpd: Autocomplete neighbor for clear bgp (#5434)

bgpd: Autocomplete neighbor for clear bgp

4 years agozebra: send RA lifetime of 0 before ceasing to advertise RAs
Don Slice [Tue, 3 Dec 2019 14:02:20 +0000 (14:02 +0000)]
zebra: send RA lifetime of 0 before ceasing to advertise RAs

Problem reported by testing agency that RFC4861 section 6.2.5
states that a router should send an RA with a lifetime of 0
before ceasing to send RAs on the interface, or when the interace
is shutdown, or the router is shutdown.  This fix adds that capability.

Ticket: CM-27061
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agoMerge pull request #5192 from donaldsharp/zebra_rejection
Donatas Abraitis [Tue, 3 Dec 2019 07:29:50 +0000 (09:29 +0200)]
Merge pull request #5192 from donaldsharp/zebra_rejection

zebra: Dissallow a /32 or /128 through itself

4 years agoMerge pull request #5432 from chiragshah6/evpn_dev2
Sri Mohana Singamsetty [Tue, 3 Dec 2019 01:17:26 +0000 (17:17 -0800)]
Merge pull request #5432 from chiragshah6/evpn_dev2

bgpd: Handle possible non-selection of local route

4 years agoMerge pull request #5450 from donaldsharp/rpki_node_issues
Sri Mohana Singamsetty [Tue, 3 Dec 2019 01:15:35 +0000 (17:15 -0800)]
Merge pull request #5450 from donaldsharp/rpki_node_issues

bgpd: Prevent crash in bgp_table_range_lookup

4 years agopbrd: only remove interface after all seq uninstalled
Stephen Worley [Sat, 23 Nov 2019 18:29:38 +0000 (13:29 -0500)]
pbrd: only remove interface after all seq uninstalled

Only remove the interface from the pbr_map after we get
a callback from zapi that every sequence using that interface
has been removed.

Before, if we created a map with multiple sequences and put that on an interface,
then removed it from that interface, it would fail to mark the sequences after
the first one as uninstalled.

This was because we failed to lookup the other ones after we removed
the interface from the pbr_map.

This patch adds a conditional to only delete the interface from the pbr
map if all its sequneces using that interface have been uninstalled.

This patch extends the work done in 38e9ccde2f8edd6946d48c80967027d05e64d73f

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoMerge pull request #5444 from opensourcerouting/show-candidate-fix
Donald Sharp [Mon, 2 Dec 2019 16:26:33 +0000 (11:26 -0500)]
Merge pull request #5444 from opensourcerouting/show-candidate-fix

lib: fix display of candidate configurations

4 years agoMerge pull request #5389 from opensourcerouting/constify
Donald Sharp [Mon, 2 Dec 2019 16:26:11 +0000 (11:26 -0500)]
Merge pull request #5389 from opensourcerouting/constify

*: constify ALL the things

4 years agobgpd: Prevent crash in bgp_table_range_lookup
Donald Sharp [Mon, 2 Dec 2019 14:37:47 +0000 (09:37 -0500)]
bgpd: Prevent crash in bgp_table_range_lookup

The function bgp_table_range_lookup attempts to walk down
the table node data structures to find a list of matching
nodes.  We need to guard against the current node from
not matching and not having anything in the child nodes.
Add a bit of code to guard against this.

Traceback that lead me down this path:

Nov 24 12:22:38 frr bgpd[20257]: Received signal 11 at 1574616158 (si_addr 0x2, PC 0x46cdc3); aborting...
Nov 24 12:22:38 frr bgpd[20257]: Backtrace for 11 stack frames:
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(zlog_backtrace_sigsafe+0x67) [0x7fd1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(zlog_signal+0x113) [0x7fd1ad445db3]1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(+0x70e65) [0x7fd1ad465e65]ad445db3]1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libpthread.so.0(+0xf5f0) [0x7fd1abd605f0]45db3]1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib/frr/bgpd(bgp_table_range_lookup+0x63) [0x46cdc3]445957]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib64/frr/modules/bgpd_rpki.so(+0x4f0d) [0x7fd1a934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(thread_call+0x60) [0x7fd1ad4736e0]934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(frr_run+0x128) [0x7fd1ad443ab8]e0]934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib/frr/bgpd(main+0x2e3) [0x41c043]1ad443ab8]e0]934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7fd1ab9a5505]f0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib/frr/bgpd() [0x41d9bb]main+0xf5) [0x7fd1ab9a5505]f0d]57]
Nov 24 12:22:38 frr bgpd[20257]: in thread bgpd_sync_callback scheduled from bgpd/bgp_rpki.c:351#012; aborting...
Nov 24 12:22:38 frr watchfrr[6779]: [EC 268435457] bgpd state -> down : read returned EOF
Nov 24 12:22:38 frr zebra[5952]: [EC 4043309116] Client 'bgp' encountered an error and is shutting down.
Nov 24 12:22:38 frr zebra[5952]: zebra/zebra_ptm.c:1345 failed to find process pid registration
Nov 24 12:22:38 frr zebra[5952]: client 15 disconnected. 0 bgp routes removed from the rib

I am not really 100% sure what we are really trying to do with this function, but we must
guard against child nodes not having any data.

Fixes: #5440
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years ago*: generously apply const
David Lamparter [Wed, 20 Nov 2019 16:26:59 +0000 (17:26 +0100)]
*: generously apply const

const const const your boat, merrily down the stream...

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoMerge pull request #5446 from donaldsharp/bgp_json_mem_leak
Jafar Al-Gharaibeh [Sun, 1 Dec 2019 19:39:14 +0000 (12:39 -0700)]
Merge pull request #5446 from donaldsharp/bgp_json_mem_leak

bgpd: Fix memory leak in json output of show commands

4 years agodoc: mention allow-outbound-policy for route reflectors
rbauduin [Thu, 14 Nov 2019 07:27:14 +0000 (08:27 +0100)]
doc: mention allow-outbound-policy for route reflectors

Signed-off-by: Raphael Bauduin <rb@raphinou.com>
4 years agobgpd: Fix memory leak in json output of show commands
Donald Sharp [Sun, 1 Dec 2019 14:29:32 +0000 (09:29 -0500)]
bgpd: Fix memory leak in json output of show commands

When dumping a large bit of table data via bgp_show_table
and if there is no information to display for a particular
`struct bgp_node *` the data allocated via json_object_new_array()
is leaked.  Not a big deal on small tables but if you have a full
bgp feed and issue a show command that does not match any of
the route nodes ( say `vtysh -c "show bgp ipv4 large-community-list FOO"`)
then we will leak memory.

Before code change and issuing the above show bgp large-community-list command 15-20 times:
Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  > 2GB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  > 2GB
  Free small blocks:     31 MiB
  Free ordinary blocks:  616 KiB
  Ordinary blocks:       0
  Small blocks:          0
  Holding blocks:        0

After:

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  924 MiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  558 MiB
  Free small blocks:     26 MiB
  Free ordinary blocks:  340 MiB
  Ordinary blocks:       0
  Small blocks:          0
  Holding blocks:        0

Please note the 340mb of free ordinary blocks is from the fact I issued a
`show bgp ipv4 uni json` command and generated a large amount of data.

Fixes: #5445
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: fix display of candidate configurations
Renato Westphal [Thu, 7 Nov 2019 16:20:06 +0000 (13:20 -0300)]
lib: fix display of candidate configurations

Commit 5e6a9350c16 implemented an optimization where candidate
configurations are validated only before being displayed. The
validation is done only to create default child nodes (due to
how libyang works) and any possible error is ignored (candidate
configurations can be invalid/incomplete).

The problem is that we were calling lyd_validate() only when the
CLI "with-defaults" option was used. But some cli_show() callbacks
assume that default nodes exist and can crash when displaying a
candidate configuration that isn't validated. To fix this, call
lyd_validate() before displaying candidate configuration even when
"with-defaults" is not used (that was a micro-optimization that
shouldn't have been done).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years ago*: make frr_yang_module_info const
David Lamparter [Wed, 20 Nov 2019 16:23:04 +0000 (17:23 +0100)]
*: make frr_yang_module_info const

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years ago*: make all route_map_rule_cmd const
David Lamparter [Wed, 20 Nov 2019 16:20:58 +0000 (17:20 +0100)]
*: make all route_map_rule_cmd const

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib: make cmd_element & qobj_type const
David Lamparter [Thu, 14 Nov 2019 22:27:29 +0000 (23:27 +0100)]
lib: make cmd_element & qobj_type const

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib: gcc 4.x workaround v2 for frr_interface_info
David Lamparter [Fri, 29 Nov 2019 23:36:45 +0000 (00:36 +0100)]
lib: gcc 4.x workaround v2 for frr_interface_info

The previous workaround only works for -O0, at higher optimization
levels gcc reorders the statements in the file global scope which breaks
the asm statement :(.

Fixes: #4563
Fixes: #5074
Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agozebra: support LSPs with multiple outgoing labels
Renato Westphal [Fri, 29 Nov 2019 14:50:07 +0000 (11:50 -0300)]
zebra: support LSPs with multiple outgoing labels

For SR-TE we'll need to create Binding-SIDs which are essentially
LSPs that can push multiple outgoing labels. This commit sets the
groundwork for that. Luckily the netlink code didn't need to be
changed since it already supports pushing label stacks.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agobgpd: Autocomplete neighbor for clear bgp
Donatas Abraitis [Wed, 27 Nov 2019 19:44:46 +0000 (21:44 +0200)]
bgpd: Autocomplete neighbor for clear bgp

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5409 from qlyoung/bgpd-lcom-ecom-parse-fixes
David Lamparter [Wed, 27 Nov 2019 17:35:03 +0000 (18:35 +0100)]
Merge pull request #5409 from qlyoung/bgpd-lcom-ecom-parse-fixes

bgp large & extended community parse fixes

4 years agoMerge pull request #5435 from opensourcerouting/gcc4-vla-size
Quentin Young [Wed, 27 Nov 2019 16:25:43 +0000 (11:25 -0500)]
Merge pull request #5435 from opensourcerouting/gcc4-vla-size

lib: add gcc 4.x workaround for frr_interface_info

4 years agoMerge pull request #5437 from ton31337/fix/replace_magic_number_to_readable
Russ White [Wed, 27 Nov 2019 12:18:21 +0000 (07:18 -0500)]
Merge pull request #5437 from ton31337/fix/replace_magic_number_to_readable

bgpd: Replace magic number 1 for TTL to BGP_DEFAULT_TTL

4 years agoMerge pull request #5356 from v00lk/master
Donatas Abraitis [Wed, 27 Nov 2019 08:54:25 +0000 (10:54 +0200)]
Merge pull request #5356 from v00lk/master

bgpd: IPv4 LU withdraw using 0x000000 label

4 years agobgpd: Replace magic number 1 for TTL to BGP_DEFAULT_TTL
Donatas Abraitis [Wed, 27 Nov 2019 08:48:17 +0000 (10:48 +0200)]
bgpd: Replace magic number 1 for TTL to BGP_DEFAULT_TTL

For readability and maintainability purposes.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5419 from adharkar/frr-master-nh_connected
Donatas Abraitis [Wed, 27 Nov 2019 08:37:11 +0000 (10:37 +0200)]
Merge pull request #5419 from adharkar/frr-master-nh_connected

bgpd: Do not perform "connected" check for EVPN nexthop

4 years agoMerge pull request #5284 from sworleys/PBR-Add-NH-Table-2
Philippe Guibert [Tue, 26 Nov 2019 20:18:49 +0000 (21:18 +0100)]
Merge pull request #5284 from sworleys/PBR-Add-NH-Table-2

pbrd: Add `set vrf NAME` and `set vrf unchanged`

4 years agodocker: Make docker image on CentOS 7
Toshiki Tsuchiya [Sun, 24 Nov 2019 20:28:54 +0000 (20:28 +0000)]
docker: Make docker image on CentOS 7

- Build rpm package from source on CentOS 7
- Use multi-stage builds to reduce docker image size

Signed-off-by: Toshiki Tsuchiya <taruta0811@gmail.com>
4 years agoMerge pull request #4977 from chiragshah6/evpn_dev1
Philippe Guibert [Tue, 26 Nov 2019 16:56:59 +0000 (17:56 +0100)]
Merge pull request #4977 from chiragshah6/evpn_dev1

* evpn primary address advertisement