summaryrefslogtreecommitdiff
path: root/zebra/interface.c
AgeCommit message (Collapse)Author
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-05*: Convert list_free usage to list_deleteDonald Sharp
list_free is occassionally being used to delete the list and accidently not deleting all the nodes. We keep running across this usage pattern. Let's remove the temptation and only allow list_delete to handle list deletion. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05*: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp
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>
2017-09-15*: use clang's 'ForEachMacros' format style optionRenato Westphal
This fixes the broken indentation of several foreach loops throughout the code. From clang's documentation[1]: ForEachMacros: A vector of macros that should be interpreted as foreach loops instead of as function calls. [1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-11Merge pull request #1084 from donaldsharp/zebra_frameDavid Lamparter
zebra: Fix vty_frame usage in zebra
2017-08-31zebra: Refactor connected_down_ipv[4|6]Donald Sharp
The connected_down_ipv[4|6] functions are basically identical. Refactor into one common interface. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31zebra: Refactor connected_up_ipv[4|6]Donald Sharp
The connected_up_ipv[4|6] functions were almost identical. Combine the forces for the goodness of mankind Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31Merge pull request #1079 from qlyoung/fix-style-aRenato Westphal
*: fix style
2017-08-31Merge pull request #1044 from donaldsharp/combinationJafar Al-Gharaibeh
Coverity Cleanup of Stuff
2017-08-31zebra: Fix vty_frame usage in zebraDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-30*: fix styleQuentin Young
Fixes style nits introduced by recent pull requests. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-29Merge pull request #1059 from opensourcerouting/oldbits-1Donald Sharp
zebra: PtP address configuration support
2017-08-29Merge pull request #1056 from opensourcerouting/oldbits-0Donald Sharp
"pathspace" options, vtysh-suid-cleanups, "vty_frame()"
2017-08-29*: remove empty "interface XYZ" config blocksDavid Lamparter
Using the previously-added vty_frame() support, this gets rid of all the pointless empty "interface XYZ" blocks that get added for any interface that shows up in the system (e.g. dummys, tunnels, etc.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-28Merge branch 'master' into dev-masterMitesh Kanjariya
2017-08-27zebra: add '[no] ip address A.B.C.D peer A.B.C.D/M'David Lamparter
introduce a new command to configure a Point-to-Point address on an interface. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-27zebra: fix interface deletion bug introduced by ptp address supportDavid Lamparter
meh. forgot to even look at the interface deletion path. this doesn't really work well when looking for the local address in the subnet list which has the connected prefix in it... loop ensues. fix by using the connected prefix when looking at the list of connected prefixes. duh. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-27zebra: add connected_check_ptp infrastructureDavid Lamparter
add a connected_check_ptp function which does the same as connected_check, but takes an additional peer prefix argument. also fix related prefixlen mixup in PtP addresses (the local part of a PtP address always is /32, but previously the peer mask got copied.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-24*: fix assorted issues detected by Coverity ScanRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-20zebra: lookup link by ifindexMitesh Kanjariya
Frr has an assumption that when interface A links to B, we already know about B. But that might be true always. It is probably purely depends on the configuration and how the interfaces are hashed in Kernel. FRR seems to sometimes get "A is linked to B" before it knows about B, in that case, the linkage between the data structure for A & B won't be proper. Ticket: CM-17679 Review: ccr-6628 Testing: Manual Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-15zebra: start detangling rtadv & irdpDavid Lamparter
Replace some cross-dependencies with hooks & move bits to where they belong. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-15lib: replace if_add_hook with hook_* logicDavid Lamparter
This allows modules to register their own additional hooks on interface creation/deletion. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-06zebra: vrf: remove VRF-move static route updatingDavid Lamparter
This was incorrectly implemented to begin with (it only re-added routes, but didn't remove them) and is now covered in static_ifindex_update. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-06zebra: static: update on ifindex changesDavid Lamparter
Whenever an interface is created or deleted in the system, we need to check whether we have static routes referencing that interface by name. If so, we need to [un]install these routes. This has the unfortunate side effect of making static routes with non-existent interfaces disappear from "show ip route", but I think that's acceptable (and I don't see a "good" fix for that). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-22Revert "*: reindent pt. 2"David Lamparter
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>
2017-07-18Merge pull request #828 from tigranmartirosyan/masterQuentin Young
#752 ARP is not updating if mac address changed on remote side
2017-07-18Add 1 more identation to correspond to kernel style multi-line commenttmartiro
2017-07-18replace space to tabs, add kernel styles multiline, remove trailing whitespaces.tmartiro
2017-07-17*: reindent pt. 2whitespace / reindent
w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
2017-07-17merge with upstreamtmartiro
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-14bgpd, zebra: Cleanup warnings from new codeDonald Sharp
1) Clean up VTY_NEWLINE -> \n 2) Remove usages of VTY_GET_INTEGER Signed-off-by: Donald Sharp
2017-07-14Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attrDonald Sharp
2017-07-14Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attrDonald Sharp
2017-07-14Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter
Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14*: remove VTYNL, part 4 of 6David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14*: remove VTYNL, part 3 of 6David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14*: remove VTYNL, part 1 of 6David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14*: ditch vty_outln(), part 2 of 2David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13vtysh: return non-zero for configuration failuresDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error.
2017-07-13*: ditch vty_outln(), part 1 of 2David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-12zebra: MAC and Neighbor (ARP/ND) handlingvivek
Implement handling of MACs and Neighbors (ARP/ND entries) in zebra: - MAC and Neighbor database handlers - Read MACs and Neighbors from the kernel, when needed and create entries in zebra's MAC and Neighbor databases. - Handle add/update/delete notifications from the kernel for MACs and Neighbors and update zebra's database appropriately - Inform locally learnt MACs and Neighbors to client - Handle MACIP add/delete from client and install appriporiate entries into the kernel - Since Neighbor entries will be installed on an SVI, implement the needed mappings NOTE: kernel interface is only implemented for Linux/netlink Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12zebra: VNI and VTEP handlingvivek
Implement fundamental handling for VNIs and VTEPs: - Handle EVPN enable/disable by client (advertise-all-vni) - Create/update/delete VNIs based on VxLAN interface events and inform client - Handle VTEP add/delete from client and install into kernel - New debug command for VxLAN/EVPN - kernel interface (Linux/netlink only) Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12zebra: Layer-2 interface handlingvivek
Define interface types of interest and recognize the types. Store layer-2 information (VLAN Id, VNI etc.) for interfaces, process bridge interfaces and map bridge members to bridge. Display all the additional information to user (through "show interface"). Note: Only implemented for the netlink interface. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-03fix #752 problem: ARP is not updating if mac address changed on remote sidetigranmartirosyan
2017-06-29Merge pull request #767 from donaldsharp/if_updateJafar Al-Gharaibeh
bgpd, lib, zebra: Fix if_update function to represent what it does
2017-06-29*: vty_outln (vty, "") --> vty_out (vty, VTYNL)Quentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29*: s/VTY_NEWLINE/VTYNL/gQuentin Young
Should be able to fit more vty_out onto one line now Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29*: use vty_outlnQuentin Young
Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29bgpd, lib, zebra: Fix if_update function to represent what it doesDonald Sharp
The if_update function was taking the interface name as input and reapplying it, using strncpy to reapply the name. This has several issues. strncpy should not be used to copy memory in place. The second issue is that the interface name is not actually changing when we update interface to be in the new vrf. Since every usage of if_update was just reapplying the same name the interface actually had, just remove that part of the function and rename it to if_update_to_new_vrf to represent what it is actually doing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>