Commit Graph

918 Commits

Author SHA1 Message Date
Donald Sharp
b77004d632 bgpd: Fix crash in various 'show bgp neighbor json' commands
bgp would crash with various `show bgp neighbor json` commands
based upon whether or not it did a pretty print of the output
or not.  This is because we were freeing the data 2 times.
Cleanup so that we free the json data 1 time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-25 20:28:23 -05:00
Anuradha Karuppiah
ec0ab5443f bgpd: reinstate current bgp best route on an inactive neigh del
When an inactive-neigh delete is rxed bgp will not have a local path to
remove (and re-run path selection). Instead it simply re-installs the
current best remote path if any.

Ticket: CM-23018
Testing Done: evpn-min

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-01-25 14:19:26 -05:00
Don Slice
faa16034cb bgpd: improve peer-group remote-as definitions
Problem reported that with certain sequences of defining the
remote-as on the peer-group and the members, the configuration would
become wrong, with configured remote-as settings not reflected in
the config but peers unable to come up.  This fix resolves these
inconsistencies.

Ticket: CM-19560
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-01-23 12:23:47 +00:00
Lou Berger
07f451afef
Merge pull request #3532 from donaldsharp/community_list_speedup
bgp Community list speedup
2019-01-15 10:05:20 -05:00
Renato Westphal
1c4213d862
Merge pull request #3198 from donaldsharp/mac_rejection
Mac rejection
2019-01-10 11:21:18 -02:00
Donald Sharp
e237b0d211 bgpd: Further refine hash lookup to store hash value
Further refine the previous commit to store the hash value in
both the `struct community_list` as well as the `struct rmap_community`
structures.  This allows us to know a priori what our hash value
is.  This change cuts another couple of seconds of convergence
off to ~55 seconds and further reduces cpu load of bgp:

   16      40061.706    433732       92    330102      129   1242965 RWTEX TOTAL

Down from ~43 seconds previously.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-08 20:24:13 -05:00
Quentin Young
01cbfd0484 bgpd: fix json double free when showing neighbors
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-12-17 22:18:13 +00:00
Donald Sharp
48ecf8f510 bgpd: Add code to dump the forthcoming mac hash
Add a bit of code that allows us to dump the mac hash.  Future
commits will actually add entries to the mac hash and then operate
on it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-12 16:11:45 -05:00
Donald Sharp
fd5e7b705e bgpd: Allow soft clear of l2vpn evpn afi/safi
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-12 16:10:30 -05:00
Philippe Guibert
616c6ee8bd bgpd: add neighbor l2vpn evpn software discovery inbound command
this command permits configuring adj-rib-in for l2vpn evpn entries.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-12-12 16:10:30 -05:00
Lou Berger
9bdb632c68
Merge pull request #3093 from donaldsharp/bgp_node_continued
Bgp node continued
2018-12-11 11:13:25 -05:00
David Lamparter
54f29523d9 bgpd: re-add spelling error in JSON output
I bulk-fixed "recieved" as a misspelling in 0437e10... but didn't notice
there was a JSON value among these.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-12-07 20:06:53 +01:00
David Lamparter
1061bb9a4f
Merge pull request #3357 from ton31337/fix/optional_args_for_extcommunity-lists
bgpd: Remove extcommunity-list by name without typing full rule
2018-12-04 15:34:59 +01:00
Russ White
eda41b4c21
Merge pull request #3325 from adeg/bugfix/bgpd-vtysh-fixes
bgp_vty: Fix vpn_leak_postchange_all() every time "router bgp ASNUM" context is entered
2018-11-25 22:39:47 -05:00
Donatas Abraitis
d4455c8975 bgpd: Remove extcommunity-list by name without typing full rule
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2018-11-19 13:12:23 +02:00
Donald Sharp
67009e2200 bgpd: Abstract bgp_table retrieving/setting from info pointer
Convert the set/get of bgp_table's from the info pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-11-16 09:43:35 -05:00
Anton Degtyarev
3702f84d9f bgpd: add missing endline
Missing endline was resulting in garbled output in vtysh in some cases, for example, when there were no peers configured and the user has issued "bgp disable-ebgp-connected-route-check" command.

Signed-off-by: Anton Degtyarev <anton@cumulusnetworks.com>
2018-11-14 03:57:46 +03:00
Anton Degtyarev
ecec94950f bgpd: Fix bgpd doing vpn_leak_postchange_all() every time "router bgp ASNUM" command is entered in vtysh
In rare cases when the default BGP instance is instantiated after VRF bgp instances (see comment to bgp_mplsvpn.c:vpn_leak_postchange_all() for an example), the "router bgp" command needs to call vpn_leak_postchange_all() to start the route leaking process. The issue was it was never checked if the "router bgp" command was used to create the default BGP instance or just to enter into "router bgp" command context. This resulted in vpn_leak_postchange_all() executed every time (and vpn routes re-announced to all peers) when the user was entering "router bgp" command context.

Signed-off-by: Anton Degtyarev <anton@cumulusnetworks.com>
2018-11-14 03:54:56 +03:00
Mitch Skiba
dcc68b5e2a bgpd: Re-use TX Addpath IDs where possible
The motivation for this patch is to address a concerning behavior of
tx-addpath-bestpath-per-AS. Prior to this patch, all paths' TX ID was
pre-determined as the path was received from a peer. However, this meant
that any time the path selected as best from an AS changed, bgpd had no
choice but to withdraw the previous best path, and advertise the new
best-path under a new TX ID. This could cause significant network
disruption, especially for the subset of prefixes coming from only one
AS that were also communicated over a bestpath-per-AS session.

The patch's general approach is best illustrated by
txaddpath_update_ids. After a bestpath run (required for best-per-AS to
know what will and will not be sent as addpaths) ID numbers will be
stripped from paths that no longer need to be sent, and held in a pool.
Then, paths that will be sent as addpaths and do not already have ID
numbers will allocate new ID numbers, pulling first from that pool.
Finally, anything left in the pool will be returned to the allocator.

In order for this to work, ID numbers had to be split by strategy. The
tx-addpath-All strategy would keep every ID number "in use" constantly,
preventing IDs from being transferred to different paths. Rather than
create two variables for ID, this patch create a more generic array that
will easily enable more addpath strategies to be implemented. The
previously described ID manipulations will happen per addpath strategy,
and will only be run for strategies that are enabled on at least one
peer.

Finally, the ID numbers are allocated from an allocator that tracks per
AFI/SAFI/Addpath Strategy which IDs are in use. Though it would be very
improbable, there was the possibility with the free-running counter
approach for rollover to cause two paths on the same prefix to get
assigned the same TX ID. As remote as the possibility is, we prefer to
not leave it to chance.

This ID re-use method is not perfect. In some cases you could still get
withdraw-then-add behaviors where not strictly necessary. In the case of
bestpath-per-AS this requires one AS to advertise a prefix for the first
time, then a second AS withdraws that prefix, all within the space of an
already pending MRAI timer. In those situations a withdraw-then-add is
more forgivable, and fixing it would probably require a much more
significant effort, as IDs would need to be moved to ADVs instead of
paths.

Signed-off-by Mitchell Skiba <mskiba@amazon.com>
2018-11-10 00:16:36 +00:00
Russ White
2379dbecbd
Merge pull request #3202 from donaldsharp/evpn_dump
Evpn dump
2018-11-08 18:13:27 -05:00
Rafael Zalamena
591328ffc6
Merge pull request #3205 from donaldsharp/default
bgpd: make name of default vrf/bgp instance consistent
2018-11-07 18:48:21 -02:00
Renato Westphal
8dfa7e4680
Merge pull request #3162 from pguibert6WIND/vpn_route_map_issue
bgpd: vpn route-map config should be kept, except if vrf list is on
2018-11-03 15:20:20 -03:00
adharkar
2531163802
Merge branch 'master' into frr-bgp_cli 2018-10-31 15:54:43 -07:00
Donald Sharp
093e3f23f6 bgpd, lib, vtysh, zebra: Convert to using CMD_VNI_RANGE
For the vni range use a macro to keep track of it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-31 06:23:32 -04:00
Anuradha Karuppiah
8029b21687 bgpd: hidden commands to add/del a local mac
local mac add/del comes from zebra. the hidden commands help verify
various race conditions between bgp and zebra.

Ticket: CM-22687
Reviewed By: CCR-7939

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2018-10-31 06:23:32 -04:00
Don Slice
5742e42b98 bgpd: make name of default vrf/bgp instance consistent
Problems were reported with the name of the default vrf and the
default bgp instance being different, creating confusion.  This
fix changes both to "default" for consistency.

Ticket: CM-21791
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: CCR-7658
Testing: manual testing and automated tests before pushing
2018-10-31 06:20:37 -04:00
Quentin Young
3c4b8fe21f bgpd: fix small error in community-list patch
Couldn't delete an expanded community-list by name alone

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-10-29 14:08:45 +00:00
Donatas Abraitis
174b5cb932 bgpd: Remove community-list by name without typing full rule
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2018-11-15 22:58:49 +02:00
David Lamparter
0437e10517 *: spelchek
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-25 20:10:57 +02:00
David Lamparter
0abf76d519
Merge pull request #3204 from ton31337/fix/make_vrf_import_default_selectable
bgpd: Select default routing table when importing VRF routes into global
2018-10-23 18:34:15 +02:00
Donatas Abraitis
4d1b335c74 bgpd: Select default routing table when importing VRF routes into global
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2018-10-23 18:00:02 +03:00
Renato Westphal
e2f68d82e9
Merge pull request #3191 from donaldsharp/more_vty
bgpd: Add a better breadcrumb for interface based peers
2018-10-18 11:54:58 -03:00
Don Slice
43d3f4fcd3 bgpd: add command to display update groups for l2vpn evpn
For troubleshooting purposes, it's useful to display the update-groups
for l2vpn evpn

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-10-17 18:50:09 +00:00
Lakshman Krishnamoorthy
a6627c993e bgpd: Route Server support for evpn address-family
Signed-off-by: Lakshman Krishnamoorthy lkrishnamoor@vmware.com
2018-10-16 17:44:57 -07:00
Donald Sharp
d762bcc370 bgpd: Add a better breadcrumb for interface based peers
If you are using bgp unnumbered( or interface based peers )
when we detect an error give the user a bit more of a clue
what they may have done wrong.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-16 17:44:12 -04:00
Russ White
79e8a97c1a
Merge pull request #3024 from ton31337/fix/validate_route-map
bgpd: Check if route-map really exists before applying to the peer
2018-10-14 08:48:48 -04:00
Russ White
97dc689417
Merge pull request #3142 from donaldsharp/bgp_peerhash
Bgp peerhash
2018-10-12 16:55:50 -04:00
Ameya Dharkar
37d4e0dfab bgpd: BGP JSON new fields
1. "show bgp ipv4 json"
  - Added "network" field which displays a prefix in 'prefix/prefixlen' format.

