Commit graph

273 commits

Author SHA1 Message Date
Donald Sharp 1ee0a2df0d bgpd: Allow registration of nexthops after zebra connection
If we attempt to register nexthops before we have the zebra
connection, they will not be installed.  After we have noticed
that we are up, re-install them.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-31 06:31:41 -04:00
Donald Sharp bb4ef1aec8 bgpd: Add some debugs to note when we are not talking to zebra
Allow some debug notification when we are unable to talk
to zebra due to the connection not being there yet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-31 06:31:41 -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
Donald Sharp fd06964433 bgpd: Add '[no] flood <disable|head-end-replication>'
Add the '[no] flood <disable|head-end-replication>' command
to the l2vpn evpn afi/safi sub commands for bgp.  This command
when entered as 'flood disable' will turn off type 3 route
generation for the transmittal of the type 3 route necessary
for BUM replication on the remote VTEP.  Additionally it will
turn off the BUM handling via the new zebra command,
ZEBRA_VXLAN_FLOOD_CONTROL.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-11 20:27:28 -04:00
Donald Sharp fbac9605a7 lib, zebra: Allow the specification of BUM flooding
Allow the modification of whether or not we will allow
BUM flooding on the vxlan bridge.  To do this allow
the upper level protocol to specify via the ZEBRA_VXLAN_FLOOD_CONTROL
zapi message.

If flooding is disabled then BUM traffic will not be forwarded
to other VTEP's.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-11 20:22:19 -04: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
Donald Sharp 40381db785 bgpd: Rename various variable names to something more appropriate
ri -> pi
bi -> bpi
info -> path
info -> rmap_path ( for routemap applications )

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:26:30 -04:00
Donald Sharp 9b6d8fcf29 bgpd: Convert binfo to path
Convert the binfo variable to path.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:26:30 -04:00
Donald Sharp 18ee831031 bgpd: Convert all bgp_info_XXX functions to bgp_path_XXX functions
Rename all bgp_info_XXX functions to bgp_path_XXX functions

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:14:25 -04: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 1defdda8e8 bgpd: Convert BGP_INFO_XXX to BGP_PATH_XXX
Search and replace all BGP_INFO_XXX to BGP_PATH_XXX

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:14:25 -04:00
David Lamparter 6a154c8812 *: list_delete_and_null() -> list_delete()
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 11:40:52 +02:00
Donald Sharp 85751d1d33 bgpd: Don't necessarily ignore interface callbacks
In bgp if we have not configured bgp we were ignoring
interface based callbacks.  Leading to states where
we may not be processing interface information.
Leading to states where we do not actually keep
ifp data.  As an example:

Suppose vrf A and vrf B.  A has interface swp1.
At the same time we only have a `router bgp 9 vrf B`
When we received the callback for moving swp1
from vrf A to vrf B we were not processing the
move at all and BGP would not consider the interface
part of vrf B at all.

This commit makes bgp pay attention to interface
events irrelevant if bgp is using that vrf.  This
is now consistent with how the lib/if* expects
to work and the rest of the daemons in FRR.

Signed-off-by: Donald Sharp <sharpd@cumulsnetworks.com>
2018-09-25 15:30:23 -04:00
paco f533be73f6
bgpd, doc, ldpd, lib, tests, zebra: LM fixes
Corrections so that the BGP daemon can work with the label manager properly
through a label-manager proxy. Details:

- Correction so the BGP daemon behind a proxy label manager gets the range
  correctly (-I added to the BGP daemon, to set the daemon instance id)
- For the BGP case, added an asynchronous label manager connect command so
  the labels get recycled in case of a BGP daemon reconnection. With this,
  BGPd and LDPd would behave similarly.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-18 17:39:16 +02:00
