summaryrefslogtreecommitdiffstats
path: root/ospf6d (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: require semicolon after DEFINE_HOOK & co.David Lamparter2021-03-174-4/+4
| | | | | | See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: require semicolon after DEFINE_MTYPE & coDavid Lamparter2021-03-175-43/+43
| | | | | | | | | | | | | | | | | Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
* snmp: change -std=gnu99 to -std=gnu11David Lamparter2021-03-171-1/+1
| | | | | | | The point of the `-std=gnu99` was to override a `-std=c99` that may be coming in from net-snmp. However, we want C11, not C99. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: fix printf extension typesDavid Lamparter2021-03-141-4/+4
| | | | | | Some mistakes have crept in again. Signed-off-by: David Lamparter <equinox@diac24.net>
* ospf6d: Convert to use builtin printf functionalityDonald Sharp2021-03-142-54/+24
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #8138 from ckishimo/ospfv3_prefixRuss White2021-03-093-39/+18
|\ | | | | ospf6d: fix LSA prefix options
| * ospf6d: add DN bit in prefix optionsckishimo2021-02-232-14/+9
| | | | | | | | | | | | | | | | | | | | | | According to RFC 5340 appendix A.4.1.1 0 1 2 3 4 5 6 7 +--+--+--+--+--+-+--+--+ | | | |DN| P|x|LA|NU| +--+--+--+--+--+-+--+--+ Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
| * ospf6d: remove redundant code when printing prefix optionsckishimo2021-02-231-38/+8
| | | | | | | | Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
| * ospf6d: print prefix options for lsa type 3 and 5ckishimo2021-02-231-1/+15
| | | | | | | | Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
* | Merge pull request #8185 from volta-networks/fix_ospf6_changing_area_to_stubDonald Sharp2021-03-074-2/+32
|\ \ | | | | | | ospf6d: Don't advertise AS-External LSAs into stub area
| * | ospf6d: Don't advertise AS-External LSAs into stub arealynne2021-03-034-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If area is a normal area and has adjacencies up and then the user changes the area to a stub area, the code was leaving existing AS-External LSAs in the database and was sending AS-External LSAs into the stub area causing the adjacency to stay in Ex-Start. With this change we now cleanup the AS-External LSAs that existed when area was not a stub and do not advertise AS-External LSAs into the stub area. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
* | | ospf6d: fix setting NOAUTOCOST flagEmanuele Di Pascale2021-03-031-2/+1
|/ / | | | | | | | | | | | | | | | | | | ospf6 keeps a flag to remember whether the cost for an interface was manually added via config or computed automatically, but if the configured value matches the auto-computed one we were not setting this flag, meaning that the config would not show up in the config. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* | ospf6d: Json support added for command "show ipv6 ospf6 spf tree [json]"Yash Ranjan2021-03-023-14/+75
| | | | | | | | | | | | | | Modify code to add JSON format output in show command "show ipv6 ospf6 spf tree" with proper formating Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* | ospf6d: turn some info->debugDonald Sharp2021-02-271-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The log is being spammed every spf interval: Feb 27 16:19:34 ospf6d[462371]: SPF processing: # Areas: 1, SPF runtime: 0 sec 2043 usec, Reason: R+, R-, N+ Feb 27 16:20:59 ospf6d[462371]: SPF: Scheduled in 0 msec Feb 27 16:20:59 ospf6d[462371]: SPF processing: # Areas: 1, SPF runtime: 0 sec 2284 usec, Reason: R+, R- Feb 27 16:21:01 ospf6d[462371]: SPF: Scheduled in 0 msec Feb 27 16:21:01 ospf6d[462371]: SPF processing: # Areas: 1, SPF runtime: 0 sec 2153 usec, Reason: R+, R-, N- There is no reason to do this Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | Merge pull request #8139 from volta-networks/fix_ospf6_show_databaseDonald Sharp2021-02-251-6/+15
|\ \ | | | | | | ospf6d: fix display of unknown LSAs in show ipv6 ospf6 database command
| * | ospf6d: fix display of unknown LSAs in show ipv6 ospf6 database commandlynne2021-02-231-6/+15
| |/ | | | | | | | | | | | | | | When an unknown LSA is in the database and the user issues the "show ipv6 ospf6 database" command there is a crash. The code currently doesn't properly handle display of unknown LSAs. Signed-off-by: Lynne Morrison <lynne@voltaio.net>
* | Merge pull request #8035 from qlyoung/remove-more-sprintfMark Stapp2021-02-233-8/+15
|\ \ | |/ |/| *: remove more sprintf()
| * *: remove more sprintf()Quentin Young2021-02-093-8/+15
| | | | | | | | | | | | | | Should be just a couple non-development, non-test occurrences of this function left now. Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
* | Merge pull request #8102 from volta-networks/fix_ospf6_error_logsDonald Sharp2021-02-191-30/+45
|\ \ | | | | | | ospf6d: Update logs that indicate why ospf6 adjacency is not coming up.
| * | ospf6d: Update logs that indicate why ospf6 adjacency is not coming up.lynne2021-02-181-30/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add more details to these logs to help make it easier to determine why ospf6 adjacency is not coming up. Also make these logs show up without having to turn on debug logging, again making it easier to debug the misconfiguration. Signed-off-by: Lynne Morrison <lynne@voltaio.net>
* | | ospf6d: Metric option in intra-prefix LSA detailYash Ranjan2021-02-191-1/+6
|/ / | | | | | | Signed-off-by: Yash Ranjan <ranjany@vmware.com>
* | Merge pull request #8051 from volta-networks/fix_ospf6_hello_loRuss White2021-02-161-2/+5
|\ \ | | | | | | ospf6d: Don't send hellos on loopback interface
| * | ospf6d: Don't send hellos on loopback interfacelynne2021-02-101-2/+5
| | | | | | | | | | | | | | | | | | | | | When ospf6 passive is turned off on a loopback interface don't start sending ospf6 hellos. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
* | | *: 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>