summaryrefslogtreecommitdiffstats
path: root/bgpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: reindentreindent-3.0-afterwhitespace / reindent2017-08-09112-84617/+81750
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: simplify log message lookupQuentin Young2017-06-309-60/+54
| | | | | | | | | | | | | | | | log.c provides functionality for associating a constant (typically a protocol constant) with a string and finding the string given the constant. However this is highly delicate code that is extremely prone to stack overflows and off-by-one's due to requiring the developer to always remember to update the array size constant and to do so correctly which, as shown by example, is never a good idea.b The original goal of this code was to try to implement lookups in O(1) time without a linear search through the message array. Since this code is used 99% of the time for debugs, it's worth the 5-6 additional cmp's worst case if it means we avoid explitable bugs due to oversights... Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: fix segfault with some show commandsRenato Westphal2017-06-041-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The following commands were causing bgpd to crash when vpnv4/vpnv6 static routes are configured: bgpd aborted: vtysh -c "show ip bgp view all ipv4 vpn json" bgpd aborted: vtysh -c "show ip bgp view all ipv4 vpn" bgpd aborted: vtysh -c "show ip bgp view all ipv6 vpn json" bgpd aborted: vtysh -c "show ip bgp view all ipv6 vpn" bgpd aborted: vtysh -c "show ip bgp vrf all ipv4 vpn json" bgpd aborted: vtysh -c "show ip bgp vrf all ipv4 vpn" bgpd aborted: vtysh -c "show ip bgp vrf all ipv6 vpn json" bgpd aborted: vtysh -c "show ip bgp vrf all ipv6 vpn" bgpd aborted: vtysh -c "show bgp view all ipv4 vpn json" bgpd aborted: vtysh -c "show bgp view all ipv4 vpn" bgpd aborted: vtysh -c "show bgp view all ipv6 vpn json" bgpd aborted: vtysh -c "show bgp view all ipv6 vpn" bgpd aborted: vtysh -c "show bgp vrf all ipv4 vpn json" bgpd aborted: vtysh -c "show bgp vrf all ipv4 vpn" bgpd aborted: vtysh -c "show bgp vrf all ipv6 vpn json" bgpd aborted: vtysh -c "show bgp vrf all ipv6 vpn" Problem found with the CLI fuzzer. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* bgpd: fix addpath buffer overrunQuentin Young2017-06-042-18/+28
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: fix large-community-list commandsQuentin Young2017-06-041-0/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: remove encap safi vty related files bgp_encap.h|cLou Berger2017-05-236-91/+2
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: remove encap_safi rx processingLou Berger2017-05-233-155/+0
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: remove encap safi show commandsLou Berger2017-05-235-555/+7
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd rfapi: remove ability to configure use of encap-safi (continue to use ↵Lou Berger2017-05-231-2/+1
| | | | | | encap attribute) Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: remove support for ipv4|6 encap safi configLou Berger2017-05-232-223/+2
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: fix sending of invalid nexthops on the wireRenato Westphal2017-05-202-12/+47
| | | | | | | | | | | | | | | | | | | The bpacket_reformat_for_peer() function rewrites the nexthop of outgoing route updates on a per-peer basis in order to handle route-maps ("set ip next-hop") and locally-originated routes missing a nexthop. In the latter case, RFC 4271 says the following: "When announcing a locally-originated route to an internal peer, the BGP speaker SHOULD use the interface address of the router through which the announced network is reachable for the speaker as the NEXT_HOP". We were doing this for regular IPv4/IPv6 routes, but not for VPN/EVPN/ENCAP routes, which were being announced with invalid nexthops (0.0.0.0 or ::). This patch fixes this problem. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* bgpd: fix display of encap routes in the running configurationRenato Westphal2017-05-201-3/+5
| | | | | | | Static encap routes don't have an MPLS label. Also, use %u instead of %d to print the label. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* bgpd: add network commands for encapv6Renato Westphal2017-05-201-0/+38
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* bgpd: remove unused str2tag() functionRenato Westphal2017-05-202-26/+0
| | | | | | This function is not used anymore since commit fb1d2a2d9. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* bgpd: set NH len for ipv4 vpn|encap staticsLou Berger2017-05-191-1/+1
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: fix ipv4|6 vpn|encap with route-map show configLou Berger2017-05-181-0/+7
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgp: don't put empty encap or vnc attributes on the wireLou Berger2017-05-181-1/+4
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: repalce direct calls to system memory functionsLou Berger2017-05-181-2/+2
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* bgpd: cleanup vpn label config, set BoS, use 'label' in place of 'tag'Lou Berger2017-05-183-50/+52
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* Revert "bgpd: resolve ipv6 ecmp issue with vrfs and ll nexthop"David Lamparter2017-05-181-2/+1
| | | | | | | | | This reverts commit fa14eb2c0b408982a6634459b3afb21e9df6326a. This was for stable/2.0 and wasn't intended to go on stable/3.0 -- my bad, missed this in the merge. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge branch 'frr/pull/569'David Lamparter2017-05-185-26/+14
|\ | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: fix config of v6 vpn networks tagsLou Berger2017-05-175-26/+14
| | | | | | | | Signed-off-by: Lou Berger <lberger@labn.net>
* | Merge branch stable/2.0 into stable/3.0David Lamparter2017-05-185-7/+23
|\ \ | |/ |/| | | | | | | | | | | | | | | Conflicts: bgpd/bgp_fsm.c ospf6d/ospf6_lsa.c ospfd/ospf_vty.c zebra/redistribute.c Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * Pre-revert nonmergeable changesDavid Lamparter2017-05-181-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert "ospf6d: fix decimal area ID cli" commit a27cb3cfe901d4f1378116bc91e6656aaed7c74c Revert "bgpd: add back unicast option to 'address-family vpnv(4&6)' Issue #459" commit 399598bf6b749daa15d70ad64fc885d00cde1225 Revert "Fix the memory leak" commit d8d58e98397d8442ec68f8d715b64d5e6000b903 Revert "zebra: 'no ip route 4.1.1.19 255.255.255.255 99' is ambiguous" commit 83f35619359379687f21c839d61121e4ebe72541 Revert "ospf6d: Allow unconfig of unknown lsa's" commit 5b0747d71df6006835ead8e6354f70b26f7bca80 Revert "Fix the "Dead assignment" of clang SA." commit 3a6570a1f145c49155d72a815441025085dd45ad Revert "snapcraft: Improve README.usage.md based on feedback received" commit 2a3a819a9c2b2c9700e6228e7352e53b3562776c Revert "zebra: stop deregistering static nexthops unless removing the static" commit 1dac3a9619c8436f81c7b37f0252574b0b677dd0 All of these changes do not apply on stable/3.0 due to either CLI changes or another fix already being present. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * Merge branch 'frr/pull/557'David Lamparter2017-05-183-5/+20
| |\ | | | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| | * bgpd: Add epoch uptime to BGP neighbor json outputsDaniel Walton2017-05-172-1/+7
| | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
| | * bgp: garbage "neighbor (af 54816) remote-as internal" peer in show runDaniel Walton2017-05-171-1/+1
| | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
| | * bgpd: does not honor configured keepalive timerDaniel Walton2017-05-171-1/+4
| | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
| | * bgpd: "neighbor swpX interface remote-as XYZ" is ignoredDaniel Walton2017-05-171-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> If you did: neighbor swp1 interface neighbor swp1 interface remote-as external we would not set the remote-as. You could however still do neighbor swp1 remote-as external
| * | Merge branch 'stable/2.0' into bgp-fixesDon Slice2017-05-173-9/+9
| |\ \
| | * | bgpd: Fix vrf crashDonald Sharp2017-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that we have a valid vrf before we log information about it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
| | * | bgpd: More Extended nexthop fixingDonald Sharp2017-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically if we are reading in a cli with a extended-nexthop and we have not received from zebra the interface we are working on I believe we have a race condition where we are not propagating the PEER_FLAG_CAPABILITY_ENHE in this case. Modify the code to propagate even if we haven't found the interface yet. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| | * | bgpd: Fix ADJCHANGE message to include more infoDonald Sharp2017-05-161-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When bgp logs ADJCHANGE messages include the hostname and vrf that this change is being made in. Ticket: CM-10922 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| | * | bgpd: Fix occassional turn off of extended-nexthop for an ifDonald Sharp2017-05-161-7/+7
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, like once every 400 iterations, when you restart Quagga, extended-nexthop has been turned off for interface based config( for 5549 ). Examining the code, there is only 1 real path to setting the PEER_FLAG_CAPABILITITY_ENHE and that is through peer_conf_interface_get. Modify this code path to always set the PEER_FLAG_CAPABILITY_ENHE if it is not already set. In addition, fix a possible pointer dereference. Ticket: CM-12929 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | bgpd: resolve ipv6 ecmp issue with vrfs and ll nexthopDon Slice2017-05-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem reported that ecmp wasn't working correctly in a vrf with ipv6. Issue was that originator of the routes were sending the updates with a link-local nexthop and nhlen of 16. In this particular case, bgp_zebra_announce was using the wrong call to get the ifindex and was not supplying the vrf. This caused ecmp to work only in the case of the default vrf. Ticket: CM-15545 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: CCR-6017
| * | bgpd: fix crash in bgp_stop due to missing vrfDon Slice2017-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem found to be derefencing a vrf that had already been deleted. Fix verifies that vrf exists before using it. Ticket: CM-13682 Signed-off-by: Don Slice Reviewed By: Vivek Venkatraman Testing Done: manual testing, re-run of failing scripts good
| * | bgpd: Fix ADJCHANGE message to include more infoDonald Sharp2017-05-161-4/+15
| |/ | | | | | | | | | | | | | | | | When bgp logs ADJCHANGE messages include the hostname and vrf that this change is being made in. Ticket: CM-10922 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * bgpd: add back unicast option to 'address-family vpnv(4&6)' Issue #459Lou Berger2017-05-091-0/+16
| |
| * bgpd: Fix 'set as-path prepend last-as 10'Donald Sharp2017-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The route-map compilation function was comparing < 10 instead of <= 10. While the cli was accepting 1-10. Fix: ! route-map FOO permit 44 set as-path prepend last-as 10 ! Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | bgpd: Fix vrf crashDonald Sharp2017-05-171-1/+1
| | | | | | | | | | | | | | | | Ensure that we have a valid vrf before we log information about it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
* | bgpd: More Extended nexthop fixingDonald Sharp2017-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Basically if we are reading in a cli with a extended-nexthop and we have not received from zebra the interface we are working on I believe we have a race condition where we are not propagating the PEER_FLAG_CAPABILITY_ENHE in this case. Modify the code to propagate even if we haven't found the interface yet. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | bgpd: Fix ADJCHANGE message to include more infoDonald Sharp2017-05-171-4/+15
| | | | | | | | | | | | | | | | | | When bgp logs ADJCHANGE messages include the hostname and vrf that this change is being made in. Ticket: CM-10922 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | bgpd: Fix occassional turn off of extended-nexthop for an ifDonald Sharp2017-05-171-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, like once every 400 iterations, when you restart Quagga, extended-nexthop has been turned off for interface based config( for 5549 ). Examining the code, there is only 1 real path to setting the PEER_FLAG_CAPABILITITY_ENHE and that is through peer_conf_interface_get. Modify this code path to always set the PEER_FLAG_CAPABILITY_ENHE if it is not already set. In addition, fix a possible pointer dereference. Ticket: CM-12929 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #521 from opensourcerouting/bgpd-fixes-stableDonald Sharp2017-05-132-6/+20
|\ \ | | | | | | bgpd: assorted fixes (stable/3.0)
| * | bgpd: fix segfault with '[no] bgp network import-check'Renato Westphal2017-05-121-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | These commands were causing bgpd to crash if a static VPN route was configured. While here, fix a bug in bgp_static_add() and bgp_static_delete(). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | bgpd: fix duplicate install of commandRenato Westphal2017-05-121-1/+0
| | | | | | | | | | | | | | | | | | Only happens when FRR is configured with --enable-oldvpn-commands. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | bgpd: fix 'show bgp [...] longer-prefixes'Renato Westphal2017-05-121-1/+1
| | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | | Merge pull request #508 from LabNConsulting/working/3.0/patch/issue198David Lamparter2017-05-131-137/+0
|\ \ \ | |/ / |/| | bgpd: Issue #198 - clean up duplicate encap SAFI commands
| * | bgpd: Issue #198 - clean up duplicate command resulting from CLI refactoringLou Berger2017-05-111-137/+0
| | | | | | | | | | | | Signed-off-by: Lou Berger <lberger@labn.net>
* | | bgpd: fixup bgpd: allow VPN next hop to be different AFI than NLRI nextPhilippe Guibert2017-05-111-2/+3
|/ / | | | | | | | | | | | | | | hop for EVPN In the case of EVPN, add the nexthop attribute. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>