2. "show bgp ipv6 json"
  - Added "network" field which displays a prefix in 'prefix/prefixlen' format.
  - JSON does not have "prefix", "prefixLen" fields which are present in IPv4
    command. Added these fields as they are useful.

3. "show bgp ipv4/ipv6 neighbor <neighbor_addr> advertised-routes json"
  - Added "network" field.

4. "show bgp ipv4/ipv6 summary json"
  - Added "pfxSnt" for peers. This count is obtained from corresponding
    update_subgroup.

5. "show bgp neighbor json"
  - Added "sentPrefixCounter"

Signed-off-by: Ameya Dharkar <adharkar@vmware.org>
2018-10-11 15:35:21 -07:00
Donatas Abraitis
1de2762153 bgpd: Check if route-map really exists before applying to the peer
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2018-10-11 10:56:12 +03:00
Philippe Guibert
8a066a70c3 bgpd: vpn route-map config should be kept, except if vrf list is on
When executing vpn route-map config for importation, the running-config
records vrf import route-map instead. Actually, this is a problem when
restarting configuring when using vpn route-map. The choice is done to
move to vrf format, when at least one import list is created for vrfs.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-10-11 08:42:18 +02:00
Donald Sharp
4b7e606625 bgpd: Convert struct bgp_info to struct bgp_path_info
Do a straight conversion of `struct bgp_info` to `struct bgp_path_info`.
This commit will setup the rename of variables as well.

This is being done because `struct bgp_info` is not descriptive
of what this data actually is.  It is path information for routes
that we keep to build the actual routes nexthops plus some extra
information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:14:25 -04:00
Donald Sharp
cc4d4ce822 bgpd: Cleanup peer->su handling
Cleanup calls where we were passing in the su for
peer creation a tiny bit.

Creating a peer from the cli will always have a conf_if *or*
a su but not both. While a doppelganger will have both.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-07 20:55:52 -04:00
Ameya Dharkar
50e05855f0 bgpd: BGP JSON show commands enhancements
1. "show bgp ipv4 json"
  - Corresponding CLI has "network" field which displays a prefix in
    'prefix/prefixlen' format. Added this "network" field to JSON as well.
  - Following fields have different names in JSON and CLI.
      CLI      JSON
      metric   med
      locPrf   localPref
      path     aspath

    Added fields "metric", "locPrf" and "path" in JSON for CLI/JSON
    consistency. Older JSON fields med, localPref, aspath will be
    deprecated in future.

2. "show bgp ipv6 json"
  - Similar changes as "show bgp ipv4 json"
  - JSON does not have "prefix", "prefixLen" fields which are present in IPv4
  command. Added these fields as they are useful.

3. "show bgp ipv4/ipv6 neighbor <neighbor_addr> advertised-routes json"
  - Added "network" field.
  - Added locPrf, path fields for CLI/JSON consistency. localPref, aspath will
  be deprecated in future.

4. "show bgp ipv4/ipv6 summary json"
  - Added "pfxRcd" for CLI/JSON consistency.
    "prefixReceivedCount" will be deprecated in future.
  - Added "pfxSnt" for peers. This count is obtalned from corresponding
    update_subgroup. This needed a fix in the code where we copy fields
    for a split update_subgroup from the parent update_subgrp.
    New subgrp should inherit subgrp->scount(Count of advertized prefixes)
    of the parent subgrp.

5. "show bgp neighbor json"
  - Added "sentPrefixCounter"

6. "show bgp ipv4/ipv6 <prefix> json"
  - Added "metric" field for CLI/JSON consistency.
    "med" will be deprecated in future.

Signed-off-by: Ameya Dharkar <adharkar@vmware.org>
2018-10-05 15:06:17 -07:00
Sarita Patra
7336e10117 bgpd: remove ip prefix from as-path, <large,ext>community-list
The existing commands "ip as-path", "ip community list", "ip extcommunity
list" & "ip largecommunity list" is used to configure both for ipv4 and
ipv6. So the prefix "ip" is removed from these commands.
All the configuration, show related configuration, show running config
& boot up with write memory is also verified with the provided fix.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2018-10-04 21:50:44 -07:00
Donald Sharp
af97a18b10 bgpd: Make struct bgp_addr a private data structure
The `struct bgp_addr` is not needed for anything other than
the address hash.  Isolate this data structure so that it
is not polluting up the name space.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-21 15:51:58 -04:00
David Lamparter
2fa3198399
Merge pull request #3023 from qlyoung/ultimate-warning-reference-cards-rename
warning reference cards rename
2018-09-14 17:35:58 +02:00
Quentin Young
e50f7cfdbd bgpd: BGP_[WARN|ERR] -> EC_BGP
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 18:51:04 +00:00
F. Aragon
7fe96307ee
bgpd lib ospf6d pbrd tests zebra: shadowing fixes
This fixes all remaining local variable shadowing cases

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-13 17:37:08 +02:00
David Lamparter
1fbd4e382a
Merge pull request #2945 from dslicenc/bgp-ospf-json
bgpd/ospfd: make bgp and ospf json response a bit more consistent
2018-09-01 05:05:30 +02:00
Don Slice
ca61fd2587 bgpd: convert from conditional operator to if-then for json changes
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-31 17:11:23 +00:00
Don Slice
985d248279 bgpd: change conditional operators for bgp/ospf json changes
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-31 12:50:02 +00:00
Don Slice
94d4c685c5 bgpd/ospfd: resolve warnings for bgp/ospf json commit
Signed-off-by: Don Slice <dslice@cumulusnetwork.com>
2018-08-30 15:54:46 +00:00
Don Slice
9f049418bc bgpd/ospfd: make bgp and ospf json response a bit more consistent
Problem reported that some bgp and ospf json commands did not return
any json output at all if the bgp/ospf instance did not exist.
Additionally, some bgp and ospf json commands did not return any json
output if the instance existed but no neighbors were defined.  This
fix makes these commands more consistent in returning empty braces for
json output and issue a message if not using json output.  Additionally,
made the flag "use_json" a bool to make it consistent since previously,
it had been defined as an int, char, u_char, and bool at various places.

Ticket: CM-21040
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-30 12:40:18 +00:00
Philippe Guibert
9a8bdf1c25 bgpd: handle vrf aliases in vty API
Because a VRF name can be used for default VRF, or an alias of an
already created VRF can be passed as parameter, the default VRF name
must be found out. This avoids creating double BGP instances for
example.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-28 16:23:50 +02:00
Donald Sharp
ec4f07507b bgpd: Fix CONFDATE to 2019 for a couple of items.
While perusing CONFDATE I noticed that we had a couple
CONFDATE 201805, which we were not picking up( for other
reasons and fixed in a different PR ).  But upon investigation
of these I noticed that the commits where in 201805, so these
CONFDATES should be in 2019

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-24 15:21:04 -04:00
Donald Sharp
529089b58e
Merge pull request #2804 from kssoman/bgp_fix
When redistribute options are changed, call bgp_redistribute_unreg()
2018-08-24 07:46:22 -04:00
kssoman
e923dd62ef bgpd : Change of options in redistribute command does not get applied
* Added parameter in bgp_redistribute_set() to indicate change
  in redistribute option
* If there is change, call bgp_redistribute_unreg() to withdraw routes

Signed-off-by: kssoman <somanks@vmware.com>
2018-08-22 05:00:15 -07:00
Don Slice
6ce24e5247 bgpd: fix additional issue with bgp route-leak json commit
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-20 21:05:57 +00:00
Don Slice
04c9077f81 bgpd: fix issues with bgp route-leak json commit
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-20 19:36:11 +00:00
Don Slice
b46dfd2022 bgpd: add json output to bgp route-leak show command
Ticket: CM-20259
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-18 11:43:08 +00:00
Russ White
91a4566c1c
Merge pull request #2852 from donaldsharp/bgp_clean
Bgp clean
2018-08-16 11:30:03 -04:00
Donald Sharp
b7cd3069c0 bgpd: Modify warn to info for deprecated commands
Modify zlog_warn to zlog_info commands for notification of
deprecated commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-16 08:24:09 -04:00
Quentin Young
af4c27286d *: rename zlog_fer -> flog_err
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Don Slice
14454c9fdd bgpd: implement zlog_ferr facility for enhance error messages in bgp
Signed-off-by: Don Slice <dslice@cumulusnetworks.com<
2018-08-14 20:02:05 +00:00
Russ White
9e03825743
Merge pull request #2800 from adharkar/frr-bgp_cli
bgpd: Added local router-id to "show bgp neighbor"
2018-08-08 06:37:51 -04:00
Ameya Dharkar
0e38aeb41e bgpd: Added local router-id to "show bgp neighbor"
Signed-off-by: Ameya Dharkar adharkar@vmware.com
2018-08-07 15:25:47 -07:00
Dongling Duan
b4e9dcba1e bgpd: Fix show ip bgp summary json command for dynamicPeers
The dn_count for dynamic Peers was not being updated when
using json output.

Signed-off-by: Dongling Duan <dlduan@amazon.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-31 19:02:55 -04:00
Chirag Shah
81cf0de50e bgpd: Add evpn prefix to debug bgp updates prefix
Adding EVPN prefix of Type 2, 3 and 5 routes to bgp updates
prefix filters.

Ticket:CM-14476
Testing Done:

Configure multiple evpn options under 'debug bgp updates prefix'.
Below is the running-config output.

