summaryrefslogtreecommitdiffstats
path: root/ospf6d (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #17363 from ↵Donatas Abraitis2024-11-061-1/+1
|\ | | | | | | | | acooks-at-bda/fix-redundant-null-ptr-check-CID-1599962 ospf6d: remove redundant null ptr check
| * ospf6d: remove redundant null ptr checkAndrew Cooks2024-11-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix defect flagged by Coverity: *** CID 1599962: Null pointer dereferences (REVERSE_INULL) /ospf6d/ospf6_intra.c: 775 in ospf6_intra_prefix_lsa_get_prefix_str() 769 { 770 struct ospf6_prefix *prefix = nth_prefix(lsa->header, pos); 771 struct in6_addr in6 = { 0 }; 772 char tbuf[16]; 773 774 /* ensure buflen >= INET6_ADDRSTRLEN + '/128\0' */ >>> CID 1599962: Null pointer dereferences (REVERSE_INULL) >>> Null-checking "lsa" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. 775 if (!lsa || !prefix || !buf || buflen < (5 + INET6_ADDRSTRLEN)) 776 return NULL; 777 778 memcpy(&in6, OSPF6_PREFIX_BODY(prefix), 779 OSPF6_PREFIX_SPACE(prefix->prefix_length)); 780 inet_ntop(AF_INET6, &in6, buf, buflen); The check for lsa being not-null happens in ospf6_lsdb_show() and first dereference happens in ospf6_lsa_show_summary() Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: remove redundant null ptr checkAndrew Cooks2024-11-061-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Fix defect flagged by Coverity: *** CID 1599957: Null pointer dereferences (REVERSE_INULL) /ospf6d/ospf6_intra.c: 581 in ospf6_link_lsa_get_prefix_str() 575 int buflen, int pos) 576 { 577 struct ospf6_link_lsa *link_lsa = lsa_after_header(lsa->header); 578 struct ospf6_prefix *prefix = nth_prefix(lsa->header, pos); 579 struct in6_addr in6 = { 0 }; 580 >>> CID 1599957: Null pointer dereferences (REVERSE_INULL) >>> Null-checking "lsa" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. 581 if (!lsa || !prefix || !buf || buflen < (1 + INET6_ADDRSTRLEN)) 582 return NULL; 583 584 /* position zero is used for the lladdr in the body of the LSA */ 585 if (pos == 0) { 586 inet_ntop(AF_INET6, &link_lsa->linklocal_addr, buf, buflen); The check for lsa being not-null happens in ospf6_lsdb_show() and first dereference happens in ospf6_lsa_show_summary() Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* Merge pull request #16908 from donaldsharp/ospf6_snmp_specialJafar Al-Gharaibeh2024-09-241-4/+0
|\ | | | | ospf6d: Remove unguarded debugs in ospf6_snmp.c
| * ospf6d: Remove unguarded debugs in ospf6_snmp.cDonald Sharp2024-09-241-4/+0
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | ospf6d: apply CI style suggestionsAndrew Cooks2024-09-165-20/+16
| | | | | | | | | | | | Apply formatting changes suggested by CI frrbot. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: use nth_prefix() in ospf6_intra_prefix_lsa_get_prefix_str()Andrew Cooks2024-09-161-38/+11
| | | | | | | | Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: use nth_prefix() in ospf6_link_lsa_get_prefix_str()Andrew Cooks2024-09-161-41/+15
| | | | | | | | Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: add nth_prefix()Andrew Cooks2024-09-162-0/+25
| | | | | | | | | | | | | | Add utility function to find the Nth prefix in a link LSA or Intra Prefix LSA. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: use nth_lsdesc() in ospf6_router_lsa_get_nbr_id()Andrew Cooks2024-09-161-29/+8
| | | | | | | | | | | | | | Improves code readability by reducing pointer casting and arithmetic, and intendation. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: use nth_lsdesc() in ospf6_network_lsa_get_ar_id()Andrew Cooks2024-09-161-22/+5
| | | | | | | | Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: add nth_lsdesc()Andrew Cooks2024-09-162-0/+24
| | | | | | | | | | | | | | Add utility function to find the Nth router lsdesc or network lsdesc in an LSA. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: replace TLV_HDR_TOP macro with lsdesc_start functionAndrew Cooks2024-09-165-29/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original TLV_HDR_TOP implementation only worked for Graceful Restart LSAs, because they had no "LSA body". This change introduces a body size lookup table and changes the macro to a function that accounts for the LSA body for all LSA types, and provides type checking on the provided pointer before arithmetic. It also removes the open type casting and pointer arithmetic. The introduced lsdesc_start() is used to find the start of a descriptor, and will be used for TLVs in E-LSAs as well as old LSA. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: use lsa_after_header pointer arithmeticAndrew Cooks2024-09-162-18/+7
| | | | | | | | | | | | Replaces open type casting and pointer arithmetic for readability. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: replace ospf6_lsa_header_end()Andrew Cooks2024-09-1610-88/+50
| | | | | | | | | | | | | | | | The void * return type of the replacement enables the removal of a cast at every point of use, and the name no longer suggests that it points to the last byte of the header. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: cleanup Router-LSAs Options bit orderAndrew Cooks2024-09-161-2/+3
| | | | | | | | Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: add space between multi-line macrosAndrew Cooks2024-09-161-0/+16
| | | | | | | | | | | | For readability Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: move lsa structs to ospf6_lsa.hAndrew Cooks2024-09-167-89/+92
| | | | | | | | | | | | | | It will be cleaner to have the LSAs in a single header and the future TLVs in a single header. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | ospf6d: factor out generic TLV handlingAndrew Cooks2024-09-1614-63/+92
|/ | | | | | | In preperation for Extended LSA types and their TLVs, factor out the TLV handling from the Gracefull Restart functionality. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* Merge pull request #16050 from rgirada/ospfv3_helperRuss White2024-06-111-3/+1
|\ | | | | ospf6d: Handling Topo Change in GR-HELPER mode for max-age lsas
| * ospf6d: Handling Topo Change in GR-HELPER mode for max-age lsasRajesh Girada2024-06-061-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Description: OSPF6 GR HELPER router should consider as TOPOCHANGE when it receives lsas with max age and should exit from Helper. But, it is not exiting from helper because this max age lsa is considered as duplicated lsa since the sender uses same seq number for max age lsa from the previous lsa update. Currently, topo change is not considered for duplicated lsas. So removed the duplicated check when validating TOPOCHNAGE. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* | ospf6d: OSPFv3 manual key authentication neglects checking the SA ID.Acee Lindem2024-06-041-0/+9
| | | | | | | | | | | | | | | | Also, add topotest variation to verify checking. This corrects https://github.com/FRRouting/frr/issues/16100. Signed-off-by: Acee Lindem <acee@lindem.com>
* | ospf6d: Prevent heap-buffer-overflow with unknown typeIggy Frankovic2024-05-301-0/+1
| | | | | | | | | | | | | | | | | | When parsing a osf6 grace lsa field and we receive an unknown tlv type, ospf6d was not incrementing the pointer to get beyond the tlv. Leaving a situation where ospf6d would parse the packet incorrectly. Signed-off-by: Iggy Frankovic <iggy07@gmail.com>
* | Merge pull request #16098 from ↵Donald Sharp2024-05-292-3/+5
|\ \ | | | | | | | | | | | | LabNConsulting/aceelindem/ospfv3-route-asbr-change ospf6d: OSPFv3 route change comparision fixed for ASBR-only change
| * | ospf6d: OSPFv3 route change comparision fixed for ASBR-only changeAcee2024-05-282-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a router route already exists in the area border routers table as an ABR and it solely changes its ABR or ASBR status, the change was missed and border route is not updated. This fixes the comparison for the router_bits in the ospf6_path structure. This fixes issue https://github.com/FRRouting/frr/issues/16053 although the actual problem is not the computing router (r2) and not the OSPFv3 redistribution (r3). Signed-off-by: Acee <aceelindem@gmail.com>
* | | ospf6d: replace OSPF6_LSA_SIZE with ospf6_lsa_sizeAndrew Cooks2024-05-285-46/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dropping the macro enables better compiler type checking. The macro was not used consistently when reading the lsa size from the header, so this change also aims to use the replacement inline function consistently. Keeping the inline function has (marginal) utility in that it ensures that the endian conversion is consistently performed. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | | ospf6d: replace OSPF6_LSA_END with ospf6_lsa_endAndrew Cooks2024-05-284-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replacing the macro with an inline function enables better type checking. No functional change. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* | | ospf6d: replace OSPF6_LSA_HEADER_END macroAndrew Cooks2024-05-289-106/+81
|/ / | | | | | | | | | | | | | | | | | | | | | | Replacing the macro with an inline function allows the compiler to check the parameter type. Use the replacement function consistently to reduce the number of open coded pointer cast plus offset calculations. use tools/indent.py to reformat all occurences of its use. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
* / *: Modify agentx to be allowed to be calledDonald Sharp2024-05-101-0/+2
|/ | | | | | | | | | | If you had a situation where an operator turned on ospfd with snmp but not ospf6d and agentx was configured then you get into a situation where ospf6d would complain that the config for agentx did not exist. Let's modify the code to allow this situation to happen. Fixes: #15896 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #15627 from Max-Mustermann33/ospf6d_metric_for_type5_lsaRuss White2024-05-075-21/+85
|\ | | | | ospf6d: Fix metric when sending AS-external LSAs
| * ospf6d: Redistribute metric for AS-external routeAlexander Rose2024-05-065-21/+85
| | | | | | | | | | | | | | | | | | | | | | When ospf6d originates an AS-external route that has been read from a kernel routing table, then the metric of that route was ignored until now. If a routemap is configured, then this metric will be redistributed from now on. Using metric increment and decrement in routemaps is supported by ospf6d now. Signed-off-by: Alexander Rose <alexander.rose@secunet.com>
* | ospf6d: Fix nexthop computation for inter-area multi-ABR ECMPMartin Buck2024-05-031-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pre-b74e965, we always merged nexthops of old (existing) and new (newly generated, based on a LSA update) routes, making it impossible to remove individual nexthops from a route. b74e965 replaced this by copying nexthops from the new route to the old route. This works as long as the old and new route are derived from the same LSA (e.g. multiple ECMP paths to the same ABR). However, in case of multiple parallel ABRs, each of them originates a LSA and the nexthops derived from them need to be combined to get the proper route nexthops. So instead of trying to incrementally update the route nexthops based on the old and new route nexthops, always recompute the route nexthops by merging all of its path nexthops (which we're already updating based on the LSA being processed). Fixes #15777. Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
* | ospf6d: accept CLI `no` for point-to-multipointDavid Lamparter2024-04-251-2/+3
| | | | | | | | | | | | | | `point-to-multipoint` was missing on the removal variant of this CLI command. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | ospf6d: force recalculate on interface_upDavid Lamparter2024-04-251-2/+2
| | | | | | | | | | | | | | | | | | interface_up also handles changes to the interface type, i.e. broadcast to ptp to ptmp. Connected routes for these are different and must be readvertised, which is done in ospf6_interface_recalculate_cost() - but only if the cost changed. Use the force variant here. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | ospf6d: fix loopback/ptp/ptmp conn. route checksDavid Lamparter2024-04-251-5/+5
| | | | | | | | | | | | | | | | | | The code emitting connected routes was checking against the interface state (which can also be lo/ptp/ptmp) rather than the interface type. This was causing wrong IA prefixes for connected routes getting put up out if the interface was down intermittently. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | ospf6d: fix DEFUN formatting wrecked by clangDavid Lamparter2024-04-252-246/+458
|/ | | | | | | | clang-format doesn't understand `DEFUN` and formats it rather ugly. Standard approach was to skip these in clang-format, which hasn't happened here sadly. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospfd, ospf6d: Remove deprecated JSON fieldsDonatas Abraitis2024-04-111-9/+0
| | | | | | restartSupoort Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* eigrpd, mgmtd, ospf6d: frr_fini is lastDonald Sharp2024-03-131-1/+2
| | | | | | | | | | I noticed that ospf6d always had a linked list memory leak. Tracking it down shows that frr_fini() shuts down the memory system and prints out memory not cleaned up. eigrpd, mgmtd and ospf6d all called cleanup functions after frr_fini leaving memory leaked that was not really leaked. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #15469 from LabNConsulting/chopps/keychain-yangDonald Sharp2024-03-081-9/+11
|\ | | | | add ietf-key-chain YANG module support
| * lib: add keychain northbound supportChristian Hopps2024-03-051-9/+11
| | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* | ospf6d: add localLinkLocalAddress fieldFrancois Dumontet2024-03-071-0/+2
|/ | | | | | | | add localIfaceAdress field in show ipv6 ospf6 neighbor detail json command. Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* *: use af-specific autocompletion for prefix-lists when possibleIgor Ryzhov2024-02-042-4/+4
| | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* Merge pull request #10151 from pguibert6WIND/ensure_routing_protocols_good_bwDonald Sharp2024-02-021-1/+1
|\ | | | | zebra: avoid having speed set to UINT32_MAX
| * lib,ospf6d: fix reference bandwidth descriptionPhilippe Guibert2024-01-291-1/+1
| | | | | | | | | | | | | | Fix reference bandwidth description. It is Kbps, not Mbps. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* | *: create a single registry of daemons' default port valuesMark Stapp2024-02-011-3/+0
|/ | | | | | | | Create a single registry of default port values that daemons are using. Most of these are vty ports, but there are some others for features like ospfapi and zebra FPM. Signed-off-by: Mark Stapp <mjs@labn.net>
* ospf6d: fix GR & auth seqno state locationDavid Lamparter2024-01-275-74/+115
| | | | | | | | | | | | | | | | Unfortunately, `ospf6d` is much worse than `ospfd` and `isisd` regarding its state saving, due to the existence of the auth trailer code. Again, this belongs in `/var/lib`, not `/var/run`. Merge both state files into one, and add reconciliation code for the auth seqno. I'm gonna save my comment on the fact that `ospf6_auth_seqno_nvm_delete` is not in fact used anywhere. Which is now a warning because it's `static`. Well. It probably should be used somewhere, so leave it in. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix `frr_daemon_info` indentationDavid Lamparter2024-01-271-6/+10
| | | | | | | | | | clang-format doesn't understand FRR_DAEMON_INFO is a long macro where laying out items semantically makes sense. (Also use only one `FRR_DAEMON_INFO(` in isisd so editors don't get confused with the mismatching `( ( )`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #15098 from donaldsharp/lib_zebra_h_cleanup_2Donatas Abraitis2024-01-111-0/+1
|\ | | | | Lib zebra h cleanup 2
| * *: remove sys/stat.h from zebra.hDonald Sharp2024-01-091-0/+1
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | ospf6d: Value set is never usedDonald Sharp2024-01-091-1/+1
|/ | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>