summaryrefslogtreecommitdiff
path: root/zebra
AgeCommit message (Collapse)Author
2020-02-25Merge pull request #5771 from pguibert6WIND/show_route_table_protocolDonald Sharp
vty: add command to get route with table, vrf and protocol
2020-02-19zebra: remove null check before XFREE in GR codeQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-19zebra: reduce scope of XCALLOC for gr processingQuentin Young
Somewhat gnarly code flow here that might be leaking memory - can't tell if it's a test artifact or not, but in any case this reduces the situations in which we need to alloc a block. And we don't need to check XCALLOC for success... And we don't need to null check before XFREE... Or set XFREE'd pointers to NULL... Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-19Merge pull request #5837 from ↵Donatas Abraitis
qlyoung/fix-zapi-pbr-unsupported-ip-family-log-message-newline zebra: remove \n in zapi pbr family log msg
2020-02-19zebra: remove \n in zapi pbr family log msgQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-19Merge pull request #5830 from mjstapp/fix_rtadv_stubsDonald Sharp
zebra: fix missing rtadv stub functions
2020-02-19Merge pull request #5809 from donaldsharp/vrf_nameDonatas Abraitis
Print out vrf name as well as id
2020-02-18zebra: fix missing rtadv stub functionsMark Stapp
Add in a few missing stub route-advert functions; these are needed to build frr with v6 route adverts disabled. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-18Merge pull request #5823 from donaldsharp/irdp_whatMark Stapp
Irdp build and log fixes
2020-02-18Merge pull request #5651 from AnuradhaKaruppiah/evpn-pim-fixesPhilippe Guibert
EVPN-PIM: complete anycast (MLAG) VTEP support
2020-02-18Merge pull request #5813 from mjstapp/zapi_labels_use_nhDonald Sharp
*: encode zapi labels message using nexthops
2020-02-18zebra: Fix checksum calculation to not include old checksumDonald Sharp
As part of checksum calculation for a received packet we were comparing the checksum returned from in_cksum. Typically when we calculate the checksum the value stored in the checksum must be all 0's. Store the received checksum and then set the checksum to 0 and then compare. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-18zebra: Fix zlog_debug -> flog_err for error situations in IRDPDonald Sharp
In several places we would send debug messages for failure situations that really should be errors. Signed-off-by: Donald Sharpd <sharpd@cumulusnetworks.com>
2020-02-18zebra: SO_BROADCAST needs a uint32_t instead of a uint8_tDonald Sharp
Using SO_BROADCAST, in the linux kernel, requires a uint32_t to be passed in for all SOL_SOCKET calls. Modify code to use it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14*: encode zapi labels message using nexthopsMark Stapp
Use the zapi_nexthop struct with the mpls_labels zapi messages instead of the special-purpose (and more limited) nexthop struct that was being used. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-14zebra: mlag debug was not being persistedAnuradha Karuppiah
Added the mlag keyword to the config level also (in addition to the view level). Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14zebra: add all ipv6 global addresses to RA messagesDon Slice
RFC 4861 states that ipv6 RA messages sent out an interface should contain all global ipv6 addresses on that interface. This fix adds that capability. To override the default flags and timer settings for a particular prefix, the existing "ipv6 nd prefix ..." command should be used via vtysh under the appropriate interface. Ticket: CM-20363 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2020-02-14zebra: Add vrf name to debug outputDonald Sharp
The vrf id is insufficient of a discriminator in people's head Give them what they need. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-13*: Remove break after returnDonatas Abraitis
Just a deadcode. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-12Merge pull request #5794 from mjstapp/remove_nexthop_matched_flagQuentin Young
lib,zebra: remove unused MATCHED nexthop flag
2020-02-11lib,zebra: remove unused MATCHED nexthop flagMark Stapp
Remove an unused flag value from the nexthop struct. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-11vty: add command to get route with table, vrf and protocolThibaut Collet
Today vtysh can show the ip/ip6 routes through several commands: - show_route_cmd - show_route_detail_cmd - show_route_summary_cmd - show_route_table_cmd - show_route_table_vrf_cmd - show_route_all_table_vrf_cmd Each command has its own set of filter rules: - show_route_cmd can filter by vrf, protocol, tag, ... but not by table - show_route_table_cmd always filter by table - show_route_table_vrf_cmd always filter by table and can filter by vrf too - show_route_all_table_vrf_cmd show all route in any table for a vrf (or all) To reduce the number of commands and provide a possibility to filter by any key add possibility for the show_route_cmd to filter by table with a specific value or all to get route in all tables. Then the show_route_table_cmd, show_route_table_vrf_cmd and show_route_all_table_vrf_cmd functions can be removed as they are covered by the generic show_route_cmd function. It is to be noted that when zebra is started by default, it is possible to execute show ip route command with both vrf and table parameters, whereas before the command was not displayed. This is due to the fact that this combination is only permitted when zebra is launched with vrf network namespace mode. There, if zebra is configured with vrf-lite backend, then a vty error message informs the user that the combination of both table and vrf is not possible. Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
2020-02-10Merge pull request #5763 from ton31337/fix/return_without_parentRenato Westphal
*: Remove parenthesis on return for constants
2020-02-09*: Remove parenthesis on return for constantsDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06Merge pull request #5722 from donaldsharp/kernel_routesRuss White
Kernel routes
2020-02-06*: Replace s_addr 0 => INADDR_ANYDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-05Merge pull request #5104 from opensourcerouting/route-map-nbv2Donald Sharp
lib: migrate route map to use northbound
2020-02-05Merge pull request #5750 from qlyoung/fix-null-after-xfreeRenato Westphal
*: don't null after XFREE; XFREE does this itself
2020-02-05Merge pull request #5760 from ton31337/fix/shorthand_operatorRenato Westphal
zebra: Use shorthand operator in ifm_read()
2020-02-04*: remove null check before XFREEQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-04zebra: Use shorthand operator in ifm_read()Donatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-04zebra, lib: Remove return from void functionsDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-04*: fix route map integrationRafael Zalamena
Add the appropriated code to bootstrap route map northbound for all daemons. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-02-04Merge pull request #5739 from mjstapp/nhg_show_orderedRenato Westphal
zebra: show zebra nexthop-groups without copying
2020-02-04Merge pull request #5746 from donaldsharp/bgp_saRuss White
Coverioty sa stuff
2020-02-04Merge pull request #5207 from Spantik/ZERBA_GRDonald Sharp
Zebra: Adding GR infrastructure for clients.
2020-02-04zebra: show zebra nexthop-groups without copyingMark Stapp
Use a hash walker/iterator instead of a temporary list to show zebra's nexthop-groups/nexthop-hash-entries. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-04Merge pull request #5737 from mjstapp/zebra_disable_kern_nhsRuss White
zebra: add config to disable use of kernel nexthops
2020-02-04zebra: top has already been derefedDonald Sharp
The top variable has already been derefed by the time we get to the test to see if it is non-NULL. No need to check it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-03*: don't null after XFREE; XFREE does this itselfQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-31zebra: nexthop groups vrf's are only a function of namespacesDonald Sharp
Nexthop groups as a whole do not make sense to have a vrf'ness As that you can have a arbitrary number of nexthops that point to separate vrf's. Modify the code to make this distinction, by clearly delineating the line between the nhg and the nexthop a bit better. Nexthop groups having a vrf_id only make sense if you are using network namespaces to represent them. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-31zebra: Modify 'show nexthop-group rib ip|ipv6'Donald Sharp
The zebra implementation of nexthop groups has two types of nexthops groups currently. Singleton objects which have afi's and combined nexthop groups that do not. Specifically call this out in the code to make this distinction. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-31zebra: Capabality and stale route handling for GR client.Santosh P K
Handling capability received from client. It may contain GR enable/disable, Stale time changes, RIB update complete for given AFi, ASAFI and instance. It also has changes for stale route handling. Signed-off-by: Santosh P K <sapk@vmware.com>
2020-01-30zebra: add null check before connecting recursive dependStephen Worley
Add a null check in `handle_recursive_depend()` so it doesn't try to add a NULL pointer to the RB tree. This was found with clang SA. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-01-30zebra: reset nexthop pointer in zread of nexthopsStephen Worley
We were not resetting the nexthop pointer to NULL for each new read of a nexthop from the zapi route. On the chance we get a nexthop that does not have a proper type, we will not create a new nexthop and update that pointer, thus it still has the last valid one and will create a group with two pointers to the same nexthop. Then when it enters any code that iterates the group, it loops endlessly. This was found with zapi fuzzing. ``` 0x00007f728891f1c3 in jhash2 (k=<optimized out>, length=<optimized out>, initval=12183506) at lib/jhash.c:138 0x00007f728896d92c in nexthop_hash (nexthop=<optimized out>) at lib/nexthop.c:563 0x00007f7288979ece in nexthop_group_hash (nhg=<optimized out>) at lib/nexthop_group.c:394 0x0000000000621036 in zebra_nhg_hash_key (arg=<optimized out>) at zebra/zebra_nhg.c:356 0x00007f72888ec0e1 in hash_get (hash=<optimized out>, data=0x7ffffb94aef0, alloc_func=0x0) at lib/hash.c:138 0x00007f72888ee118 in hash_lookup (hash=0x7f7288de2f10, data=0x7f728908e7fc) at lib/hash.c:183 0x0000000000626613 in zebra_nhg_find (nhe=0x7ffffb94b080, id=0, nhg=0x6020000032d0, nhg_depends=0x0, vrf_id=<optimized out>, afi=<optimized out>, type=<optimized out>) at zebra/zebra_nhg.c:541 0x0000000000625f39 in zebra_nhg_rib_find (id=0, nhg=<optimized out>, rt_afi=AFI_IP) at zebra/zebra_nhg.c:1126 0x000000000065f953 in rib_add_multipath (afi=AFI_IP, safi=<optimized out>, p=0x7ffffb94b370, src_p=0x0, re=0x6070000013d0, ng=0x7f728908e7fc) at zebra/zebra_rib.c:2616 0x0000000000768f90 in zread_route_add (client=0x61f000000080, hdr=<optimized out>, msg=<optimized out>, zvrf=<optimized out>) at zebra/zapi_msg.c:1596 0x000000000077c135 in zserv_handle_commands (client=<optimized out>, msg=0x61b000000780) at zebra/zapi_msg.c:2636 0x0000000000575e1f in main (argc=<optimized out>, argv=<optimized out>) at zebra/main.c:309 ``` ``` (gdb) p *nhg->nexthop $4 = {next = 0x5488e0, prev = 0x5488e0, vrf_id = 16843009, ifindex = 16843009, type = NEXTHOP_TYPE_IFINDEX, flags = 8 '\b', {gate = {ipv4 = {s_addr = 0}, ipv6 = {__in6_u = {__u6_addr8 = '\000' <repeats 15 times>, __u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {0, 0, 0, 0}}}}, bh_type = BLACKHOLE_UNSPEC}, src = {ipv4 = {s_addr = 0}, ipv6 = {__in6_u = {__u6_addr8 = '\000' <repeats 15 times>, __u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {0, 0, 0, 0}}}}, rmap_src = {ipv4 = {s_addr = 0}, ipv6 = {__in6_u = {__u6_addr8 = '\000' <repeats 15 times>, __u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {0, 0, 0, 0}}}}, resolved = 0x0, rparent = 0x0, nh_label_type = ZEBRA_LSP_NONE, nh_label = 0x0, weight = 1 '\001'} (gdb) quit ``` Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-01-30zebra: don't created connected if duplicate dependStephen Worley
Since we are using a UNIQUE RB tree, we need to handle the case of adding in a duplicate entry into it. The list API code returns NULL when a successfull add occurs, so lets pull that handling further up into the connected handlers. Then, free the allocated connected struct if it is a duplicate. This is a pretty unlikely situation to happen. Also, pull up the RB handling of _del RB API as well. This was found with the zapi fuzzing code. ``` ==1052840== ==1052840== 200 bytes in 5 blocks are definitely lost in loss record 545 of 663 ==1052840== at 0x483BB1A: calloc (vg_replace_malloc.c:762) ==1052840== by 0x48E1008: qcalloc (memory.c:110) ==1052840== by 0x44D357: nhg_connected_new (zebra_nhg.c:73) ==1052840== by 0x44D300: nhg_connected_tree_add_nhe (zebra_nhg.c:123) ==1052840== by 0x44FBDC: depends_add (zebra_nhg.c:1077) ==1052840== by 0x44FD62: depends_find_add (zebra_nhg.c:1090) ==1052840== by 0x44E46D: zebra_nhg_find (zebra_nhg.c:567) ==1052840== by 0x44E1FE: zebra_nhg_rib_find (zebra_nhg.c:1126) ==1052840== by 0x45AD3D: rib_add_multipath (zebra_rib.c:2616) ==1052840== by 0x4977DC: zread_route_add (zapi_msg.c:1596) ==1052840== by 0x49ABB9: zserv_handle_commands (zapi_msg.c:2636) ==1052840== by 0x428B11: main (main.c:309) ``` Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-01-30zebra: Handling of connection disconnect and connect with GR.Santosh P K
Zebra will have special handling for clients with GR enabled. When client disconnects with GR enabled, then a stale client will be created and its RIB will be retained till stale timer or client comes up and updated its RIB. Co-authored-by: Santosh P K <sapk@vmware.com> Co-authored-by: Soman K S <somanks@vmware.com> Signed-off-by: Santosh P K <sapk@vmware.com>
2020-01-30zebra: Header file changes and show commands.Santosh P K
Adding header files changes where structure to hold received graceful restart info from client is defined. Also there are changes for show commands where exisiting commands are extended. Co-authored-by: Santosh P K <sapk@vmware.com> Co-authored-by: Soman K S <somanks@vmware.com> Signed-off-by: Santosh P K <sapk@vmware.com>
2020-01-28zebra: add config to disable use of kernel nexthopsMark Stapp
Add a config that disables use of kernel-level nexthop ids. Currently, zebra always uses nexthop ids if the kernel supports them. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-01-28Merge pull request #5706 from mjstapp/fix_nh_debug_showRuss White
zebra: include zebra nexthop debug in show runn