Commit Graph

19802 Commits

Author SHA1 Message Date
Donald Sharp
2c77ddee4b zebra: Display ifindex of interface being installed on
When installing a nexthop group, dump out the ifindex of the
nexthop being installed as a bit more data for the developer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-01 11:58:20 -04:00
Quentin Young
af6642f0e7
Merge pull request #6326 from mjstapp/ignore_emacs_desktop
git: ignore emacs desktop
2020-04-30 18:23:27 -04:00
Mark Stapp
7b7190e249 git: ignore emacs desktop
Ignore the emacs desktop files - should never ever be committed

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-30 14:19:10 -04:00
Mark Stapp
02d5306306
Merge pull request #6323 from donaldsharp/floom
bgpd: Ensure that we have a ifp pointer
2020-04-30 13:25:42 -04:00
Donald Sharp
5a48025ccc
Merge pull request #6322 from ton31337/feature/bgp_bogon_filter_example
doc: Add an example how to filter BGP bogon ASNs
2020-04-30 13:14:30 -04:00
Donald Sharp
68cecc3b69 bgpd: Ensure that we have a ifp pointer
It is possible that the if_lookup_by_index() call will return
a NULL value and calling zclient_send_interface_radv_req.  Just
test that we have a valid interface pointer.

Found by Coverity

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-30 11:16:28 -04:00
Donatas Abraitis
125cec1a8f doc: Add an example how to filter BGP bogon ASNs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-30 17:38:31 +03:00
Donatas Abraitis
fb985e0c7e bgpd: Make sure network/aggregate-address commands lay down under labeled safi
unicast and labeled-unicast share the same table, but configuration should
be visible for both independently. Without this fix it confuses a bit
because when you enter `network 10.0.0.0/24` under labeled-unicast it's
written in unicast family block.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-30 17:01:10 +03:00
Donald Sharp
ba3f5f06d0
Merge pull request #6318 from opensourcerouting/fix-exit-vrf
lib: update the CLI xpath index when exiting from the VRF node
2020-04-30 07:30:01 -04:00
Donald Sharp
58df03afb1
Merge pull request #6320 from opensourcerouting/fix-vrf-misconfig-detection
zebra: fix detection of VRF misconfiguration
2020-04-30 07:29:17 -04:00
Olivier Dugeon
774e3570e9 isisd: Update IS-IS SR Label Manager
This change modify the way IS-IS is connected to the Label Manager:
 - Add emission of Hello Message prior to the connection as per
   modification introduced by PR #5925
 - Add 'session_id' as per modification introduced by PR #6224
 - Add Doxygen documentation to Label Manager functions

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-04-30 12:15:47 +02:00
Olivier Dugeon
e0e8a84fd8 isisd: Update ISIS-SR with new ZAPI message
Update label enforcement due to modification in zapi message:
zapi_nexthop_label becomes zapi_nexthop as per PR #5813

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-04-30 12:15:47 +02:00
Renato Westphal
591373bdd7 tests: add topotest for IS-IS SR
This commit introduces a comprehensive test for IS-IS Segment
Routing. It features the following network topology:

                         +---------+
                         |         |
                         |   RT1   |
                         | 1.1.1.1 |
                         |         |
                         +---------+
                              |eth-sw1
                              |
                              |
                              |
         +---------+          |          +---------+
         |         |          |          |         |
         |   RT2   |eth-sw1   |   eth-sw1|   RT3   |
         | 2.2.2.2 +----------+----------+ 3.3.3.3 |
         |         |     10.0.1.0/24     |         |
         +---------+                     +---------+
    eth-rt4-1|  |eth-rt4-2          eth-rt5-1|  |eth-rt5-2
             |  |                            |  |
  10.0.2.0/24|  |10.0.3.0/24      10.0.4.0/24|  |10.0.5.0/24
             |  |                            |  |
    eth-rt2-1|  |eth-rt2-2          eth-rt3-1|  |eth-rt3-2
         +---------+                     +---------+
         |         |                     |         |
         |   RT4   |     10.0.6.0/24     |   RT5   |
         | 4.4.4.4 +---------------------+ 5.5.5.5 |
         |         |eth-rt5       eth-rt4|         |
         +---------+                     +---------+
       eth-rt6|                                |eth-rt6
              |                                |
   10.0.7.0/24|                                |10.0.8.0/24
              |          +---------+           |
              |          |         |           |
              |          |   RT6   |           |
              +----------+ 6.6.6.6 +-----------+
                  eth-rt4|         |eth-rt5
                         +---------+

