All paths of the loop set dest_addr at the start
of the loop. No need to set it to NULL to immediately
set it too something else.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Effectively a massive search and replace of
`struct thread` to `struct event`. Using the
term `thread` gives people the thought that
this event system is a pthread when it is not
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This is a first in a series of commits, whose goal is to rename
the thread system in FRR to an event system. There is a continual
problem where people are confusing `struct thread` with a true
pthread. In reality, our entire thread.c is an event system.
In this commit rename the thread.[ch] files to event.[ch].
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
1) Do not explicitly set the thread pointer to NULL.
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics. This is espacially true for the functions we
end up calling the thread for.
2) Fix mixup of `struct eigrp_interface` and `struct eigrp`
usage of the same thread pointer.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Same as previous commit -- convert most DEFINE_MTYPE into the _STATIC
variant, and move the remaining non-static ones to appropriate places.
Signed-off-by: David Lamparter <equinox@diac24.net>
Add these file and introduce some new fundamental types
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Donnie Savage <diivious@hotmail.com>
Rename struct eigrp_nexthop_entry to struct eigrp_route_descriptor
Rename struct eigrp_prefix_entry to struct eigrp_prefix_descriptor
Fix all the associated function names as well.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Donnie SAvage <diivious@hotmail.com>
Push out the pass in of struct eigrp to all functions
in eigrp_topology.c so we do not lookup the eigrp pointer.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
For those places where we can immediately transform the usage
of VRF_DEFAULT to eigrp->vrf_id do so.
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>
1) Create #defines for TLV SIZE and use them
2) Speed up prefix length by using a switch statement
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The EIGRP topology list is an extremely inefficient
way to store data about the known routes. Convert
to using a table.
Signed-off-by: Donald Sharp <sharpd@cumulusnetorks.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>
We need one struct eigrp_interface per ifp structure
not a ifp->info structure with a ei per connected.
Some minor code cleanup as well with macros and
their weird usage.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The struct 'eigrp_neighbor_entry' really represents
a nexthop for a prefix. Rename the structure to
better represent what we are representing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
There was allot of code cut-n-pasting to
apply the prefix/access lists. Refactor
to simplify code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Lots of multiple pointer dereferences that made the
code lines really long, so let's properly setup
the pointers in a way that makes it easier to read.
No need to lookup the eigrp pointer because we already
have it, so let's use this( this will be good for the
future too when we have VRF's).
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Use eigrp pointer passed in instead of looking it up,
additionally we should actually look at the correct
access list.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
1) Handle key value not found on interface
2) Handle various NULL pointer possibilities
3) Fix possible integer overflow
4) Fix memory leak
5) Check return codes on sscanf
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
We need to eventually be able to handle multiple
data types to figure out if the distance is better
worse.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The FSM was never freeing the msg. Since we
do not have a special queue for it, just don't
allocate the memory. In the future we can put
this back.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
EIGRP was not handling split-horizon. This code starts
down the path of properly considering it. There still
exists situations where we are not properly handling it
though.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When an external route is received, eigrpd will crash. For now,
quietly discard the TLV. Work must be done to handle tlv
processing and changes needed to FSM so it understands an
external should not be chooses if an internal exist.
Signed-off-by: Donnie Savage <diivious@hotmail.com>
Modify code to allow the eigrp_update_send function to
recognize that we have a full packet and to do the right
thing from there.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we send packets to a nbr, make a duplicate copy
as that each packet sent is assumed to be a complete
to itself.
Also clean up indentation in loop over figuring out
what to send.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When we generate update packets to go to our neighbor, Only
put one packet at a time on the send queue.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The FIFO really was a LIFO for some reason.
Push new packets onto the top, always pull from the bottom.
This allows eigrp neighbors to come up. Topotests
eigrp-topo1( in a topotest PR ) now form neighbors
with itself. With this commit.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>