| Age | Commit message (Collapse) | Author | 
 | 
Clean up various "shadow" warnings.
Signed-off-by: Mark Stapp <mjs@cisco.com>
 | 
 | 
Fixes leaks reported by ospf6_gr_topo1 topotest.
Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
 | 
 | 
configuration.
        This fix will delete an OSPFv3 area when all the interfaces and
        configuration (ranges, NSSA ranges, stub area, NSSA area, filter-list,
        import-list and export-list) have been removed. The changes provides
        a general solution to https://github.com/FRRouting/frr/issues/18324.
Signed-off-by: Acee Lindem <acee@lindem.com>
 | 
 | 
LabNConsulting/aceelindem/ospf6-abr-calc-addr-sanity
ospf6d: Fix use after free of router in OSPFv3 ABR route calculation.
 | 
 | 
This PR fixes FRR issue https://github.com/FRRouting/frr/issues/18040. The
OSPFv3 route is locked during the ABR calculation since there are
scenarios under which it is freed. The OSPFv3 ABR computation is
sub-optimal and this PR doesn't attempt to rework it.
Signed-off-by: Acee Lindem <acee@lindem.com>
 | 
 | 
Headers include this stuff now.  No need for it
in our code base.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
 | 
 | 
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
 | 
 | 
acooks-at-bda/fix-redundant-null-ptr-check-CID-1599962
ospf6d: remove redundant null ptr check
 | 
 | 
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>
 | 
 | 
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 unguarded debugs in ospf6_snmp.c
 | 
 | 
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
 | 
 | 
Apply formatting changes suggested by CI frrbot.
Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
 | 
 | 
Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
 | 
 | 
Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
 | 
 | 
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>
 | 
 | 
Improves code readability by reducing pointer casting and arithmetic,
and intendation.
Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
 | 
 | 
Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
Replaces open type casting and pointer arithmetic for readability.
Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
 | 
 | 
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>
 | 
 | 
Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
 | 
 | 
For readability
Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
ospf6d: Handling Topo Change in GR-HELPER mode for max-age lsas
 | 
 | 
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>
 | 
 | 
Also, add topotest variation to verify checking.
    This corrects https://github.com/FRRouting/frr/issues/16100.
Signed-off-by: Acee Lindem <acee@lindem.com>
 | 
 | 
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>
 | 
 | 
LabNConsulting/aceelindem/ospfv3-route-asbr-change
ospf6d: OSPFv3 route change comparision fixed for ASBR-only change
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
Replacing the macro with an inline function enables better type
checking.
No functional change.
Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
ospf6d: Fix metric when sending AS-external LSAs
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
`point-to-multipoint` was missing on the removal variant of this CLI
command.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
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>
 | 
 | 
restartSupoort
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
 | 
 | 
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>
 | 
 | 
add ietf-key-chain YANG module support
 | 
 | 
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>
 | 
 | 
Signed-off-by: Christian Hopps <chopps@labn.net>
 | 
 | 
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
 | 
 | 
zebra: avoid having speed set to UINT32_MAX
 |