Commit Graph

19633 Commits

Author SHA1 Message Date
Donatas Abraitis
40858a3c7e
Merge pull request #6728 from idryzhov/vtysh-fixes
[7.4] cherry-pick vtysh fixes
2020-07-15 12:11:40 +03:00
Donatas Abraitis
80acc95357
Merge pull request #6733 from idryzhov/fix-changelog
[7.4] debian: fix changelog
2020-07-15 08:34:32 +03:00
Donatas Abraitis
62fd6027f9
Merge pull request #6737 from opensourcerouting/74-bfdd-frr-reload
[7.4] Add BFD peer awareness to frr-reload.py and vtysh markfile
2020-07-15 08:33:54 +03:00
Paul Manley
2604086c3d vtysh: properly exit BFD_PEER_NODE when marking file
vtysh needs to be aware of how to properly exit a bfd peer when subsequent commands only succeed in a higher context.

https://github.com/FRRouting/frr/issues/6511#issuecomment-656166206

Signed-off-by: Paul Manley <paul.manley@wholefoods.com>
(cherry picked from commit b727c12aab)
2020-07-14 13:44:40 -03:00
Paul Manley
692ce87393 tools: create sub-context for bfd peers
add lines starting with 'peer' to the list of sub-contexts that are handled by frr-reload.py.

https://github.com/FRRouting/frr/issues/6511#issuecomment-655163833

Signed-off-by: Paul Manley <paul.manley@wholefoods.com>
(cherry picked from commit 1c23a0aaa1)
2020-07-14 13:44:30 -03:00
Igor Ryzhov
ffaaa348f4 debian: fix changelog
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-07-14 14:29:56 +03:00
Donald Sharp
3e4d90ec55 vtysh: Improve lookup performance
When we find the line we are interested in, stop looking.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-07-13 19:07:04 +03:00
Donald Sharp
cc5934ed59 vtysh: master is a non-sorted list
The commit:
a798241265

attempted to use sorted master lists to do faster lookups
by using a RB Tree.  Unfortunately the original code
was creating a list->cmp function *but* never using it.
If you look at the commit, it clearly shows that the
function listnode_add is used to insert but when you
look at that function it is a tail push.

Fixes: #6573

