summaryrefslogtreecommitdiffstats
path: root/bgpd (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-05-29zebra: fix uninitialized valueQuentin Young1-6/+6
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29zebra: handle label manager & fuzzing growthsQuentin Young2-33/+54
Label manager reaches its hands into session / IO code for zserv for whatever reason, gotta handle that. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29zebra: optimize zserv_process_messagesQuentin Young3-60/+44
* Simplify zapi_msg <-> zserv interaction * Remove header validity checks, as they're already performed before the packet ever makes it here * Perform the same kind of batch processing done in zserv_write by copying multiple inbound packets under lock instead of doing serial locking * Perform self-scheduling under the same lock Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29zebra: optimize zserv_writeQuentin Young1-22/+32
Dequeue all pending messages when writing and push them all into the write buffer. This removes the necessity to self-schedule, avoiding a mutex lock, and should also maximize throughput by not writing 1 packet per job. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29zserv: optimize zserv_readQuentin Young2-12/+27
* Increase the maximum number of packets to read per read job * Store read packets in a local cached buffer to avoid mutex overhead * Only update last-read time / last-command if we actually read a packet * Add missing log line for corrupt header case Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29zebra: refactor zserv names, consolidate eventsQuentin Young13-113/+223
* Add centralized thread scheduling dispatchers for client threads and the main thread * Rename everything in zserv.c to stop using a combination of: - zebra_server_* - zebra_* - zserv_* Everything in zserv.c now begins with zserv_*. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29zebra: reorganize zserv.c by pthread affinityQuentin Young1-258/+274
Since it is already quite difficult to understand the various pieces going on here, I reorganized the file to make it much cleaner and easier to understand. The organization is now: zserv.c: ,---------------------------------. / include statements | | ... | | ... | | -------------------------------- | | Client pthread server functions | | ... | | ... | | -------------------------------- | | Main pthread server functions | | ... | | ... | | -------------------------------- | | CLI commands, other | | ... | | ... | \_________________________________/ No code has been changed; the functions have merely been moved around. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29zebra: fix session stats data race, memory leakQuentin Young2-40/+96
* Time counters need to use atomic access between threads * After a client disconnects, we properly kill the thread but need to free its frr_pthread as well Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29zebra: fix some memory errors, scheduling bugsQuentin Young2-3/+8
* Add doc comments explaining hairy bits of thread lifecycle * Remove t_suicide as it no longer makes sense * Remove client double-free * Remove unnecessary THREAD_OFF being used in incorrect pthread context * Eliminate unnecessary racey access to client's obuf_fifo * Ensure zserv_process_messages() reschedules itself if it has not finished its work Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29zebra: multithreaded zservQuentin Young3-72/+165
Handle each zclient in its own thread. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29lib: make allocators work for allocation sizes of 0Christian Franke1-1/+4
Fixes: #2155 Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-05-28tests: add pytest cache to gitignoreChristian Franke1-0/+1
2018-05-28isisd: fix bug in tlv_copy of empty MT-router-infoChristian Franke1-1/+1
2018-05-26bgpd: issue 2263: fix "no label vpn export auto"G. Paul Ziemba1-0/+4
This command should unset the label (instead of wrongly setting to "auto") Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-05-26zebra: Add a breadcrumb for when we ignore a routeDonald Sharp1-1/+5
When we receive a route that we think we own and we are not in startup conditions, then add a small debug to help debug the issue when this happens, instead of silently just ignoring the route. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-26tools, zebra: Use different protocol value for our staticsDonald Sharp5-2/+7
The re-use of RTPROT_STATIC has caused too many collisions where other legitimate route sources are causing us to believe we are the originator of the route. Modify the code so that if another protocol inserts RTPROT_STATIC we will assume it's a Kernel Route. Fixes: #2293 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-25zebra/if_netlink: trivial cleanup of IFLA_WIRELESSArthur Jones1-4/+0
With: commit ba7773964c87019308e65a15b509e9889f7edc49 Author: Renato Westphal <renato@opensourcerouting.org> Date: Wed Sep 20 22:12:56 2017 -0300 We added our own copy of if_link.h (among others). This file unconditionally defines IFLA_WIRELESS, so we don't need the conditional defines in the if_netlink.c code... Issue: https://github.com/FRRouting/frr/issues/2299 Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
2018-05-25bgpd: sort vni's in running configQuentin Young1-12/+20
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-25lib: add proper doc comments for hash & linklistQuentin Young4-83/+436
* Remove references to ospf source files from linklist.[ch] * Remove documentation comments from hash.c and linklist.c * Add comprehensive documentation comments to linklist.h and hash.h Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-25lib: add hash_to_list()Quentin Young2-0/+24
Convenience function to convert hash table to an unsorted linked list. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-25lib: add list_sort(), list_dup()Quentin Young2-0/+42
* list_dup(): duplicates a linked list * list_sort(): in-place sort of linked list w/ ascending quicksort Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-25bgpd: attributes presence checked when mpreach is presentPhilippe Guibert1-1/+2
On the case where an mp_unreach attribute is received, while there is no mp_reach attribute too, it is not necessary to check for missing attributes. Fixes: 67495ddb2e5b ("bgpd: Fixes for recent well-known-attr check patch.") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25bgpd: do not install BGP FS entries, while table range not obtainedPhilippe Guibert4-6/+32
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-25bgpd: enhance debug bgp pbr error vty commandPhilippe Guibert1-4/+37
Added following vty command: [no] debug bgp pbr error This permits dumping on the logs some errors related to PBR. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25bgpd: increase buffer size to store ecomunity as a stringPhilippe Guibert1-1/+1
On the case where an ecom from FS redirect is received, the ecom may be with the format A.B.C.D:E. On this case, the printable format of the Flowspec redirect VRF ecom value may use more bytes in the buffer dedicated for that. The buffer that stores the ecommunity is increased. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25bgpd: brace zebra pbr tracesPhilippe Guibert1-9/+16
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-25bgpd: add ZAPI_XXX_FAIL_REMOVE flag in switchPhilippe Guibert1-0/+4
The new enums for handling REMOVE failures are appended in the switch case. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25pbrd: add ZAPI_RULE_FAIL_REMOVE flag in switchPhilippe Guibert1-0/+1
The notification handler consecutive to an add/remove of a rule in zebra is being added the FAIL_REMOVE flag. It is mapped on REMOVE flag behaviour for now. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25bgpd: upon uninstalling pbr rule, update local structurePhilippe Guibert1-0/+2
Currently, uninstall pbr rule is not handled by BGP notification handler. So the uninstall update of the structure is done, immediately after sending the request of uninstall to zebra. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25zebra: add pbr objects fail_remove value into notificationPhilippe Guibert2-4/+8
After PBR or BGP sends back a request for sending a rule/ipset/ipset entry/iptable delete, there may be issue in deleting it. A notification is sent back with a new value indicating that the removal failed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25zebra: PBR show debugging IPSET/IPTABLE hooks declaredPhilippe Guibert2-0/+5
This hook can be used if the plugin module wrap_script is used. This hook is called to dump the debugging status of this module, on the vty. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25zebra: PBR config and monitor IPSET/IPTABLE hooks declaredPhilippe Guibert2-24/+125
The following PBR handlers: ipset, and iptables will prioritary call the hook from a possible plugin. If a plugin is attached, then it will return a positive value. That is why the return status is tested against 0 value, since that means that there are no plugin module plugged Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25bgpd: initialise nexthop structure, before filling in some attributesPhilippe Guibert1-0/+1
In order to have a clean structure, a reset is done before using the struct nexthop. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25bgpd: traffic rate value is ignored for searching bpaPhilippe Guibert1-3/+1
There are cases where a redirect IP or redirect VRF stops the ecom parsing, then ignores a subsequent rate value, letting passed value to 0. Consequently, a new table identifier may be elected, despite the routing procedure is the same. This fix ignores the rate value in bpa list. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25bgpd: handle more than one ext. communityPhilippe Guibert1-3/+3
The ecommunity was badly read. This fix ensures that all ecom are reads and stored in local structure. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25bgpd: add vty command to restrict FS policy routing to a defined interfacePhilippe Guibert7-1/+228
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-25bgpd: display if FS entry is installed in PBR or notPhilippe Guibert5-8/+50
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-25bgpd: pbr support for port redirectingPhilippe Guibert2-29/+235
Ability for BGP FS to convert some rules containining at least one address and one port information into a pbr_match_entry rule. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25bgpd: add 3 fields to ipset_entry : src,dst port, and protoPhilippe Guibert2-0/+12
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-25bgpd: do not account twice references to rule contextPhilippe Guibert1-3/+7
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-25bgpd: add missing ecommunity flowspec to displayPhilippe Guibert1-19/+24
On some cases, the ecommunity flowspec for redirect vrf is not displayed in all cases. On top of that, display the values if ecom can no be decoded. Also, sub_type and type are changed from int to u_int8_t, because the values contains match the type and sub type of extended communities. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25zebra: update comment when calling pbr southbound interfacePhilippe Guibert1-7/+2
Some documentation is updated. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25bgpd: improve flowspec update of route to NH/VRFPhilippe Guibert1-2/+4
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-25bgpd: add notify value in zlog notification message for pbrPhilippe Guibert1-6/+6
notifications values from zebra related to pbr are dumped. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25zebra: handle iptable list of interfacesPhilippe Guibert3-3/+55
Upon reception of an iptable_add or iptable_del, a list of interface indexes may be passed in the zapi interface. The list is converted in interface name so that it is ready to be passed to be programmed to the underlying system. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25zebra: add 3 fields to ipset_entry : src,dst port, and protoPhilippe Guibert4-7/+94
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-25zebra: pbr vty show command for ipset and iptablesPhilippe Guibert3-0/+226
Two new vty show functions available: show pbr ipset <NAME> show pbr iptables <NAME> Those function dump the underlying "kernel" contexts. It relies on the zebra pbr contexts. This helps then to know which zebra pbr context has been configured since those contexts are mainly configured by BGP Flowspec. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25zebra: add netlink rule support for fwmark optionPhilippe Guibert2-0/+8
When a mark is set, incoming traffic having that mark set can be redirected to a specific table identifier. This work is done through netlink. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25zebra: handle notification in case pbr ipset, or iptables is removedPhilippe Guibert1-3/+13
In cast the removal of an iptable or an ipset pbr context is done, then a notification is sent back to the relevant daemon that sent the message. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25zebra: cleanup zebra policy contextPhilippe Guibert1-0/+36
Upon the remote daemon leaving, some contexts may have to be flushed. This commit does the change. IPset and IPSet Entries and iptables are flushed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>