summaryrefslogtreecommitdiffstats
path: root/ospf6d (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: remove tabs & newlines from log messagesDavid Lamparter2021-02-141-1/+1
| | | | | | | Neither tabs nor newlines are acceptable in syslog messages. They also break line-based parsing of file logs. Signed-off-by: David Lamparter <equinox@diac24.net>
* ospf6d : fix issue in ecmp inter area routeSoman K S2021-02-102-12/+41
| | | | | | | | | | | | | | Issue: When a path in the inter area ecmp route is deleted, the route is removed Fix: The fix is to remove the specific path from the inter area route using ospf6_abr_old_route_remove() when abr route entry is not found. In the function ospf6_abr_old_route_remove() the path to be removed needs to match adv router and link state ID Fixed memory leak in ospf6_intra_prefix_update_route_origin() caused by route node lock not getting released. Signed-off-by: kssoman <somanks@gmail.com>
* Merge pull request #7980 from gromit1811/fix_ospf6_lsa_str_oobRuss White2021-02-091-5/+6
|\ | | | | Fix ospf6 LSA formatting out-of-bounds access
| * ospf6d: Fix LSA formatting out-of-bounds accessMartin Buck2021-01-291-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check whether full struct ospf6_router_lsdesc/ospf6_prefix is accessible before accessing its contents. Previously, we only checked for the first byte in ospf6_router_lsa_get_nbr_id() or not even that (due to an additional off-by-one error) in ospf6_link_lsa_get_prefix_str() and ospf6_intra_prefix_lsa_get_prefix_str(). Also check *before* accessing the first prefix instead of starting the checks only at the 2nd prefix. The previous code could cause out-of-bounds accesses with valid LSAs in case of ospf6_link_lsa_get_prefix_str() and ospf6_intra_prefix_lsa_get_prefix_str() and with specially crafted LSAs (bad length field) in case of ospf6_router_lsa_get_nbr_id(). Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
* | Merge pull request #7981 from gromit1811/fix_ospf6_lsa_str_retvalQuentin Young2021-02-051-8/+10
|\ \ | | | | | | ospf6d: Fix LSA formatting inconsistent retvals
| * | ospf6d: Fix LSA formatting inconsistent retvalsMartin Buck2021-01-291-8/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | Make return values for lh_get_prefix_str LSA handlers consistent, i.e. return NULL in case of error without having written to the passed buffer and non-NULL (address of buffer) if a string was written to the buffer. Previously, it was possible in certain cases (bogus LSAs) to not initialize (and 0-terminate) the buffer but still return non-NULL, causing the caller to print random junk. Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
* | Merge pull request #7961 from mobash-rasool/ospfv3-featureMark Stapp2021-02-045-4/+85
|\ \ | | | | | | ospf6d: add CLI to control maximum paths for routes.
| * | ospf6d: add CLI to control maximum paths for routes.Mobashshera Rasool2021-02-015-4/+85
| |/ | | | | | | | | | | | | | | | | CLI added: maximum-paths (1-64) Issue: #7961 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* | Merge pull request #7991 from donaldsharp/valgrind_cleanups1Russ White2021-02-021-2/+6
|\ \ | | | | | | Valgrind cleanups
| * | ospf6d: prevent use after freeDonald Sharp2021-02-011-2/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Valgrind reports: 2437395-==2437395== Invalid read of size 8 2437395:==2437395== at 0x40B610: ospf6_asbr_update_route_ecmp_path (ospf6_asbr.c:327) 2437395-==2437395== by 0x40BC7C: ospf6_asbr_lsa_add (ospf6_asbr.c:544) 2437395-==2437395== by 0x40C5DF: ospf6_asbr_lsentry_add (ospf6_asbr.c:829) 2437395-==2437395== by 0x42D88D: ospf6_top_brouter_hook_add (ospf6_top.c:185) 2437395-==2437395== by 0x4188E3: ospf6_intra_brouter_calculation (ospf6_intra.c:2320) 2437395-==2437395== by 0x42C624: ospf6_spf_calculation_thread (ospf6_spf.c:638) 2437395-==2437395== by 0x4904B7E: thread_call (thread.c:1681) 2437395-==2437395== by 0x48CAA27: frr_run (libfrr.c:1126) 2437395-==2437395== by 0x40AF43: main (ospf6_main.c:232) 2437395-==2437395== Address 0x5c668a8 is 24 bytes inside a block of size 256 free'd 2437395:==2437395== at 0x48399AB: free (vg_replace_malloc.c:538) 2437395-==2437395== by 0x429027: ospf6_route_delete (ospf6_route.c:419) 2437395-==2437395== by 0x429027: ospf6_route_unlock (ospf6_route.c:460) 2437395-==2437395== by 0x429027: ospf6_route_remove (ospf6_route.c:887) 2437395-==2437395== by 0x40B343: ospf6_asbr_update_route_ecmp_path (ospf6_asbr.c:318) 2437395-==2437395== by 0x40BC7C: ospf6_asbr_lsa_add (ospf6_asbr.c:544) 2437395-==2437395== by 0x40C5DF: ospf6_asbr_lsentry_add (ospf6_asbr.c:829) 2437395-==2437395== by 0x42D88D: ospf6_top_brouter_hook_add (ospf6_top.c:185) 2437395-==2437395== by 0x4188E3: ospf6_intra_brouter_calculation (ospf6_intra.c:2320) 2437395-==2437395== by 0x42C624: ospf6_spf_calculation_thread (ospf6_spf.c:638) 2437395-==2437395== by 0x4904B7E: thread_call (thread.c:1681) 2437395-==2437395== by 0x48CAA27: frr_run (libfrr.c:1126) 2437395-==2437395== by 0x40AF43: main (ospf6_main.c:232) 2437395-==2437395== Block was alloc'd at 2437395:==2437395== at 0x483AB65: calloc (vg_replace_malloc.c:760) 2437395-==2437395== by 0x48D2A32: qcalloc (memory.c:115) 2437395-==2437395== by 0x427CE4: ospf6_route_create (ospf6_route.c:402) 2437395-==2437395== by 0x40BA8A: ospf6_asbr_lsa_add (ospf6_asbr.c:490) 2437395-==2437395== by 0x40C5DF: ospf6_asbr_lsentry_add (ospf6_asbr.c:829) 2437395-==2437395== by 0x42D88D: ospf6_top_brouter_hook_add (ospf6_top.c:185) 2437395-==2437395== by 0x4188E3: ospf6_intra_brouter_calculation (ospf6_intra.c:2320) 2437395-==2437395== by 0x42C624: ospf6_spf_calculation_thread (ospf6_spf.c:638) 2437395-==2437395== by 0x4904B7E: thread_call (thread.c:1681) 2437395-==2437395== by 0x48CAA27: frr_run (libfrr.c:1126) 2437395-==2437395== by 0x40AF43: main (ospf6_main.c:232) ospfv3 loops through the ecmp routes to decide what to clean up. In some situations the code free's up an existing route at the head of the list. Cleaning the pointers in the list but never touching the original pointer. In that case notice and update the old pointer. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | Merge pull request #7402 from ranjanyash54/dev_2Donald Sharp2021-02-025-103/+345
|\ \ | |/ |/| ospf6d: Json support added for command "show ipv6 ospf6 route [json]"
| * ospf6d: Json support added for command "show ipv6 ospf6 interface prefix [json]"Yash Ranjan2021-01-271-6/+10
| | | | | | | | | | | | | | Modify code to add JSON format output in show command "show ipv6 ospf6 interface prefix" with proper formating Signed-off-by: Yash Ranjan <ranjany@vmware.com>
| * ospf6d: Json support added for command "show ipv6 ospf6 route [json]"Yash Ranjan2021-01-275-99/+337
| | | | | | | | | | | | | | | | | | Modify code to add JSON format output in show command "show ipv6 ospf6 route [<intra-area|inter-area|external-1| external-2|X:X::X:X|X:X::X:X/M|detail|summary>]" with proper formating Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* | ospf6d: Remove #if 0 code that has not been used in a long timeDonald Sharp2021-01-283-118/+0
|/ | | | | | | The earliest that some of this code is 2018. There is not much point in keeping this code around. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* ospf6d: Track wait_timer and disable when neededDonald Sharp2021-01-262-1/+4
| | | | | | | | | | | | When removing ospfv3 from an interface that has been previously put into wait state, there is a possible use after free of the oi because the wait_timer could have been started for the interface. This is because the wait_timer was not tracked by the interface and we just created a thread for it without storing the thread pointer. Issue: #7932 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* ospf6d: use a new json_object per loop iterationDonald Sharp2021-01-251-5/+4
| | | | | | | | When redistributing multiple route types into ospfv3 the code must create a new array per route type into the the json code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* ospf6d: Json support added for command "show ipv6 ospf6 database [json]"Yash Ranjan2021-01-137-149/+461
| | | | | | | Modify code to add JSON format output in show command "show ipv6 ospf6 database" with proper formating Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* ospf6d: Structural changes in ospf6d.cYash Ranjan2021-01-132-495/+303
| | | | | | | Removes the code redundancy for the show ipv6 ospf6 database command. Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* Merge pull request #7717 from ranjanyash54/2368Russ White2020-12-151-1/+2
|\ | | | | ospf6d: ospfv3 disable on the interface, but interface prefix still s…
| * ospf6d: ospfv3 disable on the interface, but interface prefix still shown in ↵Yash Ranjan2020-12-131-1/+2
| | | | | | | | | | | | | | | | | | the output When the ospfv3 interface is disabled by the command "no interface <eth> area <area-id> the linked interface prefixes does not get flushed Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* | ospf6d: Link LSA is not updated when router priority is modifiedMobashshera Rasool2020-12-141-0/+1
|/ | | | | | Issue: #7727 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
* ospf6d: Fix for "show ipv6 ospf6 database link"Yash Ranjan2020-12-111-3/+2
| | | | | | | Some prefixes were not shown in the link database show command, due to issues with pointer calculation. Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* ospf6d: Fix for "show ipv6 ospf6 database intra-prefix"Yash Ranjan2020-12-111-3/+2
| | | | | | | Some prefixes were not shown in the intra-prefix database show command, due to issues with pointer calculation. Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* Merge pull request #7492 from Niral-Networks/niral_ospfv3_fix_redistRafael Zalamena2020-12-106-91/+180
|\ | | | | ospf6d : Code refactoring for route redistribution.
| * ospf6d : Code refactoring for route redistribution.Kaushik2020-12-096-91/+180
| | | | | | | | | | | | | | | | | | | | | | | | 1. Created new ospf6_redist structure. 2. Moved the 'route_map' structure from structure 'ospf6' to structure 'ospf6_redist'. 3. Added new message type OSPF6_REDISTRIBUTE. 4. Added the placeholder for metric option in structure ospf6_redist for redistribute. 5. Added few API's for route redistribute lookup, add & del. Signed-off-by: Kaushik <kaushik@niralnetworks.com>
* | ospf6d: Router-ID filter is not filtering the show command "do show ipv6 ↵Yash Ranjan2020-12-041-3/+4
| | | | | | | | | | | | | | | | | | ospf6 neighbour A.B.C.D" Compare the neighbour id string from the arguments to the router_id of the neighbor. If equal then call the show function. Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* | ospf6: move serv_close to ospf6_deleteIgor Ryzhov2020-11-302-4/+4
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | ospf6: fix crash on shutdownIgor Ryzhov2020-11-303-7/+8
| | | | | | | | | | | | The crash is sometimes reproduced by all_protocol_startup topotest. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | ospf6: get instance from lsdb dataIgor Ryzhov2020-11-304-8/+8
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | ospf6: get instance from route table scopeIgor Ryzhov2020-11-3011-149/+131
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | ospf6: don't create instance at startupIgor Ryzhov2020-11-191-6/+0
|/ | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* ospf6d: More lists being leakedDonald Sharp2020-11-191-4/+2
| | | | | | | | | | | | | | | Apparently the person who wrote this code was big into cut-n-paste. Commit 710a61d57c8f1b0ea66a37f09bad2161d7e2ddb7 found the first instance, but upon code inspection this morning it became evident that 2 other functions had the exact same problem. Fix. Note I have not cleaned up the cut-n-paste code for two reasons: a) I'm chasing something else b) this code has been fairly un-maintained for a very long time. No need to start up now. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #7454 from ranjanyash54/dev_8Donald Sharp2020-11-191-33/+132
|\ | | | | ospf6d: Json support added for command "show ipv6 ospf6 interface traffic [json]"
| * ospf6d: Json support added for command "show ipv6 ospf6 interface traffic ↵github login name2020-11-161-33/+133
| | | | | | | | | | | | | | | | | | [json]" Modify code to add JSON format output in show command "show ipv6 ospf6 interface traffic" with proper formating Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* | Merge pull request #7455 from ranjanyash54/dev_3Donald Sharp2020-11-191-26/+106
|\ \ | | | | | | ospf6d: Json support added for command "show ipv6 ospf6 redistribute [json]"
| * | ospf6d: Json support added for command "show ipv6 ospf6 redistribute [json]"github login name2020-11-161-26/+106
| |/ | | | | | | | | | | | | Modify code to add JSON format output in show command "show ipv6 ospf6 redistribute" with proper formating Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* | Merge pull request #7296 from YashRanjanVMWare/dev_1Donald Sharp2020-11-183-95/+269
|\ \ | | | | | | ospf6d: Json support added for command "show ipv6 ospf6 [json]"
| * | ospf6d: Json support added for command "show ipv6 ospf6 [json]"github login name2020-11-173-95/+269
| |/ | | | | | | | | | | | | Modify code to add JSON format output in show command "show ipv6 ospf6" with proper formating. Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* | Merge pull request #7556 from donaldsharp/memory_shenanigansMark Stapp2020-11-181-2/+1
|\ \ | | | | | | Memory shenanigans
| * | ospf6d: Free up list memoryDonald Sharp2020-11-181-2/+1
| | | | | | | | | | | | | | | | | | | | | OSPFv3 snmp code creates a list but never deletes the actual list. Do so. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | Merge pull request #7555 from idryzhov/cppcheck-fixesMark Stapp2020-11-181-3/+3
|\ \ \ | | | | | | | | fix a couple of issues found by cppcheck
| * | | ospf6d: fix compilation of debug codeIgor Ryzhov2020-11-181-3/+3
| |/ / | | | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | | Merge pull request #7478 from donaldsharp/bufferMark Stapp2020-11-181-1/+1
|\ \ \ | |/ / |/| | Buffer
| * | bgpd, lib, sharpd: Add enum for zclient_send_message returnDonald Sharp2020-11-151-1/+1
| |/ | | | | | | | | | | | | | | Add a `enum zclient_send_status` for appropriate handling of return codes from zclient_send_message. Touch all the places where we handle this. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | Merge pull request #7450 from ranjanyash54/dev_5Russ White2020-11-171-17/+51
|\ \ | | | | | | ospf6d: Json support added for command "show ipv6 ospf6 zebra [json]"
| * | ospf6d: Json support added for command "show ipv6 ospf6 zebra [json]"github login name2020-11-171-17/+51
| |/ | | | | | | | | | | | | Modify code to add JSON format output in show command "show ipv6 ospf6 zebra" with proper formating Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* | Merge pull request #7453 from ranjanyash54/dev_7Russ White2020-11-173-86/+272
|\ \ | | | | | | ospf6d: Json support added for command "show ipv6 ospf6 interface [json]"
| * | ospf6d: Json support added for command "show ipv6 ospf6 interface [json]"github login name2020-11-173-86/+272
| |/ | | | | | | | | | | | | Modify code to add JSON format output in show command "show ipv6 ospf6 interface" with proper formating Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* / *: Remove route_map_object_t from the systemDonald Sharp2020-11-141-33/+13
|/ | | | | | | | | | | | | The route_map_object_t was being used to track what protocol we were being called against. But each protocol was only ever calling itself. So we had a variable that was only ever being passed in from route_map_apply that had to be carried against and everyone was testing if that variable was for their own stack. Clean up this route_map_object_t from the entire system. We should speed some stuff up. Yes I know not a bunch but this will add up. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #7448 from mjstapp/fix_gcc10_formatsDonald Sharp2020-11-101-8/+5
|\ | | | | * : clean up format specifiers for gcc-10