summaryrefslogtreecommitdiff
path: root/eigrpd/eigrp_packet.c
AgeCommit message (Collapse)Author
2025-03-24eigrpd: Cleanup memory issues on shutdownDonald Sharp
a) EIGRP was having issues with the prefix created as part of the topology destination. Make this just a part of the topology data structure instead of allocating it. b) EIGRP was not freeing up any memory associated with the network table. Free it. c) EIGRP was confusing zebra shutdown as part of the deletion of the last eigrp data structure. This was inappropriate it should be part of the `I'm just shutting down`. d) The QOBJ was not being properly freed, free it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-03-24eigrpd: Convert the eiflist to a typesafe hashDonald Sharp
The eigrp->eiflist is a linked list and should just be a hash instead. The full conversion to a hash like functionality is goingto wait until the connected eigrp data structure is created. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
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>
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>
2022-05-11*: Properly use memset() when zeroingDonatas Abraitis
Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-04eigrpd: Ensure better `struct thread *` semanticsDonald Sharp
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>
2021-05-03eigrpd: Test for EIGRP AS number and ensure it's the sameDon Slice
When receiving a packet, ensure that the AS number is the same. Fixes: 8515 Signed-off-by: Don Slice <dslice@nvidia.com>
2021-03-22eigrpd: kill eigrp_memory.h, use MTYPE_STATICDavid Lamparter
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>
2021-03-14*: fix printf extension typesDavid Lamparter
Some mistakes have crept in again. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-14eigrpd: Convert to using our builtin printf stuffDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.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-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-03-11eigrpd: stop checking for ancient OpenBSDRuben Kerkhof
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-11ospfd,eigrpd: don't take address of packed struct memberMark Stapp
Use a local variable to avoid trying to take the address of a packed struct member - an address from the ip header in these cases. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-08-06eigrpd: Convert eigrp_packet.c to not use VRF_DEFAULTDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-06eigrpd: Use the eigrp->vrf_id where we can immediately transformDonald Sharp
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>
2019-06-14eigrpd: Fix endianness issue in packetsPawel Dembicki
Net prefixes in eigrp update packets is created and read without check host endianness. This patch use ntohl and htonl to read and write ip prefix from and to packet. Tested: x86, powerpc Signed-off-by: Pawel Dembicki <p.dembicki@wb.com.pl>
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-01-24Treewide: use ANSI function definitionsRuben Kerkhof
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2018-09-13*: style for EC replacementsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13*: LIB_[ERR|WARN] -> EC_LIBQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13eigrpd: EIGRP_[ERR|WARN] -> EC_EIGRPQuentin 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-07-02eigrpd: sizeof() usage + dead code (PVS-Studio)F. Aragon
Two issues: 1) Removed an unnecesary null check of 'ei' 2) Fixed the usage of sizeof(), as it was used the size of a pointer instead of the size of the structure Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-19eigrpd, isisd, lib, ospfd: no effect (cppcheck)paco
Assignment of function parameter has no effect outside the function. Signed-off-by: F. Aragon <paco@voltanet.io>
2018-05-04eigrpd: Use EIGRP_PACKET_MTU(mtu) macroPiotr Jurkiewicz
Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
2018-05-04eigrpd: Correctly calculate EIGRP packet MTUPiotr Jurkiewicz
Someone forgot that EIGRP packets are encapsulated in IP. Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
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-12-01*: don't use deprecated stream.h macrosQuentin Young
Some of the deprecated stream.h macros see such little use that we may as well just remove them and use the non-deprecated macros. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-02eigrpd: Create consts for TLV sizeDonald Sharp
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>
2017-10-29eigrpd: When writing packet don't crash in some casesDonald Sharp
When we are writing a packet if we have gotten ourselves into a bad situation, note it and move on. Hopefully dumping enough information so that we can find the offending reason. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-09eigrpd: fix clang warningVincent JARDIN
nbr cannot be NULL. Doing such test does confuse clang since we do not have execution case if nbr == NULL. Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
2017-10-08eirgpd: fix clang warningVincent JARDIN
opcode is not used. Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
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-09-05eigrpd: Clean up some new coverity issuesDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: Cleanup various SA IssuesDonald Sharp
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>
2017-08-24eigrpd: Convert pe->destination_ipv4 to pe->destinationDonald Sharp
Convert the destination_ipv4 to a struct prefix and just call it destination. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24eigrpd: No need to create TLV typeDonald Sharp
There is no need to create a TLV type to pass in for the FSM message. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-22Merge pull request #939 from jbonor/optimizationLou Berger
Optimization