Namely now this ordering is preserved:
bgp as-path access-list originate-only permit ^$
bgp as-path access-list originate-only deny .*

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-07-13 19:06:56 +03:00
Donald Sharp
0615c09282
Merge pull request #6714 from ton31337/feature/bgp_show_only_established_sessions_7.4
bgpd: [7.4] Add command to show only established sessions
2020-07-10 16:09:08 -04:00
Donatas Abraitis
2600443342 doc: Add 'show bgp summary established' command
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-07-10 11:23:30 +03:00
Donatas Abraitis
2939f712d1 bgpd: Add command to show only established sessions
```
exit1-debian-9# show bgp summary

IPv4 Unicast Summary:
BGP router identifier 192.168.0.1, local AS number 100 vrf-id 0
BGP table version 8
RIB entries 15, using 2880 bytes of memory
Peers 2, using 43 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
192.168.0.2     4        200        10         6        0    0    0 00:00:35            8        8
2a02:4780::2    4          0         0         1        0    0    0    never       Active        0

Total number of neighbors 2
exit1-debian-9# show bgp summary established

IPv4 Unicast Summary:
BGP router identifier 192.168.0.1, local AS number 100 vrf-id 0
BGP table version 8
RIB entries 15, using 2880 bytes of memory
Peers 2, using 43 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
192.168.0.2     4        200        10         6        0    0    0 00:00:39            8        8

Total number of neighbors 2
exit1-debian-9# show bgp summary failed

IPv4 Unicast Summary:
BGP router identifier 192.168.0.1, local AS number 100 vrf-id 0
BGP table version 8
RIB entries 15, using 2880 bytes of memory
Peers 2, using 43 KiB of memory

Neighbor        EstdCnt DropCnt ResetTime Reason
2a02:4780::2          0       0     never Waiting for peer OPEN

Total number of neighbors 2
exit1-debian-9#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-07-10 11:23:26 +03:00
Donatas Abraitis
e5589cd8d2
Merge pull request #6683 from opensourcerouting/74-rmap-desc-leak-fix
[7.4] lib: fix route map description memory leak
2020-07-07 07:33:51 +03:00
Rafael Zalamena
cc45875e0d lib: fix route map description memory leak
Route map entries are not getting a chance to call `description` string
deallocation on shutdown or when the parent entry is destroyed, so lets
add a code to handle this in the `route_map_index_delete` function.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit f095133583)
2020-07-06 14:40:59 -03:00
Sri Mohana Singamsetty
738d473366
Merge pull request #6679 from ton31337/fix/large-community-list-set_sequence_7.4
bgpd: Some backports to 7.4
2020-07-06 10:38:54 -07:00
Donatas Abraitis
d5a157b7c3 bgpd: Actually find the sequence number for large-community-list
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-07-05 22:08:10 +03:00
Donatas Abraitis
acf6f22d15 bgpd: Return bool type for ecommunity_add_val and subgroup_announce_check
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-07-05 22:08:01 +03:00
Donatas Abraitis
71be4bd9ab
Merge pull request #6664 from donaldsharp/cpick_7.4
bgpd: Actually find the sequence number for `bgp extcommunity-list...`
2020-07-02 08:03:53 +03:00
Donald Sharp
34f6d0c67a bgpd: Actually find the sequence number for bgp extcommunity-list...
The code in the bgp extcommunity-list function was using
argv_find to get the correct idx.  The problem was that
we had already done argv_finds before and idx was non-zero
thus having us always set the seq pointer to what was last
looked up.  This causes us to pass in a value to the
underlying function and it would just wisely ignore it
causing a seq number of 0.

We would then write this seq number of 0 and then immediately
reject it on read in again.  BOO!

Actually handle argv_find the way it was meant to be.

Ticket:CM-29926
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-07-01 14:03:31 -04:00
Martin Winter
e4dcf108d6
FRRouting Release 7.4
BGPd
   Use sequence numbers for community lists
   Fixes to nexthop groups
   Add feature to limit outgoing number of routes
   Per Neighbor Graceful Restart
   Multiple Graceful Restart fixes
   Support sub-Type-4 and sub-Type-5 for the VPNv4 SRv6 backend
   rfc7606 support: treat certain malformed routes as withdraw
   allow origin override for route aggregates
   rfc6608 support: Subcodes for BGP Finite State Machine Error
   rfc7607 support: Codification of AS 0 Processing
   rfc6286 support: Autonomous-System-Wide Unique BGP Identifier for BGP-4
   Unequal cost multipath (a.ka. weighted ECMP) with BGP link-bandwidth
   Enable rfc8212 by default except datacenter profile
staticd
   Add debug support
vtysh
   Add copy command to copy config from file into running config
LDPd
   adding support for LDP ordered label distribution control
ISISd
   IS-IS Segment Routing support
SHARPd
   add initial support to add/remove lsps
Zebra
   fix broadcast address in IPv4 networks with /31 mask
   Add Graceful Restart support for Protocol Daemon restarts
lib
   migrate route-maps to use northbound interface
plus countless bug fixes and other improvements

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-06-30 13:08:57 +02:00
Russ White
08d14c8157
Merge pull request #6629 from ton31337/fix/network_check_import_for_static_bgp_7.4
bgpd: [7.4] Do not treat the route as martian for static BGP routes
2020-06-23 11:46:56 -04:00
Donatas Abraitis
7ca4ef12b8 bgpd: Do not treat the route as martian for static BGP routes
If we have something like:
```
ip route 1.1.1.0/24 Null0
!
router bgp 100
 no bgp ebgp-requires-policy
 neighbor 192.168.0.2 remote-as 200
 !
 address-family ipv4 unicast
  network 1.1.1.0/24
  redistribute connected
 exit-address-family