Each router has both an IPv4 and an IPv6 loopback address, each of
which has a corresponding Prefix-SID configured.

Basic SR functionality is tested. First, the topotest ensures that
all expected Prefix-SIDs and Adj-SIDs are flooded and installed
correctly in all routers of the network. Later, network failures
are simulated and configuration changes are performed in several
different routers. The topotest then checks if IS-IS has converged
as expected in the network according to the network failures and
configuration changes that happened.

The topotest comprises 11 different steps, each with four individual
tests (for a total of 44 tests). A summary of what each step does
is provided below:

---

STEP 1:
-Initial network convergence

---

Step 2:
Action(s):
-Disable IS-IS on the eth-rt5 interface on rt4

Expected changes:
-rt4 should uninstall the Adj-SIDs pointing to rt5
-rt5 should uninstall the Adj-SIDs pointing to rt4
-rt2 should reinstall rt5's Prefix-SIDs (2 nexthops deleted)
-rt3 should reinstall rt4's Prefix-SIDs (2 nexthops deleted)
-rt4 should reinstall rt3's Prefix-SIDs (1 nexthop deleted)
-rt4 should reinstall rt5's Prefix-SIDs (1 nexthop changed)
-rt5 should reinstall rt2's Prefix-SIDs (1 nexthop deleted)
-rt5 should reinstall rt4's Prefix-SIDs (1 nexthop changed)

---

Step 3:
Action(s):
-Shut down the eth-rt4 interface on rt6
-Shut down the eth-rt5 interface on rt6

Expected changes:
-All routers should uninstall rt6's Prefix-SIDs
-rt4 and rt5 should uninstall the Adj-SIDs pointing to rt6
-rt4 should reconverge rt5's Prefix-SIDs through rt2 using ECMP
-rt5 should reconverge rt4's Prefix-SIDs through rt3 using ECMP
-rt6 should uninstall all its IS-IS routes, Prefix-SIDs and Adj-SIDs

---

Step 4:
Action(s):
-Bring up the eth-rt4 interface on rt6
-Bring up the eth-rt5 interface on rt6
-Change rt6's SRGB

Expected changes:
-All routers should install rt6's Prefix-SIDs
-rt4 and rt5 should install Adj-SIDs for rt6
-rt4 should reconverge rt5's Prefix-SIDs through rt6 using the new SRGB
-rt5 should reconverge rt4's Prefix-SIDs through rt6 using the new SRGB
-rt6 should reinstall all IS-IS routes and Prefix-SIDs from the network,
and Adj-SIDs for rt4 and rt5

---

Step 5:
Action(s):
-Disable SR on rt6

Expected changes:
-All routers should uninstall rt6's Prefix-SIDs
-rt4 should uninstall rt5's Prefix-SIDs since the nexthop router hasn't
SR enabled anymore
-rt5 should uninstall rt4's Prefix-SIDs since the nexthop router hasn't
SR enabled anymore
-rt6 should uninstall all Prefix-SIDs from the network, and the Adj-SIDs
for rt4 and rt5

---

Step 6:
Action(s):
-Enable SR on rt6

Expected changes:
-All routers should install rt6's Prefix-SIDs
-rt4 should install rt5's Prefix-SIDs through rt6
-rt5 should install rt4's Prefix-SIDs through rt6
-rt6 should install all Prefix-SIDs from the network, and Adj-SIDs for
rt4 and rt5

---

Step 7:
Action(s):
-Delete rt1's Prefix-SIDs

Expected changes:
-All routers should uninstall rt1's Prefix-SIDs

---

Step 8:
Action(s):
-Re-add rt1's Prefix-SIDs

Expected changes:
-All routers should install rt1's Prefix-SIDs

---

Step 9:
Action(s):
-Change rt1's Prefix-SIDs to use the no-php option
-Change rt6's Prefix-SIDs to stop using the explicit-null option

Expected changes:
-rt2 and rt3 should reinstall rt1's Prefix-SIDs accordingly
-rt4 and rt5 should reinstall rt6's Prefix-SIDs accordingly

---

Step 10:
Action(s):
-Remove the IPv4 address from rt4's eth-rt2-1 interface

