summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrp_update.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* eigrpd, lib, tests, vtysh: security (cppcheck)paco2018-06-191-1/+0
| | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* eigrpd: Use EIGRP_PACKET_MTU(mtu) macroPiotr Jurkiewicz2018-05-041-4/+4
| | | | Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
* eigrpd: Correctly calculate EIGRP packet MTUPiotr Jurkiewicz2018-05-041-10/+10
| | | | | | 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-18/+18
| | | | | | | | | | | | | | | | | | | | | | 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-64/+63
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* eigrpd: Create consts for TLV sizeDonald Sharp2017-11-021-2/+3
| | | | | | | 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: Convert topology list to a tableDonald Sharp2017-10-241-15/+32
| | | | | | | | 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 list_delete(struct list *) to ** to allow nullingDonald Sharp2017-10-051-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* eigrpd: Remove ei mapping to connected routesDonald Sharp2017-10-031-20/+20
| | | | | | | | | | 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>
* Merge pull request #1051 from donaldsharp/plistsDavid Lamparter2017-09-051-213/+94
|\ | | | | Refactor Access and Prefix Lists application
| * eigrpd: eigrp_neighbor_entry to eigrp_nexthop_entryDonald Sharp2017-08-271-9/+9
| | | | | | | | | | | | | | | | 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>
| * eigrpd: Refactor access/prefix list applicationsDonald Sharp2017-08-261-160/+48
| | | | | | | | | | | | | | | | 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>
| * eigrpd: Make code a bit easier to read in eigrp_update.cDonald Sharp2017-08-261-56/+51
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * eigrpd: Fix access/prefix list handling in updatesDonald Sharp2017-08-261-4/+2
| | | | | | | | | | | | | | | | 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>
* | eigrpd: Cleanup various SA IssuesDonald Sharp2017-08-251-0/+3
|/ | | | | | | | | | 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: Refactor eigrp_topoloy_table_lookup_ipv4Donald Sharp2017-08-241-23/+19
| | | | | | | Allow eigrp_topology_table_lookup_ipv4 to use 'struct prefix' Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Convert pe->destination_ipv4 to pe->destinationDonald Sharp2017-08-241-26/+22
| | | | | | | 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-32/+6
| | | | | | | There is no need to create a TLV type to pass in for the FSM message. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Remove union from FSM msgDonald Sharp2017-08-241-3/+3
| | | | | | Remove the union of passing the TLV and just pass the metric in. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: make fsm msg data_type an enumDonald Sharp2017-08-241-3/+3
| | | | | | | | 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>
* eigrpd: Refactor FSM callingDonald Sharp2017-08-241-6/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Fix memory leak in FSMDonald Sharp2017-08-241-38/+30
| | | | | | | | | 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>
* eigrpd: Start split-horizonDonald Sharp2017-08-241-2/+6
| | | | | | | | | 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>
* eigrpd: fix crash when external route is receivedDonnie Savage (dsavage)2017-08-201-3/+16
| | | | | | | | | 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>
* eigrpd: Pass in actual used parameter to header creationDonald Sharp2017-08-191-12/+14
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Allow eigrp_update_send to recognize a full packetDonald Sharp2017-08-191-25/+65
| | | | | | | | 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>
* eigrpd: Fix memory leak in eigrp_updateDonald Sharp2017-08-191-51/+53
| | | | | | | | | | | 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>
* eigrpd: When generating packets only put one on send queue at a timeDonald Sharp2017-08-181-2/+3
| | | | | | | 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>
* eigrpd: and More Debugging CleanupDonald Sharp2017-08-181-4/+0
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Cleanup some more debugsDonald Sharp2017-08-181-2/+0
| | | | | | Properly place a few more debugs. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Cleanup FIFODonald Sharp2017-08-181-4/+4
| | | | | | | | | | | | 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: Store nbr in packet dataDonald Sharp2017-08-171-5/+5
| | | | | | | | Store the neighbor information( if available ) in the packet data that we are sending. This will allow in a future commit the ability to fixup the outgoing ack we are sending. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Fix crash and attempt to send dataDonald Sharp2017-08-051-65/+65
| | | | | | | | | | | | This code fixes a crash in EIGRP when on initial neighbor formation we need to send more than 1 packet of data to the nbr. I was testing this by redistributing connected and just adding a bunch of /32 address to an interface. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-6/+6
| | | | | | | | | This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindent pt. 2whitespace / reindent2017-07-171-6/+6
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-933/+954
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #818 from donaldsharp/eigrp_afiJafar Al-Gharaibeh2017-07-141-1/+1
|\ | | | | Eigrp afi
| * eigrpd: Fixed wrong type usedDonald Sharp2017-07-141-1/+1
| | | | | | | | | | | | | | Recent additions to prefix_copy to check afi type exposed an issue with eigrp setting the wrong afi type for a `struct prefix`. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-1/+1
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use vty_outlnQuentin Young2017-06-291-3/+2
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: do not take address of packed memberQuentin Young2017-05-261-1/+1
| | | | | | May result in alignment errors on certain platforms Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #537 from donaldsharp/vrf_stuffDavid Lamparter2017-05-171-59/+27
|\ | | | | Vrf stuff
| * Merge branch 'master' into vrf_stuffDonald Sharp2017-05-161-20/+0
| |\
| * | eigrpd: Cleanup a bunch SA warnings.Donald Sharp2017-05-161-59/+27
| | | | | | | | | | | | | | | | | | | | | 1) Cleanup SA warnings, more to come 2) Cleanup some non debug guarded zlog_info code Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| |/ |/| | | | | | | | | | | | | | | | | | | 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>
* | eigrpd: Some Basic CorrectionsRenato Westphal2017-05-131-20/+0
|/ | | | | | | | * Advertise routes to zebra * Connected routes should not have a nexthop address * Fix segfaut on exit Signed-off-by: Renato Westphal <renatowestphal@gmail.com>
* eigrpd: spatch thread_add* calls and macrosQuentin Young2017-05-091-4/+9
| | | | | | As described in previous commits Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* eigrpd: Cleanup tab/spacing of the *.c filesDonald Sharp2017-04-081-572/+566
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Cleanup the mergeDonald Sharp2017-04-061-10/+10
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Fix non-installation of routes into zebraDonald Sharp2017-03-201-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EIGRP was not installing routes it learned from it's neighbors into the rib. This is probably a hack, but zebra now knows about the routes. robot.cumulusnetworks.com# show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, > - selected route, * - FIB route K>* 0.0.0.0/0 via 10.0.2.2, enp0s3 C>* 10.0.2.0/24 is directly connected, enp0s3 E 192.168.2.0/24 [0/0] via 127.0.0.1, enp0s10 inactive C>* 192.168.2.0/24 is directly connected, enp0s10 E>* 192.168.3.4/32 [0/0] via 192.168.2.144, enp0s10 E>* 192.168.4.5/32 [0/0] via 192.168.2.144, enp0s10 E>* 192.168.4.6/32 [0/0] via 192.168.2.144, enp0s10 C>* 192.168.22.11/32 is directly connected, lo robot.cumulusnetworks.com# show ip route 192.168.4.5 Routing entry for 192.168.4.5/32 Known via "eigrp", distance 0, metric 0, best * 192.168.2.144, via enp0s10 robot.cumulusnetworks.com# Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>