summaryrefslogtreecommitdiff
path: root/eigrpd/eigrp_network.c
AgeCommit message (Collapse)Author
2023-11-22*: convert `struct interface->connected` to DLISTDavid Lamparter
Replace `struct list *` with `DLIST(if_connected, ...)`. NB: while converting this, I found multiple places using connected prefixes assuming they were IPv4 without checking: - vrrpd/vrrp.c: vrrp_socket() - zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(), irdp_advert_off() (these fixes are really hard to split off into separate commits as that would require going back and reapplying the change but with the old list handling) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
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>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-09-12eigrpd: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2021-11-22*: cleanup ifp->vrf_idIgor Ryzhov
Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-29*: unify prefix copyingIgor Ryzhov
There are a few places in the code where we use PREFIX_COPY(_IPV4/IPV6) macro to copy a prefix. Let's always use prefix_copy function for this. This should fix CID 1482142 and 1504610. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-01-12eigrpd: Introduce eigrp_metric.[ch] and eigrp_types.hDonnie Savage
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>
2021-01-12eigrpd: Rename nexthop_entry and prefix_entry to better namesDonnie Savage
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>
2020-12-14*: Replace s_addr check agains 0 with INADDR_ANYDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-21eigrpd: Replace inet_ntoa with %pI4Donald Sharp
Search and destroy the inet_ntoa usage in eigrp Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-07-14*: un-split strings across linesDavid Lamparter
Remove mid-string line breaks, cf. workflow doc: .. [#tool_style_conflicts] For example, lines over 80 characters are allowed for text strings to make it possible to search the code for them: please see `Linux kernel style (breaking long lines and strings) <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_ and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-08*: Do not cast to the same typeDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06*: Replace s_addr 0 => INADDR_ANYDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-02*: Convert prefix_free to double pointerDonald Sharp
Have the prefix_free code take a double pointer to free the data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-25eigrpd: On creation of socket ensure vrf existsDonald Sharp
If the vrf does not exist, politely do not create the socket. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-03eigrpd: Fix SA issue with setting but not usingDonald Sharp
We assign a value to the eigrp data structure and then immediately overwrite it in the for loop. No need to do a eigrp_lookup. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-03*: frr_elevate_privs -> frr_with_privsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-08-06eigrpd: When iterating over all eigrp instances, narrow to correct vrfDonald Sharp
When iterating over all eigrp instances, narrow to the correct vrf that we are working on. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-06eigrpd: Convert eigrp_network.c to not use VRF_DEFAULTDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-06eigrpd: Create a socket per vrf for communicationDonald Sharp
Setup EIGRP to use a socket per vrf for communication amongst it's peers. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-08*: setting the socket send/recv buffer sizes doesn't need elevated privsRenato Westphal
The less code running under elevated privileges the better. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-11eigrp: Make the eigrp_interface have a prefix instead of a *prefixDonald Sharp
The prefix data structure was being freed yet still needed in the future and it's a fundamental part of the eigrp_interface data structure let's keep it there instead of having it be deleted and then not. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-11eigrpd: Remove unnecessary test for pointerDonald Sharp
If we are inside the for loop then eigrp *must* be valid. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-30eigrpd: eigrp usage of uint32_t to struct in_addr for router_id dataDonald Sharp
In eigrp we were using a uint32_t to hold the `struct in_addr` data for the router id values. This caused us to do unnecessary conversions pre and post for in/out. Let's just use the standard `struct in_addr` Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-22eigrpd: Fix eigrp crash on shut of a interfaceDonald Sharp
The eigrp interface structure was storing a pointer to the connected interface structure and on shutdown of an interface this would cause zebra to call eigrp back with a shutdown of that interface, as part of that operation the connected interface structure is being deleted, but eigrp was keeping a pointer to the connected structure. At the same time we were keeping the address of the connected structure and this is all we need, so keep a copy of that data and use that instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14*: use frr_elevate_privs() (2/2: manual)David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-14*: use frr_elevate_privs() (1/2: coccinelle)David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-14*: rename ferr_zlog -> flog_err_sysQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: rename zlog_fer -> flog_errQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14eigrpd: Add EIGRP_ERR_XXX for zlog_err to zlog_ferrDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14eigrpd: Convert to use LIB_ERR_XXX for zlog_errDonald Sharp
Convert, where appropriate, to using LIB_ERR_XXX for zlog_ferr Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-18eigrpd, lib, vtysh: unused vars (cppcheck)paco
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
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>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-10-23eigrpd: Make struct zebra_privs_t availableDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-10*: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal
This improves code readability and also future-proofs our codebase against new changes in the data structure used to store interfaces. The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but for now only babeld is using it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-10*: use rb-trees to store interfaces instead of sorted linked-listsRenato Westphal
This is an important optimization for users running FRR on systems with a large number of interfaces (e.g. thousands of tunnels). Red-black trees scale much better than sorted linked-lists and also store the elements in an ordered way (contrary to hash tables). This is a big patch but the interesting bits are all in lib/if.[ch]. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-02eigrpd: Remove ei mapping to connected routesDonald Sharp
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>
2017-08-26eigrpd: eigrp_neighbor_entry to eigrp_nexthop_entryDonald Sharp
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>
2017-08-24eigrpd: Remove 'struct prefix_ipv4' from eigrp_network.cDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Refactor eigrp_network_[un]set to use prefixDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-10eigrpd: fix spelling of "bandwidth"Andrew Lunn
There are a number of spelling errors in eigrp. But this one is particular annoying because it is a variable name, not in a comment. Signed-off-by: Andrew Lunn <andrew@lunn.ch>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13eigrpd: Let eigrp setup it's router-id in some situationsDonald Sharp
If the router-id is passed up to eigrp before we have started the instance, allow it to set it up properly as we start the instance. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-28lib/ospf/eigrp: enable ospf and eigrp to use more specific network statementsDon Slice
Issue reported that a configuration commonly used on other routing implementations fails in frr. If under ospf, "network 172.16.1.1/32 area 0" or under eigrp, "network 172.16.1.1/32" is entered, the appropriate interfaces are not included in the routing protocol. This was because the code was calling prefix_match, which did not match if the network statement had a longer mask than the interface being matched. This fix takes away that restriction by creating a "lib/prefix_match_network_statement" function which doesn't care about the mask of the interface. Manual testing shows both ospf and eigrp now can be defined with more specific network statements. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2017-05-26*: do not take address of packed memberQuentin Young
May result in alignment errors on certain platforms Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
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>
2017-05-13eigrpd: Diverse FixesRenato Westphal
* Correct the metric calculation as well as the default metrics; * Do not show invalid routes in the "show ip eigrp topology". * Add support to VRFs; * When downloading a neighbor remove the related routes; * Fix bugs in the parser of packages they were creating Invalid default routes; * Add and remove routes in the zebra; * Add command "on router eigrp AS"; * Make "delay" and "bandwitch" commands work as well as Display them in running config; * Add "no" version of several commands; * Fix a serious momory leaks; * Fix segfault when there is no 'successor' route to a Given prefix; * Other minor corrections; Signed-off-by: Renato Westphal <renatowestphal@gmail.com> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-26eigrpd: Switch u_int64_t -> uint64_tDonald Sharp
Apparently u_int64_t is not available (or we don't pull the right headers in for solaris based systems ). Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>