MAC-IP route with just MAC:
debug bgp updates prefix l2vpn evpn type macip mac
00:02:00:0a:0a:0a
MAC-IP route with MAC and IP:
debug bgp updates prefix l2vpn evpn type macip mac
00:02:00:00:00:0c ip 45.0.1.9
MAC-IP route with just MAC and IPv6:
debug bgp updates prefix l2vpn evpn type
macip mac 00:02:00:00:00:0a ip 2001:fee1:0:1::8
Type-3:
debug bgp updates prefix l2vpn evpn type multicast ip 27.0.1.19
Type-5:
debug bgp updates prefix l2vpn evpn type prefix
ip 2060:1:1:1::/64

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-07-24 06:45:40 -07:00
Donald Sharp
c4aee4fe31
Merge pull request #2652 from LabNConsulting/working/master/confdate_cleanup
Simplify deprecation check
2018-07-23 08:46:26 -04:00
Ameya Dharkar
d0086e8e39 bgpd: Changes to BGP show json commands
Added localRouterID to "show bgp neighbor json"
Added json O/P to "show bgp [AFI] community <community>"

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2018-07-19 13:46:46 -07:00
Russ White
96257ced27
Merge pull request #2591 from LabNConsulting/working/master/bgp-delayed-default-instance
bgpd: fix NULL dereference in vrf-vpn leak config if before default instance
2018-07-10 16:46:00 -04:00
Lou Berger
bee57a7a07 bgpd: remove VERSION_TYPE_DEV from CONFDATE checks
Signed-off-by: Lou Berger <lberger@labn.net>
2018-07-10 16:20:09 -04:00
Pascal Mathis
3f54c705ec
bgpd: Cleanup of bgp daemon code
This commit removes various parts of the bgpd implementation code which
are unused/useless, e.g. unused functions, unused variable
initializations, unused structs, ...

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-07-07 22:51:13 +02:00
G. Paul Ziemba
3bd70bf8f3 bgpd: fix NULL dereference in vrf-vpn leak config if before default instance
Issue 2473

VRF-VPN route-leaking configuration commands assumed existence of
default bgp instance. If a non-default vrf configuration occurred
before the default vrf configuration, it would result in a (NULL)
dereference to the non-existent default vrf.

This change 1) detects non-existence of default vrf and skips corresponding
RIB updating that normally occurs during configuration changes of the
route-leaking parameters; and 2) when the default bgp instance is defined,
runs the deferred RIB updating.

In vpn_leak_to_vrf_update_all(), replace early return if bgp_vpn is NULL
with assert, as the former would lead to subtly wrong RIB contents. The
underlying issue that led to commit 73aed5841a
should be fixed by the above changes.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-06-30 10:09:23 -07:00
Tigran Martirosyan
9199a725f4 fixed #2567: Json status of BGP peer is not updated properly 2018-06-30 16:27:25 +04:00
paco
343cdb6143
bgpd: copy-paste error (Coverity 1399202)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-28 15:31:38 +02:00
Russ White
f1b5eeea03
Merge pull request #2545 from pacovn/Coverity_1468413_Explicit_null_dereferenced
bgpd: null check (Coverity 1468413)
2018-06-26 11:14:39 -04:00
Quentin Young
f07e1c4fe4 bgpd: remove DEFUN_DEPRECATED usage
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-25 16:38:48 +00:00
paco
867f0ccaec
bgpd: null check (Coverity 1468413)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-25 15:03:17 +02:00
Quentin Young
0a8990d5f8
Merge pull request #2501 from pacovn/infer_unused1
bgpd isisd ldpd lib ospfd pimd: redundancy (infer, grouped)
2018-06-21 15:12:33 -04:00
paco
a2b6e694b1
bgpd isisd ldpd lib ospfd pimd: redundancy (infer)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-20 22:25:28 +02:00
paco
5d5ba0185d
bgpd, lib, ospfd, zebra: all_digit moved to frrstr
This solves a pending FIXME

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-19 17:59:53 +02:00
Pascal Mathis
a14810f43f
bgpd: Implement group-overrides for peer attrs
This commit introduces BGP peer-group overrides for the last set of
peer-level attrs which did not offer that feature yet. The following
attributes have been implemented: description, local-as, password and
update-source.

Each attribute, with the exception of description because it does not
offer any inheritance between peer-groups and peers, is now also setting
a peer-flag instead of just modifying the internal data structures. This
made it possible to also re-use the same implementation for attribute
overrides as already done for peer flags, AF flags and AF attrs.

The `no neighbor <neigh> description` command has been slightly changed
to support negation for no parameters, one parameter or * parameters
(LINE...). This was needed for the test suite to pass and is a small
change without any bigger impact on the CLI.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:32 +02:00
Pascal Mathis
b90a8e13ee
bgpd: Implement group-overrides for peer timers
This commit implements BGP peer-group overrides for the timer flags,
which control the value of the hold, keepalive, advertisement-interval
and connect connect timers. It was kept separated on purpose as the
whole timer implementation is quite complex and merging this commit
together with with the other flag implementations did not seem right.

Basically three new peer flags were introduced, namely
*PEER_FLAG_ROUTEADV*, *PEER_FLAG_TIMER* and *PEER_FLAG_TIMER_CONNECT*.
The overrides work exactly the same way as they did before, but
introducing these flags made a few conditionals simpler as they no
longer had to compare internal data structures against eachother.

Last but not least, the test suite has been adjusted accordingly to test
the newly implemented flag overrides.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:30 +02:00
Pascal Mathis
527de3dca2
bgpd: Cleanup peer/AF-flag override implementation
This commit cleans up some ugly leftovers from previous flag-override
implementation and refactors the AF-flag override implementation to
match the same behavior the newly added peer-flag override
implementation has.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:27 +02:00
Pascal Mathis
9fb964de21
bgpd: Implement group-overrides for peer flags
The current implementation of peer flags (e.g. shutdown, passive, ...)
only has partial support for overriding flags of a peer-group when the
peer is a member. Often settings might get lost if the user toys around
with the peer-group configuration, which can lead to disaster.

This commit introduces the same override implementation which was
previously integrated to support proper peer flag/attribute override on
the address-family level. The code is very similar and the global
attributes now use their separate state-arrays *flags_invert* and
*flags_override*.

The test suite for BGP peer attributes was extended to also check peer
global attributes, so that the newly introduced changes are covered. An
additional feature was added which allows to test an attribute with an
*interface-peer*, which can be configured by running `neighbor IF-TEST
interface`. This was introduced so that the dynamic runtime inversion of
the `extended-nexthop` flag, which is only enabled by default for
interface peers, can also be tested.

Last but not least, two small changes have been made to the current bgpd
implementation:

- The command `strict-capability-match` can now also be set on a
peer-group, it seems like this command slipped through while
implementing peer-groups in the very past.

- The macro `COND_FLAG` was introduced inside lib/zebra.h, which now
allows to either set or unset a flag based on a condition. The syntax
for using this macro is: `COND_FLAG(flag_variable, flag, condition)`

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:18 +02:00
paco
d6ceaca343
bgpd: dead code (Coverity 1399246)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-13 12:25:45 +02:00
Donald Sharp
2f8f4f1001 bgpd: Actually display labeled unicast routes received
The labeled unicast and unicast tables have been combined
into the unicast table.  Additionally we have a restriction
where if you configure labeled unicast you cannot configure
unicast.  This created a bug with 'show bgp ipv4 labeled-unicast summ'
command where we were displaying NoNeg, because v4 has been intentionally
turned off.

Modify the code so that when we are looking up if we have negotiated
a capapbility we use the correct one, while still using the appropriate
table for prefix count.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-07 17:10:38 -04:00
Lou Berger
480e99c6c1
Merge pull request #2351 from donaldsharp/bgp_deprecation
Bgp deprecation
2018-06-05 12:05:39 -04:00
Quentin Young
483e5a3aa5
Merge pull request #2304 from ppmathis/enhancement/bgp-pg-overrides
bgpd: Add proper support for overriding peer-group AF-flags/filters
2018-06-05 11:51:57 -04:00
Donald Sharp
3b7268448f
Merge pull request #2259 from ppmathis/enhancement/peer-enforce-first-as
bgpd: Move 'enforce-first-as' from global to peer
2018-06-04 09:35:00 -04:00
Donald Sharp
1cc406605b bgpd: Deprecate and hide the no bgp multiple-instance command
This command needs to be deprecated.  It partially implements
a refusal to create multiple instances.  If you do not need
multiple instances, just don't create them in the cli instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-01 15:15:30 -04:00
Donald Sharp
798467a200 bgpd: Hide and deprecate bgp config-type cisco command
This command needs to be deprecated.  It sets a small variety
of options via the BGP_OPT_CONFIG_CISCO flag.  Set for removal
in 1 year.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-01 15:15:30 -04:00
Pascal Mathis
cf9ac8bfb0
bgpd: Fix style issues for peer-group overrides
This commit fixes all outstanding style/formatting issues as detected by
'git clang-format' or 'checkpath' for the new peer-group override
implementation, which spanned across several commits.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-05-28 19:25:51 +02:00
Pascal Mathis
27c05d4d43
bgpd: Fix group overrides for inverted AF flags
This commit fixes peer-group overrides for inverted AF flags. This
implementation is currently only being used by the three 'send-community'
flags. Commit 70ee29b4d introduced generic support for overriding AF
flags, but did not support inverted flags.

By introducing an additional array on the BGP peer structure called
'af_flags_invert' all current and future flags which should work in an
inverted way can now also be properly overridden.

The CLI commands will work exactly the same way as before, just that 'no
<command>' now sets the flag and override whereas '<command>' will unset
the flag and remove the override.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-05-28 19:20:25 +02:00
G. Paul Ziemba
21a16cc2a3 bgpd: issue 2263: fix "no label vpn export auto"
This command should unset the label (instead of wrongly
setting to "auto")

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-05-26 07:05:42 -07:00
Don Slice
88b7d2555c bgpd: improve error message for neighbor not found
Problem reported due to tab completion showing all possible peers
in every vrf, but when neighbor in wrong vrf entered "no such
neighbor" is the error message.  Making it slightly more clear
with "no such neighbor in the view/vrf" to clue the user that they
may have specified the wrong vrf.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-05-24 10:51:17 -04:00
Pascal Mathis
47cbc09b63
bgpd: Move 'enforce-first-as' from global to peer
This commit moves the command 'bgp enforce-first-as' from global BGP
instance configuration to peer/neighbor configuration, which can now be
changed by executing '[no] neighbor <neighbor> enforce-first-as'.

End users can now enforce sane first-AS checking on regular sessions
while e.g. disabling the checks on routeserver sessions, which usually
strip away their own AS number from the path.

To ensure backwards-compatibility, a migration routine was added which
automatically sets the 'enforce-first-as' flag on all configured
neighbors if the old global setting was activated. The old global
command immediately disappears after running the migration routine once.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-05-19 14:43:42 +02:00
Russ White
1cbbd4950b
Merge pull request #2231 from ppmathis/fix/clear-bgp-afi
bgpd: Respect AFI/SAFI when hard-clearing a peer
2018-05-18 02:48:59 -04:00
Pascal Mathis
3ae8bfa5d8
bgpd: Respect AFI/SAFI when hard-clearing a peer
The current implementation does not respect the AFI+SAFI combination of
a peer when executing a non-soft (hard) clear. An example would be the
command `clear bgp ipv4 unicast *`, which will clear all BGP peers, even
those that do not have IPv4-Unicast activated.