David Lamparter 8c59e16b12
Merge pull request #3015 from donaldsharp/no_fast_failover_and_vrf
bgpd: Using no bgp fast-external-failover prevents vrf intf moves
2018-09-18 12:47:54 +02:00
David Lamparter 2564f080da Merge branch 'pr/2986'
Conflicts:
	bgpd/bgp_network.c (BGP_ERR_* -> EC_BGP_*)

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-18 12:46:42 +02:00
Quentin Young 1c50c1c0d6 *: style for EC replacements
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:38:57 +00: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
Donald Sharp c19fe3c7ab bgpd: Using no bgp fast-external-failover prevents vrf intf moves
When using `no bgp fast-external-failover` and a interface moves
from one vrf into another we would not fully process the change.
Fix this code path.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-13 09:05:42 -04:00
Donald Sharp 17cdd31e00 bgpd: Prevent possible crash when parsing v6 attributes
The peer->nexthop.ifp pointer must be set when parsing the
attributes in bgp_mp_reach_parse, notice this
and fail gracefully.

Rework bgp_nexthop_set to remove the HAVE_CUMULUS and to
fail the nexthop_set when we have a zebra connection and
no ifp pointer, as that not havinga zebra connection and
no ifp pointer is legal.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-12 09:00:43 -04:00
vivek f190902f52 Merge remote-tracking branch 'upstream/master' into evpn-extended-mobility
Conflicts:
	zebra/zebra_vxlan.c
2018-08-27 22:13:30 +00: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
vivek f07e1c99d6 bgpd, zebra: EVPN extended mobility support
Implement procedures similar to what is specified in
https://tools.ietf.org/html/draft-malhotra-bess-evpn-irb-extended-mobility
in order to support extended mobility scenarios in EVPN. These are scenarios
where a host/VM move results in a different (MAC,IP) binding from earlier.
For example, a host with an address assignment (IP1, MAC1) moves behind a
different PE (VTEP) and has an address assignment of (IP1, MAC2) or a host
with an address assignment (IP5, MAC5) has a different assignment of (IP6,
MAC5) after the move. Note that while these are described as "move" scenarios,
they also cover the situation when a VM is shut down and a new VM is spun up
at a different location that reuses the IP address or MAC address of the
earlier instance, but not both. Yet another scenario is a MAC change for an
attached host/VM i.e., when the MAC of an attached host changes from MAC1 to
MAC2. This is necessary because there may already be a non-zero sequence
number associated with MAC2. Also, even though (IP, MAC1) is withdrawn before
(IP, MAC2) is advertised, they may propagate through the network differently.

The procedures continue to rely on the MAC mobility extended community
specified in RFC 7432 and already supported by the implementation, but
augment it with a inheritance mechanism that understands the relationship
of the host MACIP (ARP/neighbor table entry) to the underlying MAC (MAC
forwarding database entry). In FRR, this relationship is understood by the
zebra component which doubles as the "host mobility manager", so the MAC
mobility sequence numbers are determined through interaction between bgpd
and zebra.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2018-08-20 19:20:06 +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
Philippe Guibert 8805512419 bgpd: add the pbr identifier in the log messages
for clarity sake, the identifier is inserted in the debug line.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-24 12:17:57 +02:00
Philippe Guibert c26edcda4e bgpd: flowspec pbr entries listed on the bgp information entry
Because one flowspec entry can create 1-N bgp pbr entries, the list is
now updated and visible. Also, because the bgp_extra structure is used,
this list is flushed when the bgp_extra structure is deleted.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-24 12:17:57 +02: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
Philippe Guibert 6f5617d877 bgpd: support for flowspec fragment list into policy routing
The flowspec fragment attribute is taken into account to be pushed in
BGP policy routing entries. Valid values are enumerate list of 1, 2, 4,
or 8 values. no combined value is supported yet.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-28 11:08:58 +02:00
Philippe Guibert 4977bd6c19 *: add flowspec dscp handling
Only one dscp value is accepted as filtering option.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-28 11:08:55 +02:00
Philippe Guibert 2da7d62e94 bgpd: support for flowspec tcp flags
Ability to handle flowspec tcp flags.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-28 08:52:15 +02:00
Philippe Guibert 83360720df bgpd: add support of bgp flowspec filtering per packet length
It is possible to do filtering based on packet length value or a range
of packet-length.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-28 08:52:15 +02:00
Russ White ebb46153b0
Merge pull request #2245 from donaldsharp/type_4
Support EVPN Type 4 Routes
2018-06-01 16:00:14 -04:00
Donald Sharp f220da9968 bgpd: Fix SA issue with uninited ifindex value
The rearrangement of where the decision point of
filling in the aggregate information, must have allowed
SA to find a path of code where we may use ifindex uninitialized.
While I don't think this is possible to happen, make this issue
go away.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-31 09:37:34 -04:00
mitesh 50f74cf131 *: support for evpn type-4 route
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-30 07:48:20 -04:00
Donald Sharp 5cc347c4b9 bgpd: Add null0 route back for aggregate-address route created.
The aggregate-address command is not creating the null0
route.  This got lost somewhere in the last year or so.
Add this ability back for BGP route installs into
zebra.

