| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
There is no need to check for failure of a ALLOC call
as that any failure to do so will result in a assert
happening. So we can safely remove all of this code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t
Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
| |
Signed-off-by: Lou Berger <lberger@labn.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an implementation of draft-ietf-ospf-segment-routing-extensions-24
and RFC7684 for Extended Link & Prefix Opaque LSA.
Look to doc/OSPF_SR.rst for implementation details & known limitations.
New files:
- ospfd/ospf_sr.h: Segment Routing structure definition (SubTLVs + SRDB)
- ospfd/ospf_sr.c: Main functions for Segment Routing support
- ospfd/ospf_ext.h: TLVs and SubTLVs definition for RFC7684
- ospfd/ospf_ext.c: RFC7684 Extended Link / Prefix implementation
- doc/OSPF-SRr.rst: Documentation
Modified Files:
- doc/ospfd.texi: Add new Segment Routing CLI command definition
- lib/command.h: Add new string command for Segment Routing CLI
- lib/mpls.h: Add default value for SRGB
- lib/route_types.txt: Add new OSPF Segment Routing route type
- ospfd/ospf_dump.[c,h]: Add OSPF SR debug
- ospfd/ospf_memory.[c,h]: Add new Segment Routing memory type
- ospfd/ospf_opaque.[c,h]: Add ospf_sr_init() starting function
- ospfd/ospf_ri.c: Add new functions to Set/Get Segment Routing TLVs
Add new ospf_router_info_lsa_upadte() to send Opaque LSA to ospf_sr.c()
- ospfd/ospf_ri.h: Add new Router Information SR SubTLVs
- ospfd/ospf_spf.c: Add new scheduler when running SPF to trigger
update of NHLFE
- ospfd/ospfd.h: Add new thread for Segment Routing scheduler
- ospfd/subdir.am: Add new files
- vtysh/Makefile.am: Add new ospf_sr.c file for vtysh
- zebra/kernel_netlink.c: Add new OSPF_SR route type
- zebra/rt_netlink.[c,h]: Add new OSPF_SR route type
- zebra/zebra_mpls.h: Add new OSPF_SR route type
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
|
|
|
|
|
|
| |
Ticket:CM-19213
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert the list_delete(struct list *) function to use
struct list **. This is to allow the list pointer to be nulled.
I keep running into uses of this list_delete function where we
forget to set the returned pointer to NULL and attempt to use
it and then experience a crash, usually after the developer
has long since left the building.
Let's make the api explicit in it setting the list pointer
to null.
Cynical Prediction: This code will expose a attempt
to use the NULL'ed list pointer in some obscure bit
of code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
| |
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix ANVL-OSPF-5.1 reported ospfd crash.
vertex_nexthop_free was added as valgrind reported potential
memory leak, but in some cases nexthop would not be available
freed.
The actual nexthop free is part of ospf_canonical_nexthops_free(),
upon trying to free, qfree checks mtype count becomes 0 and asserts.
Removing vertex_nexthop_free() from ospf_spf_flush_parents().
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Remove assert in path of router_id_update:
Upon configuring same router-id as neighbor's
assert would cause a crash. Log a warning message
and neighborship would not come up.
Address memory leaks
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
|
|
|
|
|
|
| |
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Dropped:
redhat/README.rpm_build.md
redhat/daemons
redhat/frr.init
redhat/frr.logrotate
redhat/frr.spec.in
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fix #666
}:-)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header. (The style with * at the beginning won out with
580 to 141 in existing files.)
Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Pass pointer to pointer instead of assigning by return value. See
previous commit message.
To ensure that the behavior stays functionally correct, any assignments
with the result of a thread_add* function have been transformed to set
the pointer to null before passing it. These can be removed wherever the
pointer is known to already be null.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The way thread.c is written, a caller who wishes to be able to cancel a
thread or avoid scheduling it twice must keep a reference to the thread.
Typically this is done with a long lived pointer whose value is checked
for null in order to know if the thread is currently scheduled. The
check-and-schedule idiom is so common that several wrapper macros in
thread.h existed solely to provide it.
This patch removes those macros and adds a new parameter to all
thread_add_* functions which is a pointer to the struct thread * to
store the result of a scheduling call. If the value passed is non-null,
the thread will only be scheduled if the value is null. This helps with
consistency.
A Coccinelle spatch has been used to transform code of the form:
if (t == NULL)
t = thread_add_* (...)
to the form
thread_add_* (..., &t)
The THREAD_ON macros have also been transformed to the underlying
thread.c calls.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
| |
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
| |
monotime_since() does exactly the same thing.
... and timeval_elapsed is now private to lib/thread.c
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
| |
This is largely a bulk-replace made with coccinelle.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
| |
This ditches tv_add, tv_sub, tv_cmp, etc. in favour of
monotime{,_since,_until}() which actually makes the code much more
readable in some locations.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
| |
size_t printf formatter is %zd!
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
|
| |
There were some (inconsequential) warnings about uninitialised use of
variables. Also, in one case, sub-structs were mixed in initialisation,
which doesn't quite work as intended.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
|
| |
On higher warning levels, compilers expect %p printf arguments to be
void *. Since format string / argument warnings can be useful
otherwise, let's get rid of this noise by sprinkling casts to void *
over printf calls.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ospf_spf.h: use an enum for the reason, and have it as a new argument to
ospf_spf_calculate_schedule, no need for additional call, and let compiler
do the checking.
* ospf_spf.c: format changes - Quagga coding style places function names
at the start of a new line, for easy grepping for definition.
(ospf_spf_calculate_timer) Change the log format of SPF execution time to
avoid ginormous line, and make logging conditional, as is the norm.
(cherry picked from commit b6eef003e1a79471addea0b01853b08aed812cc8)
Conflicts:
ospfd/ospf_spf.c
|
|
|
|
|
|
| |
Fixup compile warnings for when you turn on --enable-gcc-ultra-verbose=yes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
| |
Remove compile warnings for the ospfd/ospf6d directory
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
calculation to a node should be constructed with the sum of all path
costs (metrics) to the node (pretty simple huh). There is a usage of
metric typified by the "max-metric router-lsa" command in many
networking stacks that allows a router to gracefully "remove" itself
from a topology by advertising the maximum value of metric in it's
router LSAs (16 bits of "1"). In this case, the router will continue
to forward any traffic sent to it while these "max-metric" LSAs are
propagated through the network; at which point, the router can be
taken out of service.
The correct handling of this in ospfd would use this metric as part of
the calculation, disuading other routers from using it for transit
traffic (assuming a better path exits). Unfortunately, the ospfd
behavior is to remove these links from the SPF calculation. This
patch changes the behavior to omit this exception handling.
Signed-off-by: JR Rivers <jrrivers@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Compute and display SPF execution statistics
Detailed SPF statistics, all around time spent executing various pieces of SPF
such as the SPF algorithm itself, installing routes, pruning unreachable networks
etc.
Reason codes for firing up SPF are:
R - Router LSA, N - Network LSA, S - Summary LSA, ABR - ABR status change,
ASBR - ASBR Status Change, AS - ASBR Summary, M - MaxAge
Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: Ayan Banerjee <ayan@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quagga sources have inherited a slew of Page Feed (^L, \xC) characters
from ancient history. Among other things, these break patchwork's
XML-RPC API because \xC is not a valid character in XML documents.
Nuke them from high orbit.
Patches can be adapted simply by:
sed -e 's%^L%%' -i filename.patch
(you can type page feeds in some environments with Ctrl-V Ctrl-L)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit c81ee5c... "ospfd: Optimize and improve SPF nexthop calculation"
subtly changed semantics of routes calculated over pointopoint links by
removing the nexthop IP address and instead using an ifindex route.
This breaks calculation of AS-Ext routes with a forwarding address since
in ospf_ase_complete_direct_routes() this will be hit:
if (op->nexthop.s_addr == 0)
op->nexthop.s_addr = nexthop.s_addr;
thus turning the route unusable by having an invalid nexthop.
Fix by restoring the nexthop IP on routes over PtP links. This also
allows running multi-access (Ethernet) interfaces in PtP mode again.
This bug is a regression against 0.99.21 and only present in 0.99.22.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
[patch description and code comments rewritten]
Acked-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: James Li <jli@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
| |
This reverts commit 9289c6ff55cd96c943d23e43fc9e5f987aa965ed.
The commit reverted an earlier change which was fixed a bug that caused
black-holes to remote destinations with multiple paths, that could occur
during convergence. Overall, the previous code is more correct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch in bug 330 did two things. It add a return value
whether ospf_nexthop_calculation() failed or not and also
moved the return stmt for 16.1.1 para 5 so now SPF
will fallback to the intervening router when no back links are found
by 16.1.1 para 5. This is wrong and can potentially create black holes
or routing loops according to Dave Katz and Acee Lindem at ospf@ietf.org
Even if the current code could be proved to be harmless in all cases,
it adds substantial extra processing and memory allocations.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
| |
This is better than a prefix lookup as prefixes may not be
unique, that is, the same prefix can exist on several interfaces.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Maintain router LSA positions in OSPF interface.
Find the OSPF interface in nexthop_calculation using
the position in the router LSA. This is possible because
the only time nexthop_calculation needs to look up interfaces
is when dealing with its own Router LSA.
This has the following advantages:
- Multiple PtP interfaces with the same IP address between two routers.
- Use Unnumbered PtP on just one end of the link.
- Faster OI lookup for the OSPF interface and only
done once for PtoP links.
*ospf_interface.h: (struct ospf_interface) Add storage for
storing router LSA position.
*ospf_interface.c: (ospf_if_lookup_by_lsa_pos)
lookup OSPF I/F in an area using LSA position.
*ospf_lsa.c: (router_lsa_link_set) record Router LSA position.
*ospf_spf.c: (ospf_spf_next) Count and pass along lsa position.
(ospf_nexthop_calculation) Add lsa position argument.
call ospf_if_lookup_by_lsa_pos() for OSFP interface handle.
Clean up and remove all calls ospf_if_is_configured() the
rest. Adjust a few debug logs.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was found in scale testing at OSR; ospfd is adding the same link
over and over again to the SPF tree. This fix prevents the resulting
memory corruption from happening and adds a debug message to track
occurence of this issue and/or confirm a proper fix.
(This version was improved by Scott Feldman over the earlier RFC.)
* ospfd/ospf_spf.c: (ospf_spf_add_parent) loop over existing vertices
and refuse to add duplicates.
Tested-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
| |
The code for nssa_range and other bits that were written but
never used.
|
|
|
|
|
|
| |
* ospf_spf.c
* ROUTER_LSA_TOS_SIZE: prepend OSPF_ and move to ospf_lsa.h
* ROUTER_LSA_MIN_SIZE: replace with existing OSPF_ROUTER_LSA_LINK_SIZE
|
|
|
|
|
| |
* ospf_{spf,lsa}.c: remove out of date comment; add comment on some
non-obvious code; Make note of a possible scaling problem.
|
|
|
|
|
|
| |
* global: In struct ospf_path, change struct ospf_interface *oi to int
ifindex. It is unsafe to reference *oi as an ospf interface can be
deleted under your feet. Use a weak reference instead.
|
|
|
|
|
|
|
|
| |
* ospf_spf.c: (ospf_get_next_link) One must check the vertex type, Router or
Network, to select type link to match against. Link type 1 has neighbour
router ID in link_id and link type 2 has IP address of DR. Since router
id may have same value as an existing IP address one risks matching a
router ID against a DR.
|
|
|
|
|
|
|
|
|
| |
* ospf_spf.c: (ospf_spf_process_stubs) Track whether
parent router vertex is the root, so that the host-route
suppression logic need only be activated for such vertices.
Move the actual logic to ospf_intra_add_stub.
* ospf_route.c: (ospf_intra_add_stub) Main test of link moved
here, notionally more appropriate.
|
|
|
|
|
|
| |
PtP links with /32 masks adds host routes to the remote host,
see RFC 2328, 12.4.1.1, Option 1.
Make sure that such routes are ignored
|
|
|
|
|
|
|
| |
2007-08-07 Paul Jakma <paul.jakma@sun.com>
* ospf_spf.c: (ospf_spf_next) Finish off the explanatory
comment made in previous commit
|
|
|
|
|
|
|
|
|
| |
2007-08-07 Atis Elsts <atis@mikrotik.com>
* ospf_spf.c: (ospf_spf_next) Sort heap in correct direction
after vertex cost is changed, thus fixing incorrect SPF
calculation on certain topologies.
* lib/pqueue.{c,h}: Export trickle_up
|
|
|
|
|
|
|
|
|
|
|
|
| |
2007-05-07 Paul Jakma <paul.jakma@sun.com>
* ospf_spf.c: (ospf_vertex_new) Dont init vertices to infinity,
just let 0 be a special case.
(ospf_spf_add_parent) 0 distance candidate vertex is special,
cost still to be initialised - asserting that new distance
is <= existing only makes sense where w already has a cost.
(ospf_spf_next) Infinite cost links should not be followed,
bar those of the root.
|
|
|
|
|
|
|
|
| |
2007-03-23 Paul Jakma <paul.jakma@sun.com>
* ospf_spf.c: (ospf_nexthop_calculation) Fix silly regression
causing ospfd to fail to calculate paths past networks not
attached to root vertex, introduced with bug #330 fixes.
|
|
|
|
|
|
| |
2007-03-23 Paul Jakma <paul.jakma@sun.com>
* ospf_spf.c: (various) Add more debug statements.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2007-02-26 Paul Jakma <paul.jakma@sun.com>
* ospf_spf.c: Fix regression introduced with bug #330 fix: The
cost update added to ospf_spf_add_parent only handled PtP
case, differing from same functionality in higher-level
ospf_spf_next. Regression diagnosed by Anders Pedersen,
mailnews+router-quagga-dev@news.cohaesio.com.
(ospf_vertex_new) Initialise vertices to max-cost.
(ospf_spf_init) Root vertex always creates with 0 cost.
(ospf_spf_add_parent) Remove the buggy V->W cost calculating
code, instead take the new distance as a parameter.
(ospf_nexthop_calculation) Take distance as parameter, so it
can be passed down to add_parent.
(ospf_spf_next) Dont initialise candiate vertex distance,
vertex_new does so already. Pass distance down to
nexthop_calculation (see above).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2007-01-24 Paul Jakma <paul.jakma@sun.com>
* ospf_spf.c: Bug #330: Nexthop calculation sometimes may fail,
and it needs to indicate this result to SPF.
(ospf_spf_add_parent) Flush of parent list needs to be done here,
for simplicity.
(ospf_nexthop_calculation) Caller needs to know whether
nexthop calculation succeeded. Every return statement must
correctly indicate such.
(ospf_spf_next) Queueing/prioritisation of vertices in SPF
must take into account whether nexthop_calculation succeeded,
or SPF may fail to find best paths.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2006-08-25 Paul Jakma <paul.jakma@sun.com>
* (general) Bug #134. Be more robust to backward time changes,
use the newly added libzebra time functions.
In most cases: recent_time -> recent_relative_time()
gettimeofday -> quagga_gettime (QUAGGA_CLK_MONOTONIC, ..)
time -> quagga_time.
(ospf_make_md5_digest) time() call deliberately not changed.
(ospf_external_lsa_refresh) remove useless gettimeofday, LSA
tv_orig time was already set in ospf_lsa_new, called via
ospf_external_lsa_new.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2006-04-24 Paul Jakma <paul.jakma@sun.com>
* (general) More Virtual-link fixes, again with much help in
testing / debug from Juergen Kammer. Primarily in SPF.
* ospf_spf.h: Add guard. ospf_interface.h will include this
header.
* ospf_interface.h: Modify ospf_vl_lookup definition to take
struct ospf as argument, so as to allow for NULL area
argument.
(struct ospf_vl_data) Remove out_oi, instead add a struct
vertex_nexthop, to use as initial nexthop for backbone paths
through a vlink.
* ospf_interface.c: (ospf_vl_lookup) Modified to allow
NULL area to be passed to indicate "any" (first) area.
Add extra debug.
(ospf_vl_set_params) vl_oi -> nexthop. Add extra debug.
(ospf_vl_up_check) Fix debug, inet_ntoa returns a static
buffer..
* ospf_route.c: (ospf_intra_add_router) Vlinks dont go through
backbone, don't bother checking.
* ospf_spf.c: (static struct list vertex_list) Record vertices
that will need to be freed.
(cmp) Order network before router vertices, as required,
wasn't implemented.
(vertex_nexthop_free) Mild additional robustness check.
(vertex_parent_free) Take void argument, as this function
is passed as list deconstructor for vertex parent list.
(ospf_vertex_new) More debug. Set deconstructor for parent
list. Track allocated vertices on the vertex_list.
(ospf_vertex_free) Get rid of the tricky recursive cleanup of
vertices. Now frees only the given vertex.
(ospf_vertex_add_parent) Fix assert.
(ospf_nexthop_calculation) Fix calculation of nexthop for
VLink vertices, lookup the vl_data and use its previously
recorded nexthop information.
(ospf_spf_calculate) Vertices are freed simply by deleting
vertex_list nodes and letting ospf_vertex_free as deconstructor
work per-node.
(ospf_spf_calculate_timer) Trivial optimisation, leave
backbone SPF calculation till last to reduce SPF churn on
VLink updates.
* ospf_vty.c: (ospf_find_vl_data) update call to ospf_vl_lookup
(no_ospf_area_vlink_cmd) ditto.
(show_ip_ospf_interface_sub) For Vlinks, the peer address is
more interesting than the output interface.
|