This commit fixes that behavior by applying the same rules to both soft
and hard clear commands, so that peers without a matching AFI+SAFI
combination will be no longer modified.

Additionally, this commit adds warning messages to all `clear bgp
[<afi>] [<safi>] <target>` commands when no matching peers with the given
AFI+SAFI combination could be found.

Both existing and new warning messages have been extended to also
mention the AFI+SAFI combination that is missing, which is more helpful
to the user than a generic expression 'No peer configured'.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-05-14 22:52:31 +02:00
Pascal Mathis
8d9b8ed99d
bgpd: Improve JSON support for large communities
The current implementation of building JSON output is greatly different
for large communities compared to standard communities. This is mainly
noticeable by the missing 'list' attribute, which usually offers an
array of all communities present on a BGP route.

This commit adds the missing functionality of properly returning a
'list' attribute in JSON output and also tries a similar approach like
the standard communities are using to implement this feature.

Additionally, the 'format' specifier has been completely removed from
large communities string/JSON rendering, as the official RFC8092 specifies that
there is only one canonical representation:

> The canonical representation of BGP Large Communities is three
> separate unsigned integers in decimal notation in the following
> order: Global Administrator, Local Data 1, Local Data 2. Numbers
> MUST NOT contain leading zeros; a zero value MUST be represented with
> a single zero. Each number is separated from the next by a single
> colon. For example: 64496:4294967295:2, 64496:0:0.

As the 'format' specifier has not been used/checked and only one
canonical representation exists per today, there was no reason to keep
the 'format' parameter in the function signature.

Last but not least, the struct attribute 'community_entry.config' is no
longer being used for large communities and instead 'lcommunity_str' is
being called to maintain a similar approach to standard communities.

As a side effect, this also fixed a memory leak inside 'community_entry_free'
which did not free the allocated memory for the 'config' attribute when
dealing with a large community.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-05-13 19:37:51 +02:00
Russ White
71ef4ee49a
Merge pull request #2132 from donaldsharp/missed_stuff
Missed stuff
2018-05-12 06:18:15 -04:00
Don Slice
47a306a040 bgpd: fix auto-completion for neighbors and peer-groups
Before this fix, both real neighbors and peer-groups were lumped
together in auto-completion and it didn't work at all for
peer-groups.  This fix changes that behavior to do the right
thing.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-05-10 17:59:27 +00:00
Mitesh Kanjariya
ace295a90d bgpd: enable neighbor-nexthop-self for l2vpn evpn address family
In the FRR implementation of EVPN,
eBGP leaf-spine peering for EVPN is fully supported by allowing
the next hop to be propagated and not rewritten at each hop.
There are other changes also related to route import to facilitate this.
However, propagating the next hop is not correct in some cases.
Specifically, if the DC is comprised of multiple PODs
with distinct intra-POD and inter-POD VxLAN tunnels,
EVPN routes received from an adjacent POD by a border/exit leaf
must be propagated into the local POD with the next hop rewritten (to self).

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
Donald Sharp
0ca70ba5c1 bgpd: Dissallow mixing of import vrf and vpn commands
Do not allow the import vrf commands to be mixed with
import vpn commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-25 12:39:17 -04:00
Donald Sharp
69b07479f8 bgpd: Eliminate loop over afi's for vpn vrf leaking commands
The loop over all afi's implies that these commands actually need
to loop over all afi's to check the vpn policy.  We know the
appropriate afi based upon the node we are in.  So just return
the correct afi to look at and then just apply it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-25 12:39:17 -04:00
Don Slice
25679caa80 bgpd: disallow importing a vrf into itself
Prior to this fix, you could configure importing a vrf from inside
the same vrf.  This can lead to unexpected behavior in the leaking
process.  This fix disallows that behavior.

Ticket: CM-20539
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-04-25 12:39:17 -04:00
Don Slice
79ef8664a5 bgpd: fix crash on "no import vrf" if no default bgp instance
Tripped over a crash running the cli_crawler that occurred when the
sequence was doing "import vrf NAME" and "no import vrf NAME" inside
a vrf but a default bgp instance had not been created.  This fix
auto-creates the default instance if the "import vrf NAME" is
entered and a default instance does not exist.

Ticket: CM-20532
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-25 12:39:17 -04:00
Don Slice
e49840c895 bgpd: fix import vrf route-map issues
Prior to this fix, the import vrf route-map command only worked
if the route-map existed prior to the command.  Additionally, if
the import vrf route-map command was issued without an existing
route-map, the imported prefixes were not removed.  This fix
resolves both of thes mis-behaviors. bgp-smoke run with same
failures as base.

Ticket: CM-20459
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: CCR-7358
2018-04-25 12:39:17 -04:00
Don Slice
0fb8d6e639 bgpd: fix incorrect config when importing vrf default
Found that when doing "import vrf default" in another vrf, an
extra line was added to the configuration in error.   This fix
resolves that incorrect configuration. Manual testing will be
attached to the defect.

Ticket: CM-20467
Signed-off-by: Don Slice <dslice@cumulustnetworks.com>
Reviewed by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-25 12:39:17 -04:00
Don Slice
a8dadcf6cc bgpd: add ability to import default vrf routes
signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-04-25 12:39:17 -04:00
Donald Sharp
020a3f60bd bgpd: Cleanup warnings found in CI
Cleanup some of the warnings found in the CI system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-25 12:39:17 -04:00
Don Slice
bb4f6190d9 bgpd: add import vrf route-map command
Added the cli for doing route-map filtering on imported routes via
the new "import vrf route-map <NAME> command.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-04-25 12:39:17 -04:00
vivek
53089bec65 bgpd: Implement show command for VRF route leaking
Implement "show bgp [vrf FOO] <afi> <safi> route-leak" which displays
operational information about VRF route leaking.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-25 12:39:16 -04:00
vivek
44338987be bgpd: Fixes for VRF route leaking
Implement fixes for route leaking between VRFs through BGP, especially for
the scenario where routes are leaked from a VRF X to multiple other VRFs.
This include making sure that import and export happen via the global VPN
table, setting RD correctly and proper handling for multiple import/export.

Ticket: CM-20256
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-25 12:39:16 -04:00
Donald Sharp
6e2c7fe69d bgpd: Handle when the import vrf has not been created.
When the `import vrf XXX` command is entered under
an afi/safi for bgp and the XXX vrf bgp instance
does not yet exist, auto-create it using the same
ASN that the we are importing into.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-25 12:39:16 -04:00
Donald Sharp
12a844a506 bgpd: Implement vrf - vrf route leaking cli
add the `import vrf XXXX` command

router bgp 4 vrf DONNA
  <config>
!

router bgp 4 vrf EVA
  <config>
  address-family ipv4 uni
    import vrf DONNA
  !
!

This command will allow for vrf EVA to specify that it would like
to receive the routes from vrf DONNA into it's table.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-25 12:39:16 -04:00
Quentin Young
7298a8e105 bgpd: clean up clist management logic
* Remove unused parameter
* Restore behavior described by function comment
* Eliminate NPD caught by static analysis

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-17 13:58:24 -04:00
G. Paul Ziemba
e70e9f8e24 bgpd: vpn-vrf leaking: use dynamic label pool for "auto" labels
Add support for CLI "auto" keyword in vrf->vpn export label:

    router bgp NNN vrf FOO
	address-family ipv4 unicast
	    label vpn export auto
	exit-address-family

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-04-11 23:18:35 -07:00
Martin Winter
381fec2452
Merge pull request #2023 from LabNConsulting/working/master/confdate+release
Use new way of avoiding deprecated related warnings in non-dev branches
2018-04-05 01:23:37 +01:00
Lou Berger
e24be24183 *: Only test CONFDATE when VERSION_TYPE_DEV defined
Signed-off-by: Lou Berger <lberger@labn.net>
2018-04-03 13:47:50 -04:00
Philippe Guibert
925bf6718b bgpd: Flowspec client failed to update exit-address-family
Flowspec client failed to update `exit-address-family`.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-03 16:54:19 +02:00
jaydom
7c40bf391c bgpd: add flowspec feature
This work is derived from a work done by China-Telecom.
That initial work can be found in [0].
As the gap between frr and quagga is important, a reworks has been
done in the meantime.
The initial work consists of bringing the following:
- Bringing the client side of flowspec.
- the enhancement of address-family ipv4/ipv6 flowspec
- partial data path handling at reception has been prepared
- the support for ipv4 flowspec or ipv6 flowspec in BGP open messages,
  and the internals of BGP has been done.
- the memory contexts necessary for flowspec has been provisioned

In addition to this work, the following has been done:
- the complement of adaptation for FS safi in bgp code
- the code checkstyle has been reworked so as to match frr checkstyle
- the processing of IPv6 FS NLRI is prevented
- the processing of FS NLRI is stopped ( temporary)

[0] https://github.com/chinatelecom-sdn-group/quagga_flowspec/

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: jaydom <chinatelecom-sdn-group@github.com>
2018-03-30 14:00:47 +02:00
Lou Berger
615e608d76
Merge pull request #1854 from qlyoung/integer-standards-compliance
*: use C99 standard fixed-width integer types
2018-03-28 10:30:54 -04:00
Quentin Young
d7c0a89a3a
*: use C99 standard fixed-width integer types
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t

Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27 15:13:34 -04:00
Philippe Guibert
301ad80a99 bgpd: add an API to get incoming VRF from a RT
This commit is relying on bgp vpn-policy. It is needed to configure
several bgp vrf instances, and in each of the bgp instance, configure
the following command under address-family ipv4 unicast node:
[no] rt redirect import RTLIST

Then, a function is provided, that will parse the BGP instances.
The incoming ecommunity will be compared with the configured rt redirect
import ecommunity list, and return the VRF first instance of the matching
route target.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-03-27 15:21:51 +02:00
G. Paul Ziemba
c7109e09e7 bgp_vty.c: fix docstrings for bgp_imexport_vpn
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-19 22:14:43 -07:00
G. Paul Ziemba
d555f3e904 bgpd: vpn-vrf-leaking new CLI: address Vivek's review comments + crash fix
- vpn_leak_to_vpn_active(): check instance type
    - vpn_leak_prechange(): qualify with test for active
    - vpn_leak_postchange(): remove duplicated call to
	vpn_leak_from_vrf_update_all()

    - bgp_vty.c: Avoid null-pointer dereference for command "no rt vpn import"

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-19 22:14:42 -07:00
G. Paul Ziemba
b9c7bc5ab0 bgpd: new vpn-policy CLI
PR #1739 added code to leak routes between (default VRF) VPN safi and unicast RIBs in any VRF. That set of changes included temporary CLI including vpn-policy blocks to specify RD/RT/label/&c. After considerable discussion, we arrived at a consensus CLI shown below.

