summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrp_packet.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-16/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* eigrpd: changes for code maintainabilitysri-mohan12022-09-121-4/+4
| | | | | | these changes are for improving the code maintainability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* *: Properly use memset() when zeroingDonatas Abraitis2022-05-111-2/+2
| | | | | | | Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* *: Change thread->func to return void instead of intDonald Sharp2022-02-241-24/+20
| | | | | | | 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>
* eigrpd: Ensure better `struct thread *` semanticsDonald Sharp2021-10-041-6/+0
| | | | | | | | | | | | 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>
* eigrpd: Test for EIGRP AS number and ensure it's the sameDon Slice2021-05-031-3/+8
| | | | | | | When receiving a packet, ensure that the AS number is the same. Fixes: 8515 Signed-off-by: Don Slice <dslice@nvidia.com>
* eigrpd: kill eigrp_memory.h, use MTYPE_STATICDavid Lamparter2021-03-221-1/+7
| | | | | | | 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>
* *: fix printf extension typesDavid Lamparter2021-03-141-2/+2
| | | | | | Some mistakes have crept in again. Signed-off-by: David Lamparter <equinox@diac24.net>
* eigrpd: Convert to using our builtin printf stuffDonald Sharp2021-03-141-9/+3
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* eigrpd: Rename nexthop_entry and prefix_entry to better namesDonnie Savage2021-01-121-1/+1
| | | | | | | | | | 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>
* eigrpd: Replace inet_ntoa with %pI4Donald Sharp2020-10-221-24/+20
| | | | | | Search and destroy the inet_ntoa usage in eigrp Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: un-split strings across linesDavid Lamparter2020-07-141-8/+4
| | | | | | | | | | | | | | | | | 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>
* eigrpd: stop checking for ancient OpenBSDRuben Kerkhof2020-03-111-1/+1
| | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis2020-03-051-4/+4
| | | | | | Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* ospfd,eigrpd: don't take address of packed struct memberMark Stapp2019-11-111-4/+5
| | | | | | | | 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>
* eigrpd: Convert eigrp_packet.c to not use VRF_DEFAULTDonald Sharp2019-08-071-8/+11
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Use the eigrp->vrf_id where we can immediately transformDonald Sharp2019-08-071-1/+1
| | | | | | | 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>
* eigrpd: Fix endianness issue in packetsPawel Dembicki2019-06-141-31/+15
| | | | | | | | | | | | 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>
* eigrp: Make the eigrp_interface have a prefix instead of a *prefixDonald Sharp2019-02-111-7/+7
| | | | | | | | | 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>
* Treewide: use ANSI function definitionsRuben Kerkhof2019-01-241-4/+4
| | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* *: style for EC replacementsQuentin Young2018-09-131-7/+6
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-131-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* eigrpd: EIGRP_[ERR|WARN] -> EC_EIGRPQuentin Young2018-09-131-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename zlog_fer -> flog_errQuentin Young2018-08-141-3/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* eigrpd: Add EIGRP_ERR_XXX for zlog_err to zlog_ferrDonald Sharp2018-08-141-3/+6
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Convert to use LIB_ERR_XXX for zlog_errDonald Sharp2018-08-141-2/+4
| | | | | | Convert, where appropriate, to using LIB_ERR_XXX for zlog_ferr Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: sizeof() usage + dead code (PVS-Studio)F. Aragon2018-07-021-3/+3
| | | | | | | | | | 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>
* eigrpd, isisd, lib, ospfd: no effect (cppcheck)paco2018-06-191-2/+0
| | | | | | Assignment of function parameter has no effect outside the function. Signed-off-by: F. Aragon <paco@voltanet.io>
* eigrpd: Use EIGRP_PACKET_MTU(mtu) macroPiotr Jurkiewicz2018-05-041-1/+2
| | | | Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
* eigrpd: Correctly calculate EIGRP packet MTUPiotr Jurkiewicz2018-05-041-1/+1
| | | | | | Someone forgot that EIGRP packets are encapsulated in IP. Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-24/+23
| | | | | | | | | | | | | | | | | | | | | | 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>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-24/+23
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* *: don't use deprecated stream.h macrosQuentin Young2017-12-011-2/+2
| | | | | | | 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>
* eigrpd: Create consts for TLV sizeDonald Sharp2017-11-021-18/+50
| | | | | | | 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>
* eigrpd: When writing packet don't crash in some casesDonald Sharp2017-10-291-2/+13
| | | | | | | | | 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>
* eigrpd: fix clang warningVincent JARDIN2017-10-091-1/+1
| | | | | | | 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>
* eirgpd: fix clang warningVincent JARDIN2017-10-081-4/+1
| | | | | | opcode is not used. Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
* eigrpd: Remove ei mapping to connected routesDonald Sharp2017-10-031-29/+11
| | | | | | | | | | 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>
* eigrpd: Clean up some new coverity issuesDonald Sharp2017-09-061-2/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Cleanup various SA IssuesDonald Sharp2017-08-251-11/+18
| | | | | | | | | | 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>
* eigrpd: Convert pe->destination_ipv4 to pe->destinationDonald Sharp2017-08-241-30/+14
| | | | | | | Convert the destination_ipv4 to a struct prefix and just call it destination. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: No need to create TLV typeDonald Sharp2017-08-241-10/+10
| | | | | | | There is no need to create a TLV type to pass in for the FSM message. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #939 from jbonor/optimizationLou Berger2017-08-221-1/+1
|\ | | | | Optimization
| * lib: optimize IPV4_ADDR_[SAME|COPY]()Jorge Boncompte2017-08-171-1/+1
| | | | | | | | | | | | | | | | | | Change all callers of IPV4_ADDR_SAME() to pass a pointer to a struct in_addr Use assignment and comparison instead of memcpy() and memcmp(). Avoids function calls. Faster. Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
* | eigrpd: Pass in actual used parameter to header creationDonald Sharp2017-08-191-3/+3
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | eigrpd: Only put 1 packet at a time on send queueDonald Sharp2017-08-181-24/+19
| | | | | | | | | | | | | | | | When we have received an ack for the last reliable packet we must only put 1 packet onto the send queue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | eigrpd: and More Debugging CleanupDonald Sharp2017-08-181-2/+2
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | eigrpd: Cleanup some more debugsDonald Sharp2017-08-181-1/+1
| | | | | | | | | | | | Properly place a few more debugs. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | eigrpd: Cleanup FIFODonald Sharp2017-08-181-42/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | eigrpd: Rework ack sent to neighborDonald Sharp2017-08-171-31/+32
| | | | | | | | | | | | | | | | | | | | EIGRP schedules and builds packets to send in the future. Before those packets are being sent, we are receiving update information from our peer. At that time we need to reach into the built packet and reset the outgoing ack to a better value. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>