!
line vty
!
```

1.1.1.0/24 is not advertised due to martian nexthop (0.0.0.0). It starts
working only when we use `redistribute static`.

By checking if it's a BGP static route we able to announce
1.1.1.0/24 with `network 1.1.1.0/24` without redistribute even when
`bgp import-check` is enabled.

Disabling `bgp import-check` works as well, but it's enabled by default
since 7.4.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-23 16:45:39 +03:00
Donald Sharp
e28f42625e
Merge pull request #6570 from mjstapp/fix_daemon_fini_7_4
[7.4] Daemons should call frr_fini() on shutdown
2020-06-11 18:47:49 -04:00
Mark Stapp
70504ec45a *: have daemons call frr_fini() at termination
Fix a number of library and daemon issues so that daemons can
call frr_fini() during normal termination. Without this,
temporary logging files are left behind in /var/tmp/frr/.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-11 15:41:52 -04:00
Mark Stapp
5812b45fb3 lib: don't try to change/reset capabilities if process has none
A couple of daemons take/use no capabilities/privs; allow cleanup
of the privs/capabilities library module even if a daemon has no
caps.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-11 15:41:52 -04:00
Donald Sharp
c8296ab8af
Merge pull request #6558 from opensourcerouting/7.4/zlogbuf-litter
[7.4] lib: set up TLS log buffer after forking
2020-06-10 19:04:39 -04:00
Donald Sharp
9bf78e1b50
Merge pull request #6560 from ton31337/fix/configuration_for_labeled_unicast_in_place_7.4
bgpd: [7.4] Make sure network/aggregate-address commands lay down under labeled safi
2020-06-10 18:52:47 -04:00
Donatas Abraitis
48b38d5b27 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-06-10 23:12:36 +03:00
David Lamparter
0f133bad7f lib: set up TLS log buffer after forking
... it contains our pid, so doing it before fork leads to littering
buffers since we try to clean up with the forked pid...

Fixes: #6541
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-06-10 20:38:02 +02:00
Donald Sharp
b286cd18e9
Merge pull request #6553 from ton31337/fix/bgp_dampening_vty_bug_7.4
bgpd: [7.4] Duplicate `bgp dampening ...` stuff
2020-06-10 11:08:03 -04:00
Donatas Abraitis
923e64a83b bgpd: Print dampening configuration per AF, not per neighbor
This caused duplicate `bgp dampening ...` to be printed per neighbor.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-10 16:25:00 +03:00
Donatas Abraitis
abe702de9f bgpd: Allow setting dampening for more address families
Until now, it was possible to set only for ipv4 unicast/multicast.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-10 16:24:56 +03:00
Donald Sharp
1cc3b453b6
Merge pull request #6539 from ton31337/fix/refcnt_check_for_dep_data_route-map_7.4
lib: [7.4] Make sure route_map_dep_data is not NULL before decrementing ref…
2020-06-09 15:27:20 -04:00
David Lamparter
a261fd2753
Merge pull request #6524 from ton31337/fix/set_ipv6_ll_if_global_zero_7.4
bgpd: [7.4] Use IPv6 LL address as nexthop if global was set to ::/LL
2020-06-09 16:42:37 +02:00
Donatas Abraitis
8517e219c9 lib: Make sure route_map_dep_data is not NULL before decrementing refcount
```
2  0x00007fb9adb07a10 in core_handler (signo=11, siginfo=0x7ffe1414a630, context=<optimized out>) at lib/sigevent.c:228
        sa_default = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
        sigset = {__val = {8192, 0 <repeats 15 times>}}
3  <signal handler called>
No locals.
4  route_map_dep_update (type=RMAP_EVENT_CLIST_DELETED, rmap_name=0x55d807ddd410 "export4-as49917", dep_name=<optimized out>, dephash=0x55d807adf170) at lib/routemap.c:2750
        dep = 0x55d807d35b00
        dname = 0x55d8081ba560 "123:124"
        rname = 0x55d8081ba540 "export4-as49917"
        ret = 0
        dep_data = 0x0
        ret_dep_data = 0x0
        tmp_dep_data = {rname = 0x55d8081ba540 "export4-as49917", refcnt = 0}
5  route_map_upd8_dependency (type=RMAP_EVENT_CLIST_DELETED, arg=<optimized out>, rmap_name=0x55d807ddd410 "export4-as49917") at lib/routemap.c:2865
        upd8_hash = 0x55d807adf170
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-09 15:02:07 +03:00
Donatas Abraitis
b6251279e0 bgpd: Use IPv6 LL address as nexthop if global was set to ::/LL
This happens between Bird and FRR. Maybe others as well, dunno.

Bird sends ::(fe80::1588) and we have a nexthop as :: which is inaccessible:

```
BGP routing table entry for fdff:b87d:f5b0::/48
Paths: (1 available, no best path)
  Not advertised to any peer
  4242421588 4242422547 4242422601 4242423605
    :: (inaccessible) from fe80::1588 (172.20.16.140)
    (fe80::1588) (used)
      Origin IGP, invalid, external
      Last update: Mon May 25 14:27:02 2020
```