The code of this PR implements the vpn-specific parts of this syntax:

router bgp <as> [vrf <FOO>]
    address-family <afi> unicast
        rd (vpn|evpn) export (AS:NN | IP:nn)
        label (vpn|evpn) export (0..1048575)
        rt (vpn|evpn) (import|export|both) RTLIST...
        nexthop vpn (import|export) (A.B.C.D | X:X::X:X)
        route-map (vpn|evpn|vrf NAME) (import|export) MAP

        [no] import|export [vpn|evpn|evpn8]
        [no] import|export vrf NAME

User documentation of the vpn-specific parts of the above syntax is in PR #1937

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-19 22:13:43 -07:00
G. Paul Ziemba
ddb5b4880b bgpd: vpn-vrf route leaking
- add "debug bgp vpn label" CLI
    - improved debug messages for "debug bgp bestpath"
    - send vrf label to zebra after zebra informs bgpd of vrf_id
    - withdraw vrf_label from zebra if zebra informs bgpd that vrf_id is disabled
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-09 16:42:40 -05:00
Donald Sharp
54085eafeb
Merge pull request #1428 from LabNConsulting/working/master/indent
frr: conform with COMMUNITY.md formatting rules
2018-03-07 10:44:37 -05:00
Quentin Young
8590fba34f
Merge pull request #1816 from pguibert6WIND/issue_clear_ipv6
bgpd: clear ip bgp instances with safi invalid
2018-03-07 10:28:29 -05:00
Philippe Guibert
9b475e76c6 bgpd: clear ip bgp instances with invalid safi
This commit fixes the handling of incoming parameters passed in
following vty functions:

clear ip bgp ipv6 [safi] prefix []
clear ip bgp [vrf ] ipv6 [safi] prefix []

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-03-07 15:58:48 +01:00
Christian Franke
5fe3789f98
Merge pull request #1812 from qlyoung/bgpd-fix-update-group-commands
bgpd: fix update-group show commands
2018-03-07 14:50:50 +01:00
Lou Berger
996c93142d *: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:04:32 -05:00
Philippe Guibert
6dfe83b8f7
Merge pull request #1728 from mkanjari/evpn-bug-fixes
Evpn bug fixes
2018-03-06 17:27:10 +01:00
Quentin Young
dc64bdec91
bgpd: fix update-group show commands
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-01 13:46:40 -05:00
Mitesh Kanjariya
ee851c8c77 bgpd: add show bgp vrf all l2vpn evpn summary as an option
Ticket: CM-19738
Review: CCR-7194
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-27 01:14:43 -08:00
Mitesh Kanjariya
f487dcaf74
Merge branch 'master' into evpn-bug-fixes 2018-02-21 00:36:58 -08:00
Daniel Walton
827ed7076d bgpd: "no neighbor 10.13.0.12 peer-group ibgp" does not remove peer
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

This worked for unnumbered peers but not for numbered peers. This is
before the fix:

router bgp 100
 coalesce-time 1000
 neighbor FOO peer-group
 neighbor FOO remote-as external
 neighbor swp1 interface peer-group FOO
 neighbor 1.1.1.1 peer-group FOO
!
line vty
 exec-timeout 0 0
!
end
cel-redxp-10# wr
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/frr.conf
[OK]
cel-redxp-10# conf t
cel-redxp-10(config)# router bgp
cel-redxp-10(config-router)# no neighbor swp1 interface peer-group FOO
cel-redxp-10(config-router)# no neighbor 1.1.1.1 peer-group FOO
cel-redxp-10(config-router)# do show run
Building configuration...

Current configuration:
!
frr version 4.1-dev
frr defaults datacenter
hostname cel-redxp-10
!
service integrated-vtysh-config
!
password cn321
!
log syslog
!
router bgp 100
 coalesce-time 1000
 neighbor FOO peer-group
 neighbor FOO remote-as external
 neighbor 1.1.1.1 remote-as external
 !
 address-family ipv4 unicast
  no neighbor 1.1.1.1 activate
 exit-address-family
!
line vty
 exec-timeout 0 0
!
end
cel-redxp-10(config-router)#

After the fix "no neighbor 1.1.1.1 peer-group FOO" removes the 1.1.1.1
neighbor.
2018-02-15 20:55:43 +00:00
G. Paul Ziemba
a4d82a8adc bgpd: ran indent.py on some files prior to bgp vpn-vrf leaking changes
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-02-09 10:22:50 -08:00
Mitesh Kanjariya
2ca3a78b68 bgpd: enunciate the error message if user tries to configure 'router bgp'
We need a better error message. "Multiple BGP processes are configured"
doesnt makes sense anymore as with l3vni,
we could have multiple auto configured bgp instances.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-08 23:02:28 -08:00
Philippe Guibert
8e71b98f72
Merge pull request #1654 from mkanjari/evpn-symm-routing-enhancements
Evpn symmetric routing enhancements
2018-02-08 11:46:29 +01:00
Lou Berger
30a6095ac9
Merge pull request #1694 from qlyoung/fix-bgp-default-shutdown-conf-write
bgpd: fixup default shutdown
2018-02-05 16:04:08 -06:00
mitesh
9d00a48754 bgpd: allow evpn safi under vrf instance
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-05 13:29:52 -08:00
Donald Sharp
15c81ca495 bgpd: Add ability to see martian next-hop's for a vrf
We've run across an issue where the local connected
ip address is not being removed in some error condition.
During trackdown it was noticed that we cannot look
at this table for views/vrf's.  While we don't have the
bug tracked down yet this will help us figure it out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-02 19:26:22 -05:00
Quentin Young
b012cbe2b1
bgpd: improve default shutdown help string
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-01-30 11:47:34 -05:00
Lou Berger
08951735bd
Merge pull request #1690 from dslicenc/bgpd-vrf-show-cm17377
bgpd: fix output of show bgp vrf all neighbor x.x.x.x
2018-01-30 11:42:26 -05:00
Quentin Young
8175f54a2d
bgpd: fixup default shutdown
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-01-30 10:12:19 -05:00
Don Slice
71aedaa394 bgpd: fix output of show bgp vrf all neighbor x.x.x.x
Problem reported with output of the command "show bgp vrf all
neighbor x.x.x.x" not limiting the output to that peer in any vrf.
This fix corrects the logic to display by neighbor
(ipv4/ipv6/interface) in any vrf.

Ticket: CM-17377
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-01-30 12:30:35 +00:00
Russ White
983976514f
Merge pull request #1679 from qlyoung/revert-remove-options-directly-connected
Revert "bgpd: disallow invalid config at cli layer"
2018-01-29 08:25:49 -05:00
Quentin Young
7ebe625c3a
Revert "bgpd: disallow invalid config at cli layer"
This reverts commit a174be631a.

Turns out we need that variable to accept peer groups.
2018-01-26 17:16:12 -05:00
Don Slice
3946bdcc81 bgpd: remove poorly located bestpath json output
The bestpath multipath-relax setting was added to the output of
"show ip bgp neighbor json" several months ago but this is not
the correct place to display that information and this fix removes
it from there.  The multipath-relax setting  was also added
to the output of "show ip bgp sum json" which is fine.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-01-25 17:52:27 +00:00
Mitesh Kanjariya
3194717445 bgpd: unblock l2vpn evpn for non default vrf
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 15:58:53 -08:00
Philippe Guibert
a8bf7d9c9e bgpd: fix compilation issue with bgpd
Changes due to the change of vrf_id_t moved from 16 bits to 32 bits.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-01-22 13:52:24 +01:00
Russ White
7256280c1b
Merge pull request #1627 from qlyoung/bgp-autoshutdown
BGP auto-shutdown
2018-01-16 15:29:17 -05:00
Renato Westphal
9d57c91faf
Merge pull request #1635 from qlyoung/bgpd-remove-options-directly-connected
bgpd: disallow invalid config at cli layer
2018-01-16 10:11:39 -02:00
Quentin Young
f26845f9a6
bgpd: add neighbor autoshutdown
Adds ability to specify that peers should be administratively shutdown
when first configured.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-01-12 15:03:24 -05:00
Quentin Young
a174be631a
bgpd: disallow invalid config at cli layer
Remove the ability to attempt to configure a couple of options on
directly connected neighbors that don't make sense for them, as well as
the soft error handling code.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-01-12 15:00:37 -05:00
Mitesh Kanjariya
9bb77a5b3d
Merge branch 'master' into evpn-symmetric-routing 2018-01-11 09:00:23 -08:00
Russ White
d29715c48b
Merge pull request #1619 from donaldsharp/bgp_debugging
bgpd: 'summary' to show NoNeg if peer did not negotiate afi/safi
2018-01-10 20:00:51 -05:00
Russ White
bb469889e5
Merge pull request #1586 from donaldsharp/1585_fix
bgpd: Fix peer uptime display in milliseconds
2018-01-10 19:58:09 -05:00
Daniel Walton
95077abf60 bgpd: 'summary' to show NoNeg if peer did not negotiate afi/safi
If we have configured neighbor 1.1.1.1 for an afi/safi but they have not
activated that afi/safi with us then display "NoNeg" in the state column
of the summary output.  This is to make troubleshooting afi/safi
easier.

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2018-01-10 12:15:44 -05:00
Quentin Young
0112e9e0b9
bgpd: use atomic_* ops on _Atomic variables
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-01-09 15:40:48 -05:00
Donald Sharp
d3c7efede7 bgpd: Allow for deprecation of json bgpTimerUp
The bgpTimerUp value was incorrectly named, add
a correct name bgpTimerUpMsec and add some
code to allow for deprecation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-03 11:19:20 -05:00
Donald Sharp
e033027459 bgpd: Fix peer uptime display in milliseconds
For some reason bgp is calculating the peer uptime
in miliseconds incorrectly.  Additionally we have
the peer_uptime function call that should be doing this!
But since we've choosen different names for the json output
we cannot fix it at this point.

uptime contains the number of seconds of uptime here.  Just
multiply by 1k and display that( as peer_uptime does )