We need this aggregate route installed into the rib
because we are drawing this traffic to us irrelevant
of the number of routes we do have for that prefix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-29 20:04:17 -04:00
Philippe Guibert 6818e7e5c7 bgpd: do not install BGP FS entries, while table range not obtained
Sometimes at startup, BGP Flowspec may be allocated a routing table
identifier not in the range of the predefined table range.
This issue is due to the fact that BGP peering goes up, while the BGP
did not yet retrieve the Table Range allocator.
The fix is done so that BGP PBR entries are not installed while
routing table identifier range is not obtained. Once the routing table
identifier is obtained, parse the FS entries and check that all selected
entries are installed, and if not, install it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert f0936054e0 bgpd: brace zebra pbr traces
By default, some debug traces were displayed. Those pbr traces are
hidden with 'debug bgp zebra' command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert f18a08f518 bgpd: add ZAPI_XXX_FAIL_REMOVE flag in switch
The new enums for handling REMOVE failures are appended in the switch
case.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert 4762c2137d bgpd: add vty command to restrict FS policy routing to a defined interface
policy routing is configurable via address-family ipv4 flowspec
subfamily node. This is then possible to restrict flowspec operation
through the BGP instance, to a single or some interfaces, but not all.

Two commands available:
[no] local-install [IFNAME]

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert b588b642ce bgpd: display if FS entry is installed in PBR or not
Once PBR rules installed, an information is printed in the main
show bgp ipv4 flowspec detail information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert f730e5667d bgpd: add 3 fields to ipset_entry : src,dst port, and proto
Those 3 fields are read and written between zebra and bgpd.
This permits extending the ipset_entry structure.
Combinatories will be possible:
- filtering with one of the src/dst port.
- filtering with one of the range src/ range dst port
usage of src or dst is exclusive in a FS entry.
- filtering a port or a port range based on either src or dst port.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert b5c4010508 bgpd: do not account twice references to rule context
When rule add transaction is sent from bgpd to zebra, the reference
context must not be incremented while the confirmation message of
install has not been sent back; unless if the transaction failed to be
sent.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert d887503c65 bgpd: improve flowspec update of route to NH/VRF
The debugging message in charge of showing if the route is added or
witdrawn is changed accordingly to reflect this status.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert 82e194ed85 bgpd: add notify value in zlog notification message for pbr
notifications values from zebra related to pbr are dumped.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Donald Sharp ba1976dbf8 bgpd: Fix use of uninitialized variable
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-22 09:53:01 -04:00
Renato Westphal f403d10280
Merge pull request #2133 from Fredi-raspall/fix_label_manager
Fix broken label manager (proxy-mode) and improve of proxy function
2018-05-15 10:00:12 -03:00