Expected changes:
-rt2 should uninstall the IPv4 Adj-SIDs attached to the eth-rt4-1
interface
-rt2 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt4
(ECMP shouldn't be used anymore)
-rt4 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt2
(ECMP shouldn't be used anymore)

---

Step 11:
Action(s):
-Restore the original network setup

Expected changes:
-All routes, Prefix-SIDs and Adj-SIDs should be the same as they were
after the initial network convergence (step 1)

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30 12:15:47 +02:00
Olivier Dugeon
9389175b75 doc: add documentation for IS-IS Segment Routing
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-04-30 12:15:47 +02:00
Renato Westphal
26f6acafc3 isisd: add support for segment routing
This is an implementation of the IS-IS SR draft [1] for FRR.

The following features are supported:
* IPv4 and IPv6 Prefix-SIDs;
* IPv4 and IPv6 Adj-SIDs and LAN-Adj-SIDs;
* Index and absolute labels;
* The no-php and explicit-null Prefix-SID flags;
* Full integration with the Label Manager.

Known limitations:
* No support for Anycast-SIDs;
* No support for the SID/Label Binding TLV (required for LDP interop).
* No support for persistent Adj-SIDs;
* No support for multiple SRGBs.

[1] draft-ietf-isis-segment-routing-extensions-25

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30 12:15:47 +02:00
Renato Westphal
8f6c893629 isisd: add segment-routing CLI commands
In the name of consistency, these commands are very similar to the
ospfd SR configuration commands.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30 11:37:38 +02:00
Renato Westphal
7e405d3b19 isisd: add segment-routing YANG nodes and skeleton callbacks
Most definitions were borrowed from the IETF IS-IS SR YANG module,
with a few adaptations. Of particular notice are the following:
* No support for the configuration of multiple SRGBs.
* No distinction between local and connected Prefix-SIDs, both are
  configured the same way.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30 11:37:38 +02:00
GalaxyGorilla
849224d4ed tests: introduce a proper JSON diff for topotests
Diff'ing JSON objects is a crucial operation in the topotests for
comparing e.g. vtysh output (formatted as JSON) with a file which
covers the expectation of the tests. The current diff functionality
is 'self-written' and intended to test a JSON object d2 on being a
subset of another JSON object d1. For mismatches a diff is generated
based on a normalized textual representation of the JSON objects.

This approach has several disadvantages:

  * the human provided JSON text might not be normalized, hence
    a diff with line numbers might be worthless since it provides
    close to zero orientation what the problem is
  * the diff contains changes like commatas which are meaningless
  * the diff might contain a lot of changes about meaningless
    content which is present in d1 but not in d2
  * there is no proper functionality to test for 'equality' of
    d1 and d2
  * it is not possible to test for order, e.g. JSON arrays are
    just tested with respect to being a subset of another array
  * it is not possible to check if a key exists without also
    checking the value of that particular key

This commit attempts to solve these issues. An error report is
generated which includes the "JSON Path" to the problematic JSON
elements and also hints on what the actual problem is (e.g. missing
key, mismatch in dict values etc.).

A special parameter 'exact' was introduced such that equality can be
tested. Also there was a convention that absence of keys can be
tested using the key in question with value 'None'. This convention
is still honored such that full backwards compatiiblity is in
place.

Further order can be tested using the new tag '__ordered__' in
lists (as first element). Example:

    d1 = [1, 2, 3]
    d2 = ['__ordered__', 1, 3, 2]

Tesing d1 and d2 this way will now result in an error.

Key existence can now be tested using an asterisk '*'. Example:

    d1 = [1, 2, 3]
    d2 = [1, '*', 3]

    d1 = {'a': 1, 'b': 2}
    d2 = {'a': '*'}

Both cases will result now in a clean diff for d1 and d2.

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2020-04-30 09:33:32 +00:00
Renato Westphal
885e241337 isisd: remove refcount from the isis_nexthop structure
isisd implements an optimization that allows multiple routes to
share the same nexthop (using a refcount) in order to save memory.

Now that SR support is coming, however, it will be necessary to
embed additional SR-related information inside the isis_nexthop
structure. But this can only be done if the nexthops aren't shared
among routes anymore.

Removing this memory optimization should have minimal impact since
the isis_nexthop structure is really small. On large networks with
thousands of routes, the memory saving would be in the order of a
few kilobytes.  Not something we should be concerned about nowadays.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30 11:28:51 +02:00
Renato Westphal
9cd06cd7b9 isisd: split vty_out_timestr() into two helper functions
The new log_uptime() function logs an UNIX timestamp to a buffer
provided by the user. It's very flexibile and can be used in a
variety of contexts, different from vty_out_timestr() which is too
tied to the VTY code.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30 11:28:51 +02:00
Renato Westphal
3056368301 isisd: introduce new adjacency hooks
The 'isis_adj_ip_enabled_hook' hook will be called whenever
an adjacency goes from zero to one or more IPv4 or IPv6
addresses. Conversely, the 'isis_adj_ip_disabled_hook' hook will
be called whenever an adjacency goes from one or more IPv4/IPv6
addresses to no addresses at all.

These hooks will be used by the upcoming SR code to add/delete
Adj-SIDs depending on the IP addresses present in the remote
adjacencies.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30 11:28:51 +02:00
Renato Westphal
0b7005375f lib: constify a few parameters of helper functions
Parameters should be const whenever possible to improve code
readability and remove the need to cast away the constness of
const arguments.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30 11:27:20 +02:00
Renato Westphal
2e86d16d99 zebra: fix detection of VRF misconfiguration
The netlink_vrf_change() function is called both when a VRF device
is created in the Linux kernel and when it is activated. This
commit changes this function to perform the VRF misconfiguration
detection only when the VRF device is created, as doing the check
twice would cause a false positive followed by a hard failure (not
to mention the double check is unnecessary since the VRF table ID
can't change once the device is created).

Fixes #6319.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-29 23:34:06 -03:00
Renato Westphal
31b5355d6f
Merge pull request #6241 from volta-networks/fix_ldp_acl
ldpd: fix ACL rule modification
2020-04-29 22:44:25 -03:00
Renato Westphal
799a81df9d lib: update the CLI xpath index when exiting from the VRF node
All custom "exit-*" commands that exit from a YANG-modeled
CLI node need to use cmd_exit() to ensure the CLI xpath index
(vty->xpath_index) will be updated accordingly.

Fixes #6316.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-29 18:49:29 -03:00
Sri Mohana Singamsetty
a276f04a3f
Merge pull request #6314 from pjdruddy/fix-arp-cache-vtep-json-cli
zebra: fix json for show evpn arp-cache vni vtep
2020-04-29 09:31:22 -07:00
Stephen Worley
090152ec9c
Merge pull request #5786 from mjstapp/fix_notif_empty_nhg
zebra: fix handling of failed route install via notification
2020-04-29 12:28:56 -04:00
lynne
2d1aa1e887 ldpd: fix ACL rule modification
Changes to ACL rules were not applied to LDP.  This fix allows
LDP to be notified when a rule in an ACL filter is modified by
the user. The filter is properly applied to the LDP session.
The filter may cause a LDP session to go down/up or to remove/add
labels being advertised/received from a neighbor.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-04-29 12:27:17 -04:00
Mark Stapp
a79fdd6580 zebra: don't treat every interface as unnumbered
Commit e93a6fbb4 from PR3908 changed every interface into an
'unnumbered' interface - even interfaces that do not have
ipv4 at all. Undo that.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-29 12:08:49 -04:00
Russ White
dc1412e249
Merge pull request #6309 from dslicenc/ra-retrans-interval
zebra: add ability to set retransmit timer for IPv6 RAs
2020-04-29 11:10:33 -04:00
Russ White
37d6afef2a
Merge pull request #6303 from dslicenc/stop-enhe-ras
bgpd: turn off RAs when numbered peers are deleted
2020-04-29 11:09:58 -04:00
Donald Sharp
854a463b97
Merge pull request #6313 from volta-networks/fix_zebra_pw_nht
zebra: fix zebra pseudowire manager NHT
2020-04-29 10:22:04 -04:00
Donald Sharp
cd8e0b88e3
Merge pull request #6299 from ton31337/fix/access-list_deletion
lib: Delete the entire access-list only if there are no more entries
2020-04-29 08:31:31 -04:00
Pat Ruddy
1cc5b09394 zebra: fix json for show evpn arp-cache vni vtep
The function zebra_vxlan_print_neigh_vni_vtep does not create
a json object when json has been requested from the CLI and as a
result it prints out the information in normal CLI format.
Fix is to allocate the json object when required.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-04-29 12:29:09 +01:00
Don Slice
534378996b doc: Documentation for ipv6 nd ra-retrans-timer command
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2020-04-29 11:26:04 +00:00
Don Slice
b19ac878be zebra: add ability to set retransmit timer for IPv6 RAs
Reported by testing agency that rfc 4861 section 6.2.1 states
that all implementations must have a configuration knob to change
the setting of the advertised retransmit timer sent in RA packets.
This fix adds that capability.

Ticket: CM-29199
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2020-04-29 11:26:04 +00:00
David Lamparter
f6be730827
Merge pull request #6228 from donaldsharp/change_network_statement_default 2020-04-29 09:02:42 +02:00
Sri Mohana Singamsetty
4a6cd98e54
Merge pull request #6310 from donaldsharp/revert_the_behavior
Revert "vtysh: fix searching commands in parent nodes"
2020-04-28 15:41:47 -07:00
Donald Sharp
f990a4169c doc: Update doc for the bgp network import-check command
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-28 15:57:53 -04:00
Donald Sharp
62282e8379 bgpd,tests: Modify import-check to require underlying prefixes to exist
Modify the import-check command to require the underlying prefix
to exist in the rib.  General consensus is that this is the correct
behavior.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-28 15:57:53 -04:00
Donald Sharp
425c241a49
Merge pull request #6302 from volta-networks/fix_ldpd_af_reload
tools: fix frr-reload AF issue with ldpd
2020-04-28 15:05:57 -04:00
Karen Schoener
13c46fa1a0 zebra: fix zebra pseudowire manager NHT
Intermittently, there is a 30 second delay for a LDP pseudowire to become
operational.

One way to reproduce the issue is: Once PW is up, shutdown link to trigger
a change to the pseudowire's next hop, and then restore link to cause
pseudowire to return to original NH.

Problem Descripton:
    The Zebra PW manager installs pseudowires in the data plane when the
    following two conditions are met:
        1. Pseudowire is labeled via LDP mapping messages
        2. A labeled NH route exists to reach the remote pseudowire endpoint

    The Zebra PW manager registers a NHT callback when a pseudowire is enabled.
    This allows the Zebra PW manager to install or reinstall the pseudowire.

    The Zebra PW manager deregisters for the NHT callback when the pseudowire is
    disabled.  When LDP learns the remote-pseudowire status is 'not forwarding',
    LDP notifies Zebra that the pseudowire is disabled.

    This creates a race condition where a new labeled NH can be resolved after the
    Zebra PW manager deregistered for the NHT callback.

    For static pseudowires, it makes sense for Zebra PW manager to deregister for
    NHT callbacks for disabled pseudowires.  Static pseudowires become disabled
    via CLI configuration commands.

    For LDP pseudowires, the Zebra PW manager should not deregister for NHT
    callbacks for disabled pseudowires.

Overview of changes:
    1. Zebra PW manager should not deregister for NHT callbacks when an LDP
       pseudowire is disabled.
       Zebra PW manager will register for NHT callbacks when the LDP pseudowire
       is first enabled.
       Zebra PW manager will deregister for NHT callbacks when the LDP
       pseudowire is deleted.
    2. Remove the 30 second timer that was added in PR4122.
       PR4122 tried to fix this race condition with a timer.
       Once we eliminate the race condition (by keeping the Zebra PW manager
       registered for NHT callbacks), this timer can be removed.
    3. Zebra PW manager handling of static pseudowires will remain as-is.
       Zebra PW manager will register for NHT callbacks when the static
       pseudowire is enabled.
       Zebra PW manager will deregister for NHT callbacks when the static
       pseudowire is disabled.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-04-28 14:39:12 -04:00
Lou Berger
3b548ddc33
Merge pull request #6295 from ton31337/feature/show_bgp_afi_safi_sntpfx
bgpd: Show PfxSnt for `show bgp <afi> <safi>` command
2020-04-28 11:34:13 -04:00
David Lamparter
ff57083b80
Merge pull request #6308 from donaldsharp/pim_ordering 2020-04-28 17:14:28 +02:00
Donald Sharp
c1d203ca73 Revert "vtysh: fix searching commands in parent nodes"
This reverts commit d741915ecd.

This is because it breaks this behavior:

router ospf6
  <commands>
!
int enp39s0
  <more commands>
!

This is a very legal set of commands and completely destroys the
ability to do this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-28 10:46:28 -04:00
Donald Sharp
4dc3c8b4b9
Merge pull request #6306 from opensourcerouting/triple-wtf-20200428
*: triple pack of one-liner WTF fixes
2020-04-28 08:00:28 -04:00
Donald Sharp
5d06e8a60e pimd: Add a needed space for formatting
Display a space in the output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-28 07:59:18 -04:00
David Lamparter
e08fe91d4a pimd: don't split format string from zlog call
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-28 11:13:02 +02:00
David Lamparter
de1a641de4 tests: fix size confusion
The question here isn't "why does it break on PowerPC?", but rather "why
doesn't it break on x86_64 or ARM?"

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-28 11:11:46 +02:00
David Lamparter
80833111f0 bgpd: fix typo
o.O

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-28 11:11:26 +02:00