Fixes: #1585
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-03 11:19:20 -05:00
Quentin Young
37a333fef1
bgpd: fix configuration of 0 for coalesce-time
Was using 0 as a sentinel value, so user couldn't configure 0 as the
value of the coalesce timer.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-12-14 16:43:31 -05:00
Mitesh Kanjariya
94c2f693a4 bgpd: evpn enabled should only be checked for default instance
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
Mitesh Kanjariya
0b5131c951 bgpd: handle different sequence of bgp vrf create/delete
BGP VRF can be created/deleted either via config or via l3vni add/del.
We need to handle various sequences.

1. If user config is presented, an l3vni del should not delete the vrf instance
2. do not write bgp config in show running for auto created vrf
2. If l3vni present, disallow the cli for deleting bgp vrf instance
3. If l3vni is added and vrf config is present set the flags properly
4. if bgp vrf is configured unset the AUTO flag

Ticket: CM-18630
Review: CCR-6906
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
Mitesh Kanjariya
fe1dc5a374 bgpd: l3vni/rmac association with bgp vrf
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:05 -08:00
Quentin Young
14b8641a5e
bgpd: fix config display of coalesce-time
Since coalesce time is now heuristically adjusted based on peer count,
we need to separate out specific configuration by the user from the
current value. Behavior established is to not adjust if the user has a
value set.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-12-06 17:38:24 -05:00
Renato Westphal
2e4c229616 *: make clippy usage more consistent
Fixes #1511.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-12-04 19:46:38 -02:00
Quentin Young
152456fe23
bgpd: rebase onto master
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-30 16:18:04 -05:00
Quentin Young
555e09d4a2
bgpd: atomize write-quanta, add read-quanta
bgpd supports setting a write-quanta that serves as a hint on how many
packets to write per I/O cycle. Now that input is buffered, it makes
sense to add the equivalent parameter for how many packets are processed
per cycle. This is *not* how many packets are read off the wire per I/O
cycle; rather it is how many packets are processed from the input buffer
in a given cycle after having been read off the wire and sanitized.

Since these values must be used from multiple threads, they have also
been made atomic.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-30 16:18:00 -05:00
Quentin Young
424ab01d0f
bgpd: implement buffered reads
* Move and modify all network input related code to bgp_io.c
* Add a real input buffer to `struct peer`
* Move connection initialization to its own thread.c task instead of
  piggybacking off of bgp_read()
* Tons of little fixups

Primary changes are in bgp_packet.[ch], bgp_io.[ch], bgp_fsm.[ch].
Changes made elsewhere are almost exclusively refactoring peer->ibuf to
peer->curr since peer->ibuf is now the true FIFO packet input buffer
while peer->curr represents the packet currently being processed by the
main pthread.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-30 16:17:59 -05:00
Quentin Young
49507a6f6a
bgpd: remove unused struct thread from peer
* Remove t_write
* Remove t_keepalive

These have been replaced by pthreads and are no longer needed. Since
some code looks at these values to determine if the threads are
scheduled, also add a new bitfield to store the same information.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-30 16:17:58 -05:00
Lou Berger
09c0e3c04a
Merge pull request #1448 from qlyoung/fix-peer-group-name
bgpd: fix `show bgp peer-group NAME`
2017-11-29 03:37:48 +08:00
Quentin Young
1d35f21875
bgpd: fix some vrf related cli
argv_find() searching for wrong thing

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-28 12:46:58 -05:00
Renato Westphal
fcaae8e4ec
Merge pull request #1474 from qlyoung/foreach_afi_safi
bgpd: use FOREACH_AFI_SAFI where possible
2017-11-22 13:54:30 -02:00
Quentin Young
05c7a1cc93
bgpd: use FOREACH_AFI_SAFI where possible
Improves consistency and readability.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-21 13:02:06 -05:00
Donald Sharp
a69ea8aeac bgpd: Only build json for community when needed
Building a communities json object every time is
both expensive and memory wasteful.  Modify
code to only build the json object when needed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-17 09:04:26 -05:00
Quentin Young
ff9959b0c7
bgpd: fix show bgp peer-group NAME
Fixes a bug whereby all peer-groups would be shown even when a
particular peer-group was specified for display.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-14 16:55:22 -05:00
Renato Westphal
f498ca82bd
Merge pull request #1370 from dslicenc/cm18408-bgp-timers
bgpd: fix various problems with hold/keepalive timers
2017-11-06 14:06:12 -02:00
Don Slice
d25e4efc52 bgpd: fix various problems with hold/keepalive timers
Problem reported that we weren't adjusting the keepalive timer
correctly when we negotiated a lower hold time learned from a
peer.  While working on this, found we didn't do inheritance
correctly at all.  This fix solves the first problem and also
ensures that the timers are configured correctly based on this
priority order - peer defined > peer-group defined > global config.
This fix also displays the timers as "configured" regardless of
which of the three locations above is used.

Ticket: CM-18408
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: CCR-6807
Testing-performed:  Manual testing successful, fix tested by
submitter, bgp-smoke completed successfully
2017-10-26 11:55:31 -04:00
Donald Sharp
7d4aea3007 bgpd: Allow route-map match peer... to have auto-complete
The match peer command doees not currently have an auto-complete
ability.  Let's add it in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-25 09:24:53 -04:00
Renato Westphal
efd7904eab *: add missing \n in some help strings
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 19:30:30 -02:00
Donald Sharp
86a55b996a bgpd: Display unsigned ints
We are storing data as an unsigned int and we should not
display it as a signed number.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-17 20:57:40 -04:00
Lou Berger
6660407d60 Merge pull request #1324 from donaldsharp/bgp_aspath
bgpd: Add ability to display information about bestpath in json
2017-10-16 14:51:02 -04:00
Donald Sharp
57a9c8a831 bgpd: Add ability to display information about bestpath in json
When retrieving information about neighbors or summary in json
add some information about what bestPath particulars we have for
this bgp session.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-11 08:16:51 -04:00
Lou Berger
2131d5cf65 bgpd: only allow unicast|multicast SAFIs in VRF/View (i.e., non-core) BGP instances
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-09 11:21:03 -04:00
Lou Berger
24345e82e8 bgpd: remove old/broken vpnv4 from of show bgp
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-05 10:11:49 -04:00
Daniel Walton
d114b977e9 *: support keywords that begin with uppercase letter
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

VARIABLE tokens must be all uppercase, this allows us to support WORD
tokens that begin with an uppercase letter.  The "Null0" keyword is an
example of where this is needed.

The only VARIABLE we had that wasn't already all uppercase was
ASN:nn_or_IP-address:nn
2017-09-14 18:07:30 +00:00
Donald Sharp
3f65c5b1f7 bgpd: Add various hash optimizations
1) Add hash names to all hash_create calls

2) Fix community_hash, ecommunity_hash and lcommunity_hash key
creation

3) Fix output of community and lcommunity iterators( why would
we want to see the memory location of the backet? ).

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-05 14:33:06 -04:00
Renato Westphal
5ba345ccb2 Merge pull request #1047 from dwalton76/bgpd-draft-ietf-grow-bgp-gshut-10
bgpd: implement draft-ietf-grow-bgp-gshut-10
2017-09-05 10:20:49 -03:00
Quentin Young
60466a63f2
*: fix style
Fixes style nits introduced by recent pull requests.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-30 11:27:11 -04:00
Donald Sharp
32592ffb4f Merge pull request #1056 from opensourcerouting/oldbits-0
"pathspace" options, vtysh-suid-cleanups, "vty_frame()"
2017-08-29 17:48:36 -04:00
David Lamparter
ea47320b1d bgpd: remove some deep nesting
Some of this was so egregiously stupid, I couldn't look at it without
gouging my eyes out...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-29 08:36:03 +02:00
David Lamparter
2b79110731 bgpd: get rid of afi_header_vty_out() & co.
afi_header_vty_out() is easily replaced with vty_frame(), which means we
can drop a whole batch of "int *write" args as well as the entirety of
bgp_config_write_family_header().

=> AFI/SAFI config writing is now a lot simpler.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-29 08:36:03 +02:00
Mitesh Kanjariya
09fdc88c8c Merge branch 'master' into dev-master 2017-08-28 18:19:03 -07:00
Daniel Walton
31d5efe2ea Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-draft-ietf-grow-bgp-gshut-10
Conflicts:
	bgpd/bgp_route.c
2017-08-28 06:59:38 -07:00
Daniel Walton
7f32323620 bgpd: implement draft-ietf-grow-bgp-gshut-10
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-08-25 18:27:49 +00:00
Daniel Walton
318cac96ef bgpd: Memory wasting in zebra by non used MPLS FECs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-08-22 18:14:50 +00:00
Mitesh Kanjariya
0291c246db fix coding style
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-18 22:43:09 -07:00
Mitesh Kanjariya
57f7feb64f Fix coding style.
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-18 17:33:56 -07:00
Donald Sharp
510afcd647 bgpd: Fix bgp clear help string
The bgp clear help string was misordered.

New output:
robot.cumulusnetworks.com# clear bgp
  (1-4294967295)  Clear peers with the AS number
  *               Clear all peers
  A.B.C.D         BGP neighbor address to clear
  WORD            BGP neighbor on interface to clear
  X:X::X:X        BGP IPv6 neighbor to clear
  external        Clear all external peers
  ipv4            Address Family
  ipv6            Address Family
  peer-group      Clear all members of peer-group
  prefix          Clear bestpath and re-advertise
  view            BGP view
  vrf             BGP VRF

Fixes: #1005
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-18 09:45:16 -04:00
vivek
b682f6de5a zebra: Fix MAC change handling for a neighbor
When the MAC changes for a local neighbor, ensure that the neighbor data
structure as well as the link between the neighbor and MAC data structures
is updated correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-17565
Reviewed By: CCR-6605
Testing Done: Manual, evpn-smoke
2017-08-17 03:54:38 -07:00
Mitesh Kanjariya
dff8f48da3 bgpd: Add advertsie-all-vni in show bgp neighbor
Ticket: CM-17249
Review: CCR-6558
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-17 02:05:53 -07:00
Mitesh Kanjariya
d77114b704 bgpd: display hostname capabilities as advertised and received
Ticket: CM-17250
Review: CCR-6567
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-17 01:46:16 -07:00
Mitesh Kanjariya
acf716660f bgpd: show command for martian nexthop db
Ticket:CM-17271/CM-16911
Reviewed By: ccr-6542
Testing Done: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-16 23:22:49 -07:00
Mitesh Kanjariya
d37ba5499e bgpd, lib, vtysh: Added support for mac filtering in route-maps
1. Added support to create mac filters
2. Enabled route-map commands for EVPN address family
3. Provision to add mac filters under match clause in route-maps