bgpd[9554]: fe80::1588 went from OpenConfirm to Established
bgpd[9554]: fe80::1588 [FSM] Timer (routeadv timer expire)
bgpd[9554]: fe80::1588 rcvd UPDATE w/ attr: , origin i, mp_nexthop ::(fe80::1588)
bgpd[9554]: fe80::1588 rcvd UPDATE wlen 0 attrlen 120 alen 0
bgpd[9554]: fe80::1588 rcvd fda9:26a9:1c47:2d42::/64 IPv6 unicast
bgpd[9554]: Allocated bnc ::/128(VRF default) peer 0x0
bgpd[9554]: bgp_update(0.0.0.0): NH unresolved
bgpd[9554]: fe80::1588 rcvd fda9:26a9:1c47:d42::/64 IPv6 unicast

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-07 18:29:01 +03:00
Donald Sharp
1edce7d2c8
Merge pull request #6413 from FRRouting/dev_isis_sr
isisd: IS-IS Segment Routing support
2020-05-15 15:06:55 -04:00
Donald Sharp
848a8ed789
Merge pull request #6409 from ton31337/feature/missing_to_7.4
[7.4] bgpd two fixes
2020-05-15 07:47:05 -04:00
Donatas Abraitis
7288f0807b
Merge pull request #6408 from donaldsharp/reload_74
[7.4] DC's
2020-05-15 09:04:29 +03:00
Donatas Abraitis
90a80a85c4 bgpd: Set a proper SAFI for labaled-unicast when looking for scount
The problem is that peer_af_array returns NULL when SAFI is changed to
unicast. We use unicast table, but peer is created and activated under
labeled-unicast, hence we should lookup with a proper SAFI id.

Without this patch peer_af_find() returns NULL and we can't show
PfxSnt in `show bgp summary`.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-05-14 23:01:45 +03:00
Donatas Abraitis
2564e16cd2 bgpd: Use default AFI_IP6/SAFI_UNICAST when displaying statistics
Without specifying a default afi/safi we get a segfault:

```
(gdb) frame 4
bgp_table_stats (..., afi=32724, safi=SAFI_UNICAST, ...
11349		if (!bgp->rib[afi][safi]) {
(gdb)
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-05-14 23:01:02 +03:00
Donald Sharp
c26ad06464 bgpd: bgp bestpath bandwidth should not be a legal command
The `bgp bestpath bandwidth` command should not be a legal
command.  Pull out the `no` form to allow this.  Allow
`no bgp bestpath bandwidth` to work as we would expect.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-14 15:46:58 -04:00
Donald Sharp
a92314dcbd bgpd: really remove the no ip as-path... command
We had already removed the `ip as-path..` command
to have `bgp as-path` but for some reason a `no ip as-path..`
command ALIAS was still around.  Kill with extreme prejudice.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-14 15:45:03 -04:00
Donald Sharp
410a6bdcff tools: revert frr-reload.py remove stderr redirects"
This reverts commit 3fa139a65b.

This is being reverted because this commit completely
breaks the invocation of frr-reload.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-14 15:44:55 -04:00
Renato Westphal
82624cef0c
Merge pull request #6342 from Orange-OpenSource/dev_isis_sr
isisd: Preparation to merge Segment-Routing into master
2020-05-14 14:23:03 -03:00
Olivier Dugeon
d4d008fea1 isisd: Update documentation for Segment Routing
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:36:43 +02:00
Olivier Dugeon
c0083e5338 isisd: Update Segment Routing Show Commands
* Improve `show isis segment-routing prefix-sids` output
 * Add new `show isis segment-routing node' command

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:36:43 +02:00
Olivier Dugeon
f2333421ff isisd: IS-IS-SR preparation for master 5/5
Update comments (doxygen style) for all functions.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:36:43 +02:00
Olivier Dugeon
c3f7b406b1 isisd: IS-IS-SR preparation for master 4/5
* Regroup fonctions to install label for Prefix and Adjacency SID
 * Change 'replace_semantics' variable name by 'make_before_break' in
   sr_prefix_reinstall() function and adjust comments
 * Call directly lsp_regenerate_schedule() from isis_nb_config.c when MSD
   is updated

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:36:43 +02:00
Olivier Dugeon
b407c77a4a isisd: IS-IS-SR preparation for master 3/5
Add debug macro and debug messages

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:36:38 +02:00
Olivier Dugeon
b1d80d434c isisd: IS-IS-SR preparation for master 2/5
* Rename functions following rules: isis_sr_XXX is kept for external functions
   and isis_sr prefix remove for static ones
 * Rename local_label & remote_label variables by input_label & output_label
 * Change parameter order (to follow other functions) in sr_node_srgb_update()

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:23:50 +02:00