summaryrefslogtreecommitdiffstats
path: root/m4 (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-12-06pbrd: make vty nexthop/nexthop-group output consistentStephen Worley1-16/+15
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>
2019-12-06pbrd: make show pbr map detail actually workStephen Worley1-13/+38
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>
2019-12-06pbrd: refactor vty map show output into functionsStephen Worley1-57/+56
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>
2019-12-06*: revise zapi nexthop encodingMark Stapp7-181/+210
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>
2019-12-06lib: use const in several stream lib apisMark Stapp2-10/+15
Add some const to some stream apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06topotests: Adapt to linux kernel 5+Mark Stapp2-2/+27
Make a few changes to try to support topotests with vrfs on kernel 5 and later. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06doc: Add moaar dashes to underline lineDonatas Abraitis1-1/+1
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>
2019-12-05ospfd: clean up SA warningMark Stapp1-1/+1
remove an unneeded initialization to clear up an SA report. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-05tools: [ [ is not valid test syntaxQuentin Young1-1/+1
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-05bgpd: remove bgp_attr_dupQuentin Young10-34/+29
yeah Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-04zebra: capture dplane plugin flagsMark Stapp1-0/+1
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>
2019-12-04eigrpd, ospfd, pimd: Fix assumption that interface may not be upDonald Sharp5-66/+67
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>
2019-12-04ospfd: interface name and ip address can be 32 bytesDonald Sharp1-3/+3
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>
2019-12-04doc: add doc for easy commit sign-off with `-s`Stephen Worley1-0/+5
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>
2019-12-04lib,zebra: use nhg_hash_entry pointer in route_entryMark Stapp21-303/+196
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>
2019-12-04bfdd: Json fields for multiplierSumitAgarwal1231-7/+14
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
2019-12-04bfdd: Adding new CLI, show bfd peers briefSumitAgarwal1233-1/+98
Added new CLI to display all BFD peer in brief format Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
2019-12-04bfdd: Adding new cli, clear bfd countersSumitAgarwal1231-0/+40
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>
2019-12-04bfdd: Adding new fields to display show bfd peerSumitAgarwal1231-0/+6
Adding 2 two new fields 1. Peer type, configured/dynamic 2. Detect multiplier Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
2019-12-03pbrd: make vty `match *` code more readableStephen Worley1-17/+22
Make the vty match src|dst|mark code a bit more readable in its conditonal logic. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-12-03lib: support labelled nexthops in nexthop_groupsMark Stapp3-26/+115
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>
2019-12-03pbrd: consolidate rule_notify debugs into one callStephen Worley1-10/+3
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>
2019-12-03lib: Add zapi_rule_notify_owner2str() functionStephen Worley1-0/+23
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>
2019-12-03pbrd: Add newlines in `set nexthop*` vty outputStephen Worley1-4/+4
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>
2019-12-03pbrd: use dst string in match dst-ip vty descriptionStephen Worley1-1/+1
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>
2019-12-03pbrd: don't silently fail on atomic match MARK change attemptsStephen Worley1-2/+7
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>
2019-12-03pbrd: don't silently fail on atomic match IP change attemptsStephen Worley1-6/+12
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>
2019-12-03pbrd: don't set rule removed on failStephen Worley1-0/+5
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>
2019-12-03lib: fix heap buf overflow when adding prefix orfQuentin Young1-0/+2
Don't lose your way Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-03zebra: send RA lifetime of 0 before ceasing to advertise RAsDon Slice4-5/+50
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>
2019-12-02bgpd: Prevent crash in bgp_table_range_lookupDonald Sharp1-2/+9
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>
2019-12-02*: generously apply constDavid Lamparter64-174/+194
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-01doc: mention allow-outbound-policy for route reflectorsrbauduin1-0/+3
Signed-off-by: Raphael Bauduin <rb@raphinou.com>
2019-12-01bgpd: Fix memory leak in json output of show commandsDonald Sharp1-1/+2
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>
2019-11-30lib: fix display of candidate configurationsRenato Westphal1-5/+5
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>
2019-11-30*: make frr_yang_module_info constDavid Lamparter21-21/+23
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30*: make all route_map_rule_cmd constDavid Lamparter11-342/+667
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30lib: make cmd_element & qobj_type constDavid Lamparter6-26/+26
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30lib: gcc 4.x workaround v2 for frr_interface_infoDavid Lamparter1-10/+25
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>
2019-11-29zebra: support LSPs with multiple outgoing labelsRenato Westphal5-35/+68
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>
2019-11-27bgpd: Autocomplete neighbor for clear bgpDonatas Abraitis1-2/+2
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-27bgpd: Replace magic number 1 for TTL to BGP_DEFAULT_TTLDonatas Abraitis5-15/+19
For readability and maintainability purposes. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-26docker: Make docker image on CentOS 7Toshiki Tsuchiya4-0/+87
- 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>
2019-11-26lib: add gcc 4.x workaround for frr_interface_infoDavid Lamparter1-0/+10
gcc 4.x does not properly support structs with variable length array members. Specifically, for global variables, it completely ignores the array, coming up with a size much smaller than what is correct. This is broken for both sizeof() as well as ELF object size. This breaks for frr_interface_info since this variable is in some cases copy relocated by the linker. (The linker does this to make the address of the variable a "constant" for the main program.) This copying uses the ELF object size, thereby copying only the non-array part of the struct. Breakage ensues... (This fix is a bit ugly, but it's limited to very old gcc, and it's better than changing the array to "nodes[1000]" and wasting memory...) Fixes: #4563 Fixes: #5074 Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-26bgpd: Handle possible non-selection of local routeChirag Shah1-19/+41
In rare situations, the local route in a VNI may not get selected as the best route. One situation is during a race between bgp and zebra which was addressed in a prior commit. This change addresses another situation where due to a change of tunnel IP, it is possible that a received route may be selected as the best route if the path selection needs to take next hop IPs into consideration. This is a pretty convoluted scenario, but the code should handle it and delete and withdraw the local route as well as (re)install the received route. Ticket: CM-24114 Reviewed By: CCR-9487 Testing Done: 1. Manual tests - note, problem is not readily reproducible 2. evpn-smoke - results documented in the ticket Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-24bgpd: fix bad bounds check for addpath in nlriQuentin Young1-1/+1
If a peer advertised capability addpath in their OPEN, but sent us an UPDATE without an ADDPATH, we overflow a heap buffer. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-11-23zebra: Fix `show ip nexthop route-map` and `show ip protocol`Donald Sharp1-12/+12
These commands were not properly lining up in their columns. Fix this. After: VRF: default Protocol : route-map ------------------------------------- bgp : NO_INSTALL vnc-direct : none vnc-rn : none bgp-direct : none bgp-direct-to-nve-groups : none Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-23zebra: Fix `show zebra client` display to handle columns rightDonald Sharp1-1/+1
Before: Type Add Update Del ================================================== IPv4 11539033 272 10751107 IPv6 1122106 43 1047081 After: Type Add Update Del ================================================== IPv4 10517740 64 9729917 IPv6 1016590 8 941567 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-23zebra: Adjust column display of `show zebra client summ` for openfabricDonald Sharp1-2/+2
The openfabric daemon has a longer name than anticipated for `show zebra client summary` adjust to allow it to fit without making columns all blomped. Before: robot# show zebra client summ Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes -------------------------------------------------------------------------------- static 00:00:06 00:00:06 00:00:06 4/0 0/0 openfabric 00:00:06 00:00:06 00:00:06 0/0 0/0 After: [sharpd@robot frr4]$ vtysh -c "show zebra client summ" Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes -------------------------------------------------------------------------------- static 00:02:16 00:02:16 00:02:16 4/0 0/0 openfabric 00:02:16 00:02:16 00:02:16 0/0 0/0 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-23bgpd: Do not perform "connected" check for EVPN nexthopAmeya Dharkar1-2/+4
This changeset follows the PR https://github.com/FRRouting/frr/pull/5334 Above PR adds nexthop tracking support for EVPN RT-5 nexthops. This route is marked VALID only if the BGP route has a valid nexthop. If the EVPN peer is an EBGP pee and "disable_connected_check" flag is not set, "connected" check is performed for the EVPN nexthop. But, usually EVPN nexthop is not the BGP peering address, but the VTEP address. Also, NEXTHOP_UNCHANGED flag is enabled by default for EVPN. As a result, in a common deployment for EVPN, EVPN nexthop is not connected. Thus, adding a fix to remove the "connected" check for EVPN nexthops. Signed-off-by: Ameya Dharkar <adharkar@vmware.com>