Ticket: CM-16349
Review: CCR-6190
Unit-test: Manual (logs attached to ticket)

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:09:37 -04:00
Renato Westphal
5c5255381e lib/bgpd: introduce the iana_safi_t enum
We had afi_t/iana_afi_t for AFIs but only safi_t for SAFIs. Fix this
inconsistency.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-31 23:44:42 -03:00
Renato Westphal
a08ca0a7e1 lib: remove SAFI_RESERVED_4 and SAFI_RESERVED_5
SAFI values have been a major source of confusion over the last few
years. That's because each SAFI needs to be represented in two different
ways:
* IANA's value used to send/receive packets over the network;
* Internal value used for array indexing.

In the second case, defining reserved values makes no sense because we
don't want to index SAFIs that simply don't exist. The sole purpose of
the internal SAFI values is to remove the gaps we have among the IANA
values, which would represent wasted memory in C arrays. With that said,
remove these reserved SAFIs to avoid further confusion in the future.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-31 23:38:38 -03:00
Daniel Walton
8eeb033552 bgpd: attribute-unchanged issues with peer-groups
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-26 17:49:20 +00:00
David Lamparter
9d303b37d7 Revert "*: reindent pt. 2"
This reverts commit c14777c6bf.

clang 5 is not widely available enough for people to indent with.  This
is particularly problematic when rebasing/adjusting branches.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-22 14:52:33 +02:00
whitespace / reindent
c14777c6bf
*: reindent pt. 2
w/ clang 5

* reflow comments
* struct members go 1 per line
* binpack algo was adjusted
2017-07-17 15:26:02 -04:00
whitespace / reindent
d62a17aede *: reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17 14:04:07 +02:00
Donald Sharp
1ea6b3f237 Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attr 2017-07-14 08:24:46 -04:00
Donald Sharp
da571b7a6c Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attr 2017-07-14 08:11:05 -04:00
David Lamparter
84a98309de Merge remote-tracking branch 'frr/master' into newline-redux
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 13:15:55 +02:00
Russ White
444d4d3b93 Merge pull request #799 from dwalton76/bgpd-show-labeled-unicast
bgpd: show bgp ipv4 label-unicast does not provide any output
2017-07-14 07:12:02 -04:00
David Lamparter
50790e72fb *: remove vty_outln again
(PRs merged to master added another few vty_outln() calls)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 13:09:47 +02:00
David Lamparter
2d8270596a Merge remote-tracking branch 'frr/master' into newline-redux
Lots of conflicts from CMD_WARNING_CONFIG_FAILED...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 13:07:30 +02:00
David Lamparter
cdda201036 *: remove VTYNL, part 5 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
55f70b671f *: remove VTYNL, part 4 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
61b7d449bd *: remove VTYNL, part 3 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
26a429fe8e *: remove VTYNL, part 2 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
Daniel Walton
f1a05de982 vtysh: return non-zero for configuration failures
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

This allows frr-reload.py (or anything else that scripts via vtysh)
to know if the vtysh command worked or hit an error.
2017-07-13 19:56:08 +00:00
David Lamparter
5c7571d43f *: ditch vty_outln(), part 1 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13 20:29:22 +02:00
Daniel Walton
019386c2b8 bgpd: show bgp ipv4 label-unicast does not provide any output
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-13 15:17:15 +00:00
David Lamparter
76ac0fe511 Merge pull request #798 from dwalton76/CMD_RANGE_STR
bgpd: --enable-multipath=256 setting is ignored
2017-07-13 14:58:52 +02:00
Donald Sharp
aadc090505 bgpd: Refactor 'struct attr_extra' into 'struct attr'
Most of the attributes in 'struct attr_extra' allow for
the more interesting cases of using bgp.  The extra
overhead of managing it will induce errors as we add
more attributes and the extra memory overhead is
negligible on anything but full bgp feeds.

Additionally this greatly simplifies the code for
the handling of data.

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

bgpd: Fix missing label set

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12 15:23:18 -04:00
vivek
90e60aa7c9 bgpd: Additional configuration for EVPN
Implement configuration options for EVPN. The configuration options include
VNI configuration with RD and Import and Export Route Targets. Also, display
the EVPN configuration.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-12 15:07:27 -04:00
vivek
520d5d768b bgpd: Display (show) commands for EVPN
Implement various operational/display commands for EVPN:
- show bgp evpn summary
- show bgp evpn vni [<vni>]
- show bgp evpn route [type <macip|multicast>]
- show bgp evpn route [rd <rd> [type <macip|multicast>]]
- show bgp evpn route [rd <rd> [mac <mac> [ip <ip>]]]
- show bgp evpn route vni <vni> [type <macip|multicast> | vtep <ip>]
- show bgp evpn route vni <vni> [mac <mac> [ip <ip>]]]
- show bgp evpn route vni <vni> [multicast <ip>]
- show bgp evpn route vni all [vtep <ip>]
- show bgp evpn import-rt

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-07-12 15:04:41 -04:00
vivek
7724c0a1a7 bgpd: Implement EVPN enable/disable
Implement the command 'advertise-all-vni' under the EVPN address-family
in order to allow the local system to learn about local VNIs (and MACs
and Neighbors corresponding to those VNIs) and exchange with other EVPN
speakers.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Dinesh Dutt <ddutt@cumulusnetworks.com>
2017-07-12 12:36:35 -04:00
Daniel Walton
6319fd637b bgpd: --enable-multipath=256 setting is ignored
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Restoring some code that was unintentionally removed when we were
migrating to Quentin's parser.
2017-07-11 18:41:08 +00:00
Lou Berger
a70638dad6 bgpd: have labeled unicast print consistent with other safis
Signed-off-by: Lou Berger <lberger@labn.net>
2017-07-11 08:43:26 -04:00
Daniel Walton
dfd8121281 Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label-misc3
Conflicts:
	bgpd/bgp_route.c
	bgpd/bgp_zebra.c
2017-07-10 13:06:19 +00:00
Daniel Walton
dd6bd0f16d bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-05 20:46:48 +00:00
Quentin Young
7111c1a0cd
*: fix excess docstring
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-05 15:33:00 -04:00
Daniel Walton
1161690b93 Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label-misc3
Conflicts:
	bgpd/bgp_route.c
2017-06-30 17:52:56 +00:00
Daniel Walton
b6ab5a3ab1 bgpd: Make SAFI-1 and SAFI-4 use the same table
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-06-30 13:55:47 +00:00
Quentin Young
8e25c8ce2f *: rebase vty_outln() -> master
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:38:59 +00:00
Quentin Young
1318e7c841 *: s/VTY_NEWLINE/VTYNL/g
Should be able to fit more vty_out onto one line now

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:34:54 +00:00
Russ White
0bc44f61c9 Merge pull request #754 from qlyoung/fix-argv-arg
use argv->text where appropriate
2017-06-29 11:06:15 -04:00
Jafar Al-Gharaibeh
0eef52fd95 Merge pull request #759 from qlyoung/remove-vty-argparsers
*: remove VTY_GET_*
2017-06-29 09:36:06 -05:00
Donald Sharp
1e84e9a697 Merge pull request #714 from opensourcerouting/cli_magic_defpy
CLI magic: part 1 (DEFPY)
2017-06-28 09:48:33 -04:00
Quentin Young
facfee22f5 *: remove VTY_GET_*
CLI validates input tokens, so there's no need to do it in handler
functions anymore.

spatch follows
----------------

@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>

@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>

@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>

@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>

@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>

@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 19:04:41 +00:00
Quentin Young
55f9148812 bgpd: argv->arg grab bag
* Pass ->text to functions that now do full string matching
* Remove cases for l2vpn and evpn where they cannot occur

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 17:46:42 +00:00
Quentin Young
a820600449 bgpd: more cli-ening
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 17:46:42 +00:00
Daniel Walton
4fbf55e986 Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label-misc3 2017-06-26 17:24:44 +00:00
Olivier Dugeon
8ea37652c7 Merge pull request #745 from qlyoung/fix-lookup
*: simplify log message lookup
2017-06-21 18:22:52 +02:00
Quentin Young
56b4067930 *: simplify log message lookup
log.c provides functionality for associating a constant (typically a
protocol constant) with a string and finding the string given the
constant. However this is highly delicate code that is extremely prone
to stack overflows and off-by-one's due to requiring the developer to
always remember to update the array size constant and to do so correctly
which, as shown by example, is never a good idea.b

The original goal of this code was to try to implement lookups in O(1)
time without a linear search through the message array. Since this code
is used 99% of the time for debugs, it's worth the 5-6 additional cmp's
worst case if it means we avoid explitable bugs due to oversights...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-21 15:22:21 +00:00
Daniel Walton
c1a44e4367 Merge branch 'master' into bgpd-ipv4-plus-label-misc3 2017-06-21 10:30:29 -04:00
Russ White
bfd93d11b8 Merge pull request #731 from qlyoung/fix-bgp-misc-cli
bgpd: fix misc cli ranges & config writes
2017-06-19 21:53:05 -04:00
Daniel Walton
9bedbb1e52 bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

- All ipv4 labeled-unicast routes are now installed in the ipv4 unicast
  table. This allows us to do things like take routes from an ipv4
  unicast peer, allocate a label for them and TX them to a ipv4
  labeled-unicast peer. We can do the opposite where we take routes from
  a labeled-unicast peer, remove the label and advertise them to an ipv4
  unicast peer.

- Multipath over a labeled route and non-labeled route is not allowed.

- You cannot activate a peer for both 'ipv4 unicast' and 'ipv4
  labeled-unicast'

- The 'tag' variable was overloaded for zebra's route tag feature as
  well as the mpls label. I added a 'mpls_label_t mpls' variable to
  avoid this.  This is much cleaner but resulted in touching a lot of
  code.
