summaryrefslogtreecommitdiff
path: root/zebra/interface.c
AgeCommit message (Collapse)Author
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>
2017-06-27*: remove VTY_GET_*Quentin Young
CLI validates input tokens, so there's no need to do it in handler functions anymore. spatch follows ---------------- @getull@ expression v; expression str; @@ <... - VTY_GET_ULL(..., v, str) + v = strtoull (str, NULL, 10) ...> @getul@ expression v; expression str; @@ <... - VTY_GET_ULONG(..., v, str) + v = strtoul (str, NULL, 10) ...> @getintrange@ expression name; expression v; expression str; @@ <... - VTY_GET_INTEGER_RANGE(name, v, str, ...) + v = strtoul (str, NULL, 10) ...> @getint@ expression v; expression str; @@ <... - VTY_GET_INTEGER(..., v, str) + v = strtoul (str, NULL, 10) ...> @getv4@ expression v; expression str; @@ <... - VTY_GET_IPV4_ADDRESS(..., v, str) + inet_aton (str, &v) ...> @getv4pfx@ expression v; expression str; @@ <... - VTY_GET_IPV4_PREFIX(..., v, str) + str2prefix_ipv4 (str, &v) ...> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-08zebra: Fix --disable-rtadv to actually compileAlex Couloumbis
Signed-off-by: Alex Couloumbis <alex@ozo.com> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-18zebra: Add code to track kernel interactionsDonald Sharp
Allow zebra to track kernel interactions. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-18Merge branch 'stable/3.0'David Lamparter
Conflicts: ospf6d/ospf6_lsa.c ospfd/ospf_vty.c zebra/interface.c Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18Merge branch stable/2.0 into stable/3.0David Lamparter
Conflicts: bgpd/bgp_fsm.c ospf6d/ospf6_lsa.c ospfd/ospf_vty.c zebra/redistribute.c Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-17zebra: Move interfaces to default before deletingDon Slice
Encountered a crash in zebra due to getting a delete on an SVI with VRR configured. Since we don't actually do a delete but flag the interface as inactive, slag VRR interfaces would remain on the vrf_iflist with a lock count of zero, causing the crash. Since all other interface types are moved to the default table before deleting, doing the same thing for any interfaces that were left in the vrf. Testing includes manual testing, bgp-min, ospf-min, vrf-min, bgp-smoke, and ospf-smoke. All passed (first time or on rerun) or match known failures. Ticket: CM-13288 Signed-off-by: Don Slice Reviewed-by: Donald Sharp
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-08Merge remote-tracking branch 'origin/stable/3.0'Donald Sharp
2017-05-04*: fix a bunch of segfaults detected by a CLI fuzzerRenato Westphal
This patch fixes the following segfaults: zebra aborted: vtysh -c "show ipv6 mroute" zebra aborted: vtysh -c "configure terminal" -c "debug zebra kernel msgdump" zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no packet-loss" zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no metric" zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no ava-bw" zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no res-bw" zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no use-bw" ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "area 1.1.1.1 nssa" ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "area 4294967295 nssa" pimd aborted: vtysh -c "show ip msdp sa 1.1.1.1" pimd aborted: vtysh -c "configure terminal" -c "ip ssmpingd" pimd aborted: vtysh -c "configure terminal" -c "no ip ssmpingd" pimd aborted: vtysh -c "configure terminal" -c "no ip msdp mesh-group WORD source" pimd aborted: vtysh -c "configure terminal" -c "interface eth99" -c "ip pim hello 180" bgpd aborted: vtysh -c "show bgp l2vpn evpn rd 1:1" bgpd aborted: vtysh -c "clear vnc nve un *" bgpd aborted: vtysh -c "clear vnc nve un 1.1.1.1" bgpd aborted: vtysh -c "clear vnc nve un 2001:db8::1" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 cost 255 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 cost 255" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 cost 255 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 cost 255" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 cost 255 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 cost 255" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 cost 255 lifetime 4294967295" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 cost 255" bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp ipv4 prefix-list NAME" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp ipv6 prefix-list NAME" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp route-map NAME" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra ipv4 prefix-list NAME" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra ipv6 prefix-list NAME" bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra route-map NAME" bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "no set ipv6 vpn next-hop" bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "set vpnv4 next-hop" bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "set vpnv6 next-hop" bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "address-family ipv6 vpn" -c "network 2001:db8::1/128 rd 1:1 tag WORD" bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "address-family vpnv6 unicast" -c "network 2001:db8::1/128 rd 1:1 tag WORD" bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "no neighbor WORD shutdown message MSG..." bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "neighbor WORD shutdown message MSG..." More to come later. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-05-02Merge remote-tracking branch 'origin/stable/3.0'Donald Sharp
2017-05-01zebra: fix detection of interface renamesRenato Westphal
Restore the original logic in netlink_link_change() which works like this: * once an interface event is detected, lookup the associated interface by its name; * call the set_ifindex() function; * set_ifindex() will lookup the interface again but now by its ifindex. If the lookups by name and ifindex yield to different results, then the interface was renamed and set_ifindex() will take care of that. In the future, zns->if_table will be split into two different data structures to allow faster lookups by both name and ifindex. Fixes Issue #397. Regression introduced by commit 12f6fb9. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-04-28lib: fix segfault on exit caused by interface removalRenato Westphal
Add missing bits to properly unlink interface in the if_unlink_per_ns() function. In the long term we should convert if_table to use a more convenient data structure like a red-black tree instead of a routing table. Fixes issue #398. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-04-18zebra: stop crash on process termination due to stale ifp->nodeDon Slice
Problem reported that crash occurred when stopping quagga in certain circumstances. Determined that this was due to a stale pointer on the ifp for a deleted interface. The ifp->node had been freed but the ifp still kept a pointer to it, and when later the process was stopped, it attempted to delete it again. Ticket: CM-15550 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-04zebra: Fix printf formattingDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-03zebra: Display new speed information in 'show int..' commandDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-28*: apply DEFUN_NOSH for node-switch CLI commandsDavid Lamparter
These have copies in vtysh that do the node-switch locally and are listed in extract.pl's ignore list. The ignore list however is redundant since DEFUN_NOSH does the same thing... ldpd is a bit hacky, but Renato is reworking this anyway. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-15bgpd, lib, zebra: Rename if_update_vrf -> if_updateDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>