2017-06-16 19:12:57 +00:00
Quentin Young
4668a15109 bgpd: fix misc cli ranges & config writes
* Ranges for some MED were 2^32 - 2 instead of 2^32 - 1
* Use correct printf specifiers for unsigned values
* Some drive-by CLI collapsing and simplification

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-16 19:09:05 +00:00
Donald Sharp
18c5703710 bgpd: Add view/vrf auto completion to commands
Modify the '<view|vrf> NAME' commands to allow auto-completion
of available choices.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-16 13:01:51 -04:00
David Lamparter
f787d7a0b3 bgpd: (demo) apply some DEFPY()
(This was intended as further demonstration of the DEFPY code, but it
might as well go into the tree.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-14 19:29:26 +02:00
Quentin Young
47332bd02b bgpd: fix memleak with 'show ip bgp vrf ...'
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-09 20:18:56 +00:00
David Lamparter
326452238a Merge branch 'stable/3.0'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-06 17:37:41 +02:00
Quentin Young
ce2570bc0a bgpd: fix large-community-list commands
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-04 19:04:56 +00:00
Lou Berger
375a2e67ad bgpd: remove encap safi show commands
Signed-off-by: Lou Berger <lberger@labn.net>
2017-05-23 15:58:50 -04:00
Lou Berger
6c8744af2d bgpd: remove additional instance of BGP_ENCAP(v6)_NODE
Signed-off-by: Lou Berger <lberger@labn.net>
2017-05-23 15:58:50 -04:00
Lou Berger
5b1f0f29e7 bgpd: remove support for ipv4|6 encap safi config
Signed-off-by: Lou Berger <lberger@labn.net>
2017-05-23 15:42:32 -04:00
Lou Berger
33c0d63f9c bgpd: remove encap safi show commands
Signed-off-by: Lou Berger <lberger@labn.net>
2017-05-23 15:11:30 -04:00
Lou Berger
5f69e7a7ac bgpd: remove support for ipv4|6 encap safi config
Signed-off-by: Lou Berger <lberger@labn.net>
2017-05-23 15:01:54 -04:00
David Lamparter
57463530f3 Merge branch 'stable/3.0'
Conflicts:
	ospf6d/ospf6_lsa.c
	ospfd/ospf_vty.c
	zebra/interface.c

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18 12:28:12 +02:00
David Lamparter
92eedda1fb Merge branch stable/2.0 into stable/3.0
Conflicts:
	bgpd/bgp_fsm.c
	ospf6d/ospf6_lsa.c
	ospfd/ospf_vty.c
	zebra/redistribute.c

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18 12:23:13 +02:00
David Lamparter
b2b6f8f33c Pre-revert nonmergeable changes
Revert "ospf6d: fix decimal area ID cli"
commit a27cb3cfe9

Revert "bgpd: add back unicast option to 'address-family vpnv(4&6)' Issue #459"
commit 399598bf6b

Revert "Fix the memory leak"
commit d8d58e9839

Revert "zebra: 'no ip route 4.1.1.19 255.255.255.255 99' is ambiguous"
commit 83f3561935

Revert "ospf6d: Allow unconfig of unknown lsa's"
commit 5b0747d71d

Revert "Fix the "Dead assignment" of clang SA."
commit 3a6570a1f1

Revert "snapcraft: Improve README.usage.md based on feedback received"
commit 2a3a819a9c

Revert "zebra: stop deregistering static nexthops unless removing the static"
commit 1dac3a9619

All of these changes do not apply on stable/3.0 due to either CLI
changes or another fix already being present.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18 12:09:50 +02:00
David Lamparter
7e467f2d2b Merge branch 'frr/pull/557'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18 11:37:37 +02:00
Renato Westphal
e89f016d3e Merge pull request #561 from donaldsharp/static_config2
Static config2
2017-05-17 14:18:51 -03:00
Donald Sharp
1f0a6ed1f1 bgpd: Fix occassional turn off of extended-nexthop for an if
Sometimes, like once every 400 iterations, when you restart
Quagga, extended-nexthop has been turned off for interface
based config( for 5549 ).

Examining the code, there is only 1 real path to setting
the PEER_FLAG_CAPABILITITY_ENHE and that is through
peer_conf_interface_get.  Modify this code path
to always set the PEER_FLAG_CAPABILITY_ENHE if it is
not already set.

In addition, fix a possible pointer dereference.

Ticket: CM-12929
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-17 08:48:46 -04:00
Donald Sharp
a6e895a9df Merge remote-tracking branch 'origin/stable/2.0' 2017-05-17 08:32:53 -04:00
Donald Sharp
047fc9501d bgpd: Allow 'show bgp neighbor' to indicate authentication or not
When we configure authentication.  Allow the 'show bgp neighbor'
commands( and their ilk ) to indicate that the peer has
authentication enabled.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-17 07:51:23 -04:00
Daniel Walton
46111f2f48 bgpd: Add epoch uptime to BGP neighbor json outputs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-05-17 00:07:02 +00:00
Daniel Walton
3bd07551f8 bgp: garbage "neighbor (af 54816) remote-as internal" peer in show run
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-05-17 00:01:23 +00:00
Daniel Walton
464598de53 bgpd: "neighbor swpX interface remote-as XYZ" is ignored
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Don Slice <dslice@cumulusnetworks.com>

If you did:
  neighbor swp1 interface
  neighbor swp1 interface remote-as external

we would not set the remote-as. You could however still do
  neighbor swp1 remote-as external
2017-05-16 23:54:46 +00:00
Donald Sharp
c358f112a6 bgpd: Fix occassional turn off of extended-nexthop for an if
Sometimes, like once every 400 iterations, when you restart
Quagga, extended-nexthop has been turned off for interface
based config( for 5549 ).

Examining the code, there is only 1 real path to setting
the PEER_FLAG_CAPABILITITY_ENHE and that is through
peer_conf_interface_get.  Modify this code path
to always set the PEER_FLAG_CAPABILITY_ENHE if it is
not already set.

In addition, fix a possible pointer dereference.

Ticket: CM-12929
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-16 15:06:35 -04:00
David Lamparter
896014f4bc *: make consistent & update GPLv2 file headers
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header.  (The style with * at the beginning won out with
580 to 141 in existing files.)

Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15 16:37:41 +02:00
David Lamparter
d48ed3e098 bgpd: autocomplete peer-groups & interface peers
This wasn't quite correct in the previous patch, leading to peer-groups
& interface peers breaking in autocompletion.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15 10:27:43 -04:00
David Lamparter
b8a815e5e4 bgpd: autocomplete neighbor names
Add autocompletion for neighbor IP/IPv6/peer-group names.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15 10:27:43 -04:00
Lou Berger
20aeb9709e bgpd: fix v6 encap safi config - more labeled unicast breakage (Issue #473)
Signed-off-by: Lou Berger <lberger@labn.net>
2017-05-14 11:10:42 -04:00
Lou Berger
399598bf6b bgpd: add back unicast option to 'address-family vpnv(4&6)' Issue #459 2017-05-09 14:52:54 -04:00
Lou Berger
8366e9e68c Merge pull request #454 from dwalton76/hide-router-bgp-peer-ipv4-unicast-commands
bgpd: hide "router bgp" commands also under "address-family ipv4 unic…
2017-05-09 11:54:33 -04:00
Donald Sharp
6281320446 Merge remote-tracking branch 'origin/stable/3.0' 2017-05-08 16:51:21 -04:00
Don Slice
5ef7c5dfdd bgpd: resolve crash displaying bgp vrf routing info
Problem uncovered with crash when entering the command "show ip bgp
vrf vrf1001 0.0.0.0".   The crash was caused by a mistake incrementing
the index value in the vrf/view case.  Manual testing completed and
failing test case now passes successfully.

Ticket: CM-16223
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed By: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-05 17:17:28 +00:00
Donald Sharp
d476347d5d Merge remote-tracking branch 'origin/stable/3.0' 2017-05-04 13:35:25 -04:00
Daniel Walton
596c17ba57 bgpd: hide "router bgp" commands also under "address-family ipv4 unicast"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-03 16:45:14 +00:00
Donald Sharp
ae9b0e11f6 bgpd: Fix crashes with '[no] neighbor ... shutdown ..' command
This fixes two crashes:

1) When we enter a 'neighbor shutdown..' command for a peer
group or interface based peer we were not properly looking
up the peer.

2) When we we enter 'no neighbor shutdown..' command for
a peer group or interface based peer we were not properly
lookup up the peer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-03 09:13:12 -04:00
Donald Sharp
5ce77b2b1e bgpd: Fix 'show bgp ... summary json' to have empty {}
When we have no output for a json command we should have
an empty {} displayed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-02 22:34:21 -04:00
Donald Sharp
05ba625af7 Merge remote-tracking branch 'origin/stable/3.0' 2017-05-02 15:52:09 -04:00
Renato Westphal
5a9a82b8ec Merge pull request #426 from donaldsharp/afi_safi2
Afi safi2
2017-05-02 12:09:17 -03:00
Donald Sharp
46854ac0ae bgpd: Fix 'show .. bgp ... neighbors ' command
The 'show ip bgp neighbors swp31s0' command was not
working properly.  This fixes that issue.

This command still has issues that need to be investigated
but for the moment this gets the command working in the
form that is needed.  More rework can come.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-28 10:55:45 -04:00
Donald Sharp
b9f77ec810 bgpd: Make json output to be camelCase
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-28 10:55:45 -04:00
Donald Sharp
798c3572a0 bgpd: Modify 'show ... bgp ... summary' to only display pertinent info
Modify the 'show ... bgp ... summary' command when you are
looking at a afi( with no safi specified ) to only display
output for those safi's that have been configured.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-28 10:55:39 -04:00
Renato Westphal
f0dac89fde bgpd: fix "clear bgp" commands
The use of VTY_DECLVAR_CONTEXT(bgp, bgp) here is wrong as we are not
inside the "router bgp" configuration node. This was making the clear
commands always fail with a "Current configuration object was deleted
by another process" error, which doesn't make any sense.

Also, the bgp_clear() function will already check for us if the given
peer-group or neighbor exists or not, there's no need to duplicate this
logic here.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-04-28 10:47:51 -03:00
Donald Sharp
b3b3879c3e lib, bgpd: Remove UNDEFINED_NODE
Remove the UNDEFINED_NODE as that it's implementation breaks
our ability in BGP to figure out where we are by allowing
default: in the switch statement.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-15 13:26:56 -04:00
Don Slice
b60f527556 bgpd: labeled unicast display
Implement 'show' and 'clear' commands for the labeled-unicast address-family.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2017-04-06 10:32:07 -04:00
Don Slice
f51bae9cf9 bgpd: labeled unicast config
Implement support for activating the labeled-unicast address family in
BGP and relevant configuration for this address family.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2017-04-06 10:30:03 -04:00
David Lamparter
505e50567f *: apply DEFUN_NOSH for node-switch CLI commands
These have copies in vtysh that do the node-switch locally and are
listed in extract.pl's ignore list.  The ignore list however is
redundant since DEFUN_NOSH does the same thing...

ldpd is a bit hacky, but Renato is reworking this anyway.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-28 15:48:07 -04:00