]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
4 years agolib: fix TLS log buffer on NetBSD 6772/head
David Lamparter [Sun, 19 Jul 2020 09:14:48 +0000 (11:14 +0200)]
lib: fix TLS log buffer on NetBSD

... this didn't work on NetBSD.  Like, at all.  It returns a positive
error code from posix_fallocate() and then we bang our head against a
brick wall trying to write to the mmap'd buffer.

Signed-off-by: David Lamparter <equinox@diac24.net>
(cherry picked from commit 6a3b431b85088d2d76a14d6c22ee85bdc5465c8c)

4 years agoMerge pull request #6768 from ton31337/fix/bgp_mrai_bug_7.4
Rafael Zalamena [Sun, 19 Jul 2020 14:39:52 +0000 (11:39 -0300)]
Merge pull request #6768 from ton31337/fix/bgp_mrai_bug_7.4

bgpd: [7.4] Fix the bug that BGP MRAI does not work

4 years agobgpd: Fix the bug that BGP MRAI does not work. 6768/head
Richard Wu [Fri, 5 Jun 2020 09:54:57 +0000 (17:54 +0800)]
bgpd: Fix the bug that BGP MRAI does not work.

Issue: bgp_process_writes will be called when the fd is writable.
       And it will bgp_generate_updgrp_packets to generate the
       update packets no matter MRAI is set or not.
Fix:   bgp_generate_updgrp_packets thread will return without sending
       any update when MRAI timer is still running.

Signed-off-by: Richard Wu <wutong23@baidu.com>
4 years agoMerge pull request #6744 from ton31337/fix/bgp_hostname_nexthop_if_unchanged_7.4
Rafael Zalamena [Thu, 16 Jul 2020 12:53:16 +0000 (09:53 -0300)]
Merge pull request #6744 from ton31337/fix/bgp_hostname_nexthop_if_unchanged_7.4

bgpd: [7.4] Show the real next-hop address in addition to hostname

4 years agodoc: Add some words about `bgp default show-[nexthop]-hostname` 6744/head
Donatas Abraitis [Wed, 24 Jun 2020 14:26:27 +0000 (17:26 +0300)]
doc: Add some words about `bgp default show-[nexthop]-hostname`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Add "hostname" in JSON output for `show bgp` family outputs
Donatas Abraitis [Wed, 6 May 2020 14:50:04 +0000 (17:50 +0300)]
bgpd: Add "hostname" in JSON output for `show bgp` family outputs

This adds hostname regardless if `bgp default show-hostname` enabled or not.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Show the real next-hop address in addition to hostname in `show bgp`
Donatas Abraitis [Wed, 6 May 2020 14:46:10 +0000 (17:46 +0300)]
bgpd: Show the real next-hop address in addition to hostname in `show bgp`

It's hard to cope with cases when next-hop is changed/unchanged or
peers are non-direct.

It would be better to show the hostname and nexthop IP address (both)
under `show bgp` to quickly identify the source and the real next-hop
of the route.

If `bgp default show-nexthop-hostname` is toggled the output looks like:
```
spine1-debian-9# show bgp
BGP table version is 1, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 65002
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  2a02:4780::/64   fe80::a00:27ff:fe09:f8a3(exit1-debian-9)
                                             0             0 65001 ?

spine1-debian-9# show ip bgp
BGP table version is 5, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 65002
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.255.255.0/24  192.168.0.1(exit1-debian-9)
                                             0             0 65001 ?
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agotests: Remove bgp_show_ip_bgp_fqdn test
Donatas Abraitis [Wed, 6 May 2020 14:45:31 +0000 (17:45 +0300)]
tests: Remove bgp_show_ip_bgp_fqdn test

Not really relevant for now.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6728 from idryzhov/vtysh-fixes
Donatas Abraitis [Wed, 15 Jul 2020 09:11:40 +0000 (12:11 +0300)]
Merge pull request #6728 from idryzhov/vtysh-fixes

[7.4] cherry-pick vtysh fixes

4 years agoMerge pull request #6733 from idryzhov/fix-changelog
Donatas Abraitis [Wed, 15 Jul 2020 05:34:32 +0000 (08:34 +0300)]
Merge pull request #6733 from idryzhov/fix-changelog

[7.4] debian: fix changelog

4 years agoMerge pull request #6737 from opensourcerouting/74-bfdd-frr-reload
Donatas Abraitis [Wed, 15 Jul 2020 05:33:54 +0000 (08:33 +0300)]
Merge pull request #6737 from opensourcerouting/74-bfdd-frr-reload

[7.4] Add BFD peer awareness to frr-reload.py and vtysh markfile

4 years agovtysh: properly exit BFD_PEER_NODE when marking file 6737/head
Paul Manley [Thu, 9 Jul 2020 16:25:34 +0000 (11:25 -0500)]
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 b727c12aabf1afc2b6e33f8590c9786e349e4fcb)

4 years agotools: create sub-context for bfd peers
Paul Manley [Thu, 9 Jul 2020 16:21:16 +0000 (11:21 -0500)]
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 1c23a0aaa1c5d20af50af75b070e93e1eff21222)

4 years agodebian: fix changelog 6733/head
Igor Ryzhov [Tue, 14 Jul 2020 11:29:56 +0000 (14:29 +0300)]
debian: fix changelog

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agovtysh: Improve lookup performance 6728/head
Donald Sharp [Tue, 30 Jun 2020 13:03:55 +0000 (09:03 -0400)]
vtysh: Improve lookup performance

When we find the line we are interested in, stop looking.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agovtysh: master is a non-sorted list
Donald Sharp [Tue, 30 Jun 2020 12:59:46 +0000 (08:59 -0400)]
vtysh: master is a non-sorted list

The commit:
a798241265a5808083a06b14ce1637d1ddf6a45a

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>
4 years agoMerge pull request #6714 from ton31337/feature/bgp_show_only_established_sessions_7.4
Donald Sharp [Fri, 10 Jul 2020 20:09:08 +0000 (16:09 -0400)]
Merge pull request #6714 from ton31337/feature/bgp_show_only_established_sessions_7.4

bgpd: [7.4] Add command to show only established sessions

4 years agodoc: Add 'show bgp summary established' command 6714/head
Donatas Abraitis [Thu, 9 Jul 2020 13:05:08 +0000 (16:05 +0300)]
doc: Add 'show bgp summary established' command

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Add command to show only established sessions
Donatas Abraitis [Thu, 9 Jul 2020 13:00:27 +0000 (16:00 +0300)]
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>
4 years agoMerge pull request #6683 from opensourcerouting/74-rmap-desc-leak-fix
Donatas Abraitis [Tue, 7 Jul 2020 04:33:51 +0000 (07:33 +0300)]
Merge pull request #6683 from opensourcerouting/74-rmap-desc-leak-fix

[7.4] lib: fix route map description memory leak

4 years agolib: fix route map description memory leak 6683/head
Rafael Zalamena [Mon, 6 Jul 2020 14:39:27 +0000 (11:39 -0300)]
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 f0951335830203426074ddca4317f84b477e4afb)

4 years agoMerge pull request #6679 from ton31337/fix/large-community-list-set_sequence_7.4
Sri Mohana Singamsetty [Mon, 6 Jul 2020 17:38:54 +0000 (10:38 -0700)]
Merge pull request #6679 from ton31337/fix/large-community-list-set_sequence_7.4

bgpd: Some backports to 7.4

4 years agobgpd: Actually find the sequence number for large-community-list 6679/head
Donatas Abraitis [Thu, 2 Jul 2020 08:39:40 +0000 (11:39 +0300)]
bgpd: Actually find the sequence number for large-community-list

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Return bool type for ecommunity_add_val and subgroup_announce_check
Donatas Abraitis [Thu, 2 Jul 2020 08:08:29 +0000 (11:08 +0300)]
bgpd: Return bool type for ecommunity_add_val and subgroup_announce_check

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6664 from donaldsharp/cpick_7.4
Donatas Abraitis [Thu, 2 Jul 2020 05:03:53 +0000 (08:03 +0300)]
Merge pull request #6664 from donaldsharp/cpick_7.4

bgpd: Actually find the sequence number for `bgp extcommunity-list...`

4 years agobgpd: Actually find the sequence number for `bgp extcommunity-list...` 6664/head
Donald Sharp [Tue, 2 Jun 2020 20:10:48 +0000 (16:10 -0400)]
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>
4 years agoFRRouting Release 7.4 frr-7.4
Martin Winter [Tue, 30 Jun 2020 11:08:57 +0000 (13:08 +0200)]
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>
4 years agoMerge pull request #6629 from ton31337/fix/network_check_import_for_static_bgp_7.4
Russ White [Tue, 23 Jun 2020 15:46:56 +0000 (11:46 -0400)]
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

4 years agobgpd: Do not treat the route as martian for static BGP routes 6629/head
Donatas Abraitis [Mon, 22 Jun 2020 13:23:24 +0000 (16:23 +0300)]
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>
4 years agoMerge pull request #6570 from mjstapp/fix_daemon_fini_7_4
Donald Sharp [Thu, 11 Jun 2020 22:47:49 +0000 (18:47 -0400)]
Merge pull request #6570 from mjstapp/fix_daemon_fini_7_4

[7.4] Daemons should call frr_fini() on shutdown

4 years ago*: have daemons call frr_fini() at termination 6570/head
Mark Stapp [Thu, 11 Jun 2020 15:16:02 +0000 (11:16 -0400)]
*: 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>
4 years agolib: don't try to change/reset capabilities if process has none
Mark Stapp [Thu, 11 Jun 2020 19:30:36 +0000 (15:30 -0400)]
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>
4 years agoMerge pull request #6558 from opensourcerouting/7.4/zlogbuf-litter
Donald Sharp [Wed, 10 Jun 2020 23:04:39 +0000 (19:04 -0400)]
Merge pull request #6558 from opensourcerouting/7.4/zlogbuf-litter

[7.4] lib: set up TLS log buffer after forking

4 years agoMerge pull request #6560 from ton31337/fix/configuration_for_labeled_unicast_in_place_7.4
Donald Sharp [Wed, 10 Jun 2020 22:52:47 +0000 (18:52 -0400)]
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

4 years agobgpd: Make sure network/aggregate-address commands lay down under labeled safi 6560/head
Donatas Abraitis [Thu, 30 Apr 2020 14:01:10 +0000 (17:01 +0300)]
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>
4 years agolib: set up TLS log buffer after forking 6558/head
David Lamparter [Wed, 10 Jun 2020 18:30:02 +0000 (20:30 +0200)]
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>
4 years agoMerge pull request #6553 from ton31337/fix/bgp_dampening_vty_bug_7.4
Donald Sharp [Wed, 10 Jun 2020 15:08:03 +0000 (11:08 -0400)]
Merge pull request #6553 from ton31337/fix/bgp_dampening_vty_bug_7.4

bgpd: [7.4] Duplicate `bgp dampening ...` stuff

4 years agobgpd: Print dampening configuration per AF, not per neighbor 6553/head
Donatas Abraitis [Wed, 10 Jun 2020 07:09:01 +0000 (10:09 +0300)]
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>
4 years agobgpd: Allow setting dampening for more address families
Donatas Abraitis [Wed, 10 Jun 2020 07:10:18 +0000 (10:10 +0300)]
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>
4 years agoMerge pull request #6539 from ton31337/fix/refcnt_check_for_dep_data_route-map_7.4
Donald Sharp [Tue, 9 Jun 2020 19:27:20 +0000 (15:27 -0400)]
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…

4 years agoMerge pull request #6524 from ton31337/fix/set_ipv6_ll_if_global_zero_7.4
David Lamparter [Tue, 9 Jun 2020 14:42:37 +0000 (16:42 +0200)]
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

4 years agolib: Make sure route_map_dep_data is not NULL before decrementing refcount 6539/head
Donatas Abraitis [Mon, 8 Jun 2020 11:58:53 +0000 (14:58 +0300)]
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>
4 years agobgpd: Use IPv6 LL address as nexthop if global was set to ::/LL 6524/head
Donatas Abraitis [Mon, 25 May 2020 14:22:37 +0000 (17:22 +0300)]
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>
4 years agoMerge pull request #6413 from FRRouting/dev_isis_sr
Donald Sharp [Fri, 15 May 2020 19:06:55 +0000 (15:06 -0400)]
Merge pull request #6413 from FRRouting/dev_isis_sr

isisd: IS-IS Segment Routing support

4 years agoMerge pull request #6409 from ton31337/feature/missing_to_7.4
Donald Sharp [Fri, 15 May 2020 11:47:05 +0000 (07:47 -0400)]
Merge pull request #6409 from ton31337/feature/missing_to_7.4

[7.4] bgpd two fixes

4 years agoMerge pull request #6408 from donaldsharp/reload_74
Donatas Abraitis [Fri, 15 May 2020 06:04:29 +0000 (09:04 +0300)]
Merge pull request #6408 from donaldsharp/reload_74

[7.4] DC's

4 years agobgpd: Set a proper SAFI for labaled-unicast when looking for scount 6409/head
Donatas Abraitis [Sun, 3 May 2020 18:16:45 +0000 (21:16 +0300)]
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>
4 years agobgpd: Use default AFI_IP6/SAFI_UNICAST when displaying statistics
Donatas Abraitis [Sat, 9 May 2020 18:33:51 +0000 (21:33 +0300)]
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>
4 years agobgpd: `bgp bestpath bandwidth` should not be a legal command 6408/head
Donald Sharp [Thu, 7 May 2020 14:03:31 +0000 (10:03 -0400)]
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>
4 years agobgpd: really remove the `no ip as-path...` command
Donald Sharp [Mon, 11 May 2020 12:45:11 +0000 (08:45 -0400)]
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>
4 years agotools: revert frr-reload.py remove stderr redirects"
Donald Sharp [Tue, 12 May 2020 17:31:05 +0000 (13:31 -0400)]
tools: revert frr-reload.py remove stderr redirects"

This reverts commit 3fa139a65be70e5a81b5f078530094f09a247416.

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

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6342 from Orange-OpenSource/dev_isis_sr dev_isis_sr 6404/head 6413/head
Renato Westphal [Thu, 14 May 2020 17:23:03 +0000 (14:23 -0300)]
Merge pull request #6342 from Orange-OpenSource/dev_isis_sr

isisd: Preparation to merge Segment-Routing into master

4 years agoisisd: Update documentation for Segment Routing 6342/head
Olivier Dugeon [Tue, 5 May 2020 14:40:35 +0000 (16:40 +0200)]
isisd: Update documentation for Segment Routing

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
4 years agoisisd: Update Segment Routing Show Commands
Olivier Dugeon [Tue, 5 May 2020 14:29:46 +0000 (16:29 +0200)]
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>
4 years agoisisd: IS-IS-SR preparation for master 5/5
Olivier Dugeon [Mon, 4 May 2020 17:39:20 +0000 (19:39 +0200)]
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>
4 years agoisisd: IS-IS-SR preparation for master 4/5
Olivier Dugeon [Mon, 4 May 2020 16:26:21 +0000 (18:26 +0200)]
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>
4 years agoisisd: IS-IS-SR preparation for master 3/5
Olivier Dugeon [Mon, 4 May 2020 07:40:36 +0000 (09:40 +0200)]
isisd: IS-IS-SR preparation for master 3/5

Add debug macro and debug messages

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
4 years agoisisd: IS-IS-SR preparation for master 2/5
Olivier Dugeon [Sun, 3 May 2020 18:01:20 +0000 (20:01 +0200)]
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>
4 years agoisisd: IS-IS-SR preparation for master 1/5
Olivier Dugeon [Thu, 30 Apr 2020 09:23:15 +0000 (11:23 +0200)]
isisd: IS-IS-SR preparation for master 1/5

 * Rename RB-TREE variable from tree_sr_XXX to srdb_XXX
 * Replace parse_flags by an enum and rename it srdb_state which reflects
   more the role of this flag: determined the state of SR-Node and SR-Prefix
   stored in the SRDB: VALIDATED, NEW, MODIFIED, UNCHANGED

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
4 years agoMerge pull request #6393 from opensourcerouting/7.4/init-config-perms
Donatas Abraitis [Thu, 14 May 2020 09:46:38 +0000 (12:46 +0300)]
Merge pull request #6393 from opensourcerouting/7.4/init-config-perms

[7.4] build: use configfile mode in init script

4 years agobuild: use configfile mode in init script 6393/head
David Lamparter [Mon, 11 May 2020 19:37:08 +0000 (21:37 +0200)]
build: use configfile mode in init script

This only applies for split-config;  the init script would create an
empty config file with default permissions.

Reported-by: Robert Scheck <robert@fedoraproject.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 5c9063771195bb51a8cc1c64f9924e53a0602817)

4 years agoMerge pull request #6365 from donaldsharp/bsd_v6_Null_bs base_7.4
Mark Stapp [Thu, 7 May 2020 17:12:55 +0000 (13:12 -0400)]
Merge pull request #6365 from donaldsharp/bsd_v6_Null_bs

zebra: Add code to install v6 blackhole routes on *bsd

4 years agozebra: Add code to install v6 blackhole routes on *bsd 6365/head
Donald Sharp [Thu, 7 May 2020 15:24:05 +0000 (11:24 -0400)]
zebra: Add code to install v6 blackhole routes on *bsd

This code was just missing.  Take the few minutes and
get it done.

!
ip route 4.5.6.7/32 Null0
ipv6 route 4::5/128 Null0
!
$ netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            192.168.122.1      UGS      vtnet0
4.5.6.7/32         127.0.0.1          UG1B        lo0
127.0.0.1          link#2             UH          lo0
192.168.122.0/24   link#1             U        vtnet0
192.168.122.40     link#1             UHS         lo0

Internet6:
Destination                       Gateway                       Flags     Netif Expire
::/96                             ::1                           UGRS        lo0
::1                               link#2                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
4::5/128                          ::1                           UG1B        lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%vtnet0/64                  link#1                        U        vtnet0
fe80::5054:ff:fe5a:e705%vtnet0    link#1                        UHS         lo0
fe80::%lo0/64                     link#2                        U           lo0
fe80::1%lo0                       link#2                        UHS         lo0
ff02::/16                         ::1                           UGRS        lo0
$

$ uname -a
FreeBSD donna 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64
$

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6356 from ton31337/fix/aggregator_0_ignore
Donald Sharp [Wed, 6 May 2020 23:43:21 +0000 (19:43 -0400)]
Merge pull request #6356 from ton31337/fix/aggregator_0_ignore

bgpd: Ignore aggregator attribute if it's malformed (0.0.0.0)

4 years agoMerge pull request #6358 from donaldsharp/zebra_onlink
Jafar Al-Gharaibeh [Wed, 6 May 2020 20:25:48 +0000 (15:25 -0500)]
Merge pull request #6358 from donaldsharp/zebra_onlink

zebra: Loosen ONLINK restrictions a tiny bit

4 years agoMerge pull request #6359 from sworleys/NHG-No-IPv4-IPv6
Mark Stapp [Wed, 6 May 2020 19:42:52 +0000 (15:42 -0400)]
Merge pull request #6359 from sworleys/NHG-No-IPv4-IPv6

zebra: abstract 5549 check into a function

4 years agoMerge pull request #6357 from mjstapp/fix_ldp_topo1_how
Renato Westphal [Wed, 6 May 2020 15:23:36 +0000 (12:23 -0300)]
Merge pull request #6357 from mjstapp/fix_ldp_topo1_how

tests: remove unused ref files from ldp topotest

4 years agoMerge pull request #6352 from volta-networks/fix_ldp_dscp
Renato Westphal [Wed, 6 May 2020 15:23:01 +0000 (12:23 -0300)]
Merge pull request #6352 from volta-networks/fix_ldp_dscp

ldpd: LDP does not always send traffic with correct DSCP value.

4 years agozebra: Loosen ONLINK restrictions a tiny bit 6358/head
Donald Sharp [Wed, 6 May 2020 14:13:48 +0000 (10:13 -0400)]
zebra: Loosen ONLINK restrictions a tiny bit

Loosen the ONLINK restrictions such that when an upper
level protocol sends us a nexthop with an ONLINK attribute
just ensure that interface is up and usable.  ONLINK effectively
means we know what we are doing to the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoldpd: LDP does not always send traffic with correct DSCP value. 6352/head
Karen Schoener [Tue, 5 May 2020 21:59:00 +0000 (17:59 -0400)]
ldpd: LDP does not always send traffic with correct DSCP value.

Adding code so that the LDP neighbor that does not initiate the
TCP connection also sets the DSCP (via setsocketopt).

Signed-off-by: Karen Schoener <karen@voltanet.io>
4 years agotests: remove unused ref files from ldp topotest 6357/head
Mark Stapp [Wed, 6 May 2020 13:31:21 +0000 (09:31 -0400)]
tests: remove unused ref files from ldp topotest

Remove a couple of a couple of mis-named reference output files
from the ldp-topo1 suite.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agobgpd: Ignore aggregator attribute if it's malformed (0.0.0.0) 6356/head
Donatas Abraitis [Wed, 6 May 2020 09:55:55 +0000 (12:55 +0300)]
bgpd: Ignore aggregator attribute if it's malformed (0.0.0.0)

This is not the attribute involved in path selection and by rfc7606 it should
be just ignored.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Use slightly modified version of error message if AS path contains 0
Donatas Abraitis [Wed, 6 May 2020 09:51:40 +0000 (12:51 +0300)]
bgpd: Use slightly modified version of error message if AS path contains 0

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6347 from opensourcerouting/llvm-callgraph
Quentin Young [Tue, 5 May 2020 21:40:21 +0000 (17:40 -0400)]
Merge pull request #6347 from opensourcerouting/llvm-callgraph

tools: LLVM-based call graphs

4 years agoMerge pull request #6350 from pureport/fix/bgp_double_community_free
Quentin Young [Tue, 5 May 2020 21:39:28 +0000 (17:39 -0400)]
Merge pull request #6350 from pureport/fix/bgp_double_community_free

bgpd: Check to ensure community attributes exist before freeing them

4 years agobgpd: Check to ensure community attributes exist before freeing them 6350/head
Josh Cox [Tue, 5 May 2020 17:09:14 +0000 (13:09 -0400)]
bgpd: Check to ensure community attributes exist before freeing them

Community attributes might have been removed by an inbound route map, so we
should check to ensure they still exist before trying to free them.
This fixes a segfault described in issue #6345.

Signed-off-by: Josh Cox <josh.cox@pureport.com>
4 years agoMerge pull request #6349 from qlyoung/hook-cpp-compat
David Lamparter [Tue, 5 May 2020 19:42:29 +0000 (21:42 +0200)]
Merge pull request #6349 from qlyoung/hook-cpp-compat

4 years agozebra: abstract 5549 check into a function 6359/head
Stephen Worley [Tue, 5 May 2020 19:05:30 +0000 (15:05 -0400)]
zebra: abstract 5549 check into a function

Abstract the 5549 ipv4 over ipv6 into a function for easier
code reuse and reading.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: make hook.h cpp-compatible 6349/head
Quentin Young [Tue, 5 May 2020 18:03:19 +0000 (14:03 -0400)]
lib: make hook.h cpp-compatible

Some CPP compilers don't support these designated initializers, since
we're just zero initializing don't need em

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #6103 from mjstapp/fix_all_unnumbered
Donald Sharp [Tue, 5 May 2020 17:00:26 +0000 (13:00 -0400)]
Merge pull request #6103 from mjstapp/fix_all_unnumbered

zebra: don't treat every interface as unnumbered

4 years agoMerge pull request #6335 from ton31337/feature/show_policy_in_bgp_summary
David Lamparter [Tue, 5 May 2020 13:29:09 +0000 (15:29 +0200)]
Merge pull request #6335 from ton31337/feature/show_policy_in_bgp_summary

4 years agobuild: don't link ldpd.c twice 6347/head
David Lamparter [Tue, 5 May 2020 12:32:21 +0000 (14:32 +0200)]
build: don't link ldpd.c twice

... this breaks LLVM bitcode linking.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agopython: add graphviz callgraphs
David Lamparter [Mon, 4 May 2020 18:57:45 +0000 (20:57 +0200)]
python: add graphviz callgraphs

Uses the JSON data extracted from LLVM bitcode by tools/frr-llvm-cg.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agobuild: add LLVM bitcode targets
David Lamparter [Mon, 4 May 2020 16:39:35 +0000 (18:39 +0200)]
build: add LLVM bitcode targets

Just an easy way to produce LLVM .bc (bitcode) files.  Not used during
normal builds.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agotools: frr-llvm-cg
David Lamparter [Mon, 4 May 2020 15:30:24 +0000 (17:30 +0200)]
tools: frr-llvm-cg

This dumps call graph data from LLVM bitcode files into a JSON file.
Specifically for FRR, it understands thread_add_*(), hook_*() and
install_element() so it can provide extra information in these cases.
As a general feature, it tries to track down function pointers as far as
easily feasible.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agobuild: rework Makefile var extraction... again
David Lamparter [Fri, 1 May 2020 13:22:05 +0000 (15:22 +0200)]
build: rework Makefile var extraction... again

*sigh* I can't seem to catch a break on this.  Add a regex variant.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agoMerge commit '97cfd5d207e46a027809125cfb356fd301af0cf5'
David Lamparter [Mon, 4 May 2020 19:02:13 +0000 (21:02 +0200)]
Merge commit '97cfd5d207e46a027809125cfb356fd301af0cf5'

(from PR #6137)

4 years agodoc: Add an example about what "(Policy)" means under `show bgp summary` 6335/head
Donatas Abraitis [Mon, 4 May 2020 11:49:13 +0000 (14:49 +0300)]
doc: Add an example about what "(Policy)" means under `show bgp summary`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Show "(Policy)" under PfxRcd/PfxSnt when eBGP policy is in use
Donatas Abraitis [Sun, 3 May 2020 18:49:46 +0000 (21:49 +0300)]
bgpd: Show "(Policy)" under PfxRcd/PfxSnt when eBGP policy is in use

It could be hard to notice when eBGP policy is missing in `show bgp summary`.

This adds more sugar to the output:

Normal:
```
 MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
      10        0    0    0 00:02:07            6        8
```
When rfc8212 is enabled (default since 7.4) - OUTBOUND:
```
 MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
      13        0    0    0 00:04:56            6 (Policy)
```
INBOUND:
```
 MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
      19        0    0    0 00:06:27     (Policy)        2
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6330 from sworleys/No-NHG-Install-With-VRFns
Mark Stapp [Fri, 1 May 2020 18:23:49 +0000 (14:23 -0400)]
Merge pull request #6330 from sworleys/No-NHG-Install-With-VRFns

zebra: force off kernel NHG install with netns VRFs

4 years agoMerge pull request #6329 from donaldsharp/zebra_more_info
Mark Stapp [Fri, 1 May 2020 17:48:50 +0000 (13:48 -0400)]
Merge pull request #6329 from donaldsharp/zebra_more_info

zebra: Display ifindex of interface being installed on

4 years agozebra: force off kernel NHG install with netns VRFs 6330/head
Stephen Worley [Fri, 1 May 2020 16:34:43 +0000 (12:34 -0400)]
zebra: force off kernel NHG install with netns VRFs

Force off kernel NHG install with netns-based VRFs for
now. There is not really a good solution for allowing
kernel nexthop groups in namespaced based vrfs.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Display ifindex of interface being installed on 6329/head
Donald Sharp [Fri, 1 May 2020 15:57:02 +0000 (11:57 -0400)]
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>
4 years agoMerge pull request #6326 from mjstapp/ignore_emacs_desktop
Quentin Young [Thu, 30 Apr 2020 22:23:27 +0000 (18:23 -0400)]
Merge pull request #6326 from mjstapp/ignore_emacs_desktop

git: ignore emacs desktop

5 years agogit: ignore emacs desktop 6326/head
Mark Stapp [Thu, 30 Apr 2020 18:19:10 +0000 (14:19 -0400)]
git: ignore emacs desktop

Ignore the emacs desktop files - should never ever be committed

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #6323 from donaldsharp/floom
Mark Stapp [Thu, 30 Apr 2020 17:25:42 +0000 (13:25 -0400)]
Merge pull request #6323 from donaldsharp/floom

bgpd: Ensure that we have a ifp pointer

5 years agoMerge pull request #6322 from ton31337/feature/bgp_bogon_filter_example
Donald Sharp [Thu, 30 Apr 2020 17:14:30 +0000 (13:14 -0400)]
Merge pull request #6322 from ton31337/feature/bgp_bogon_filter_example

doc: Add an example how to filter BGP bogon ASNs

5 years agobgpd: Ensure that we have a ifp pointer 6323/head
Donald Sharp [Thu, 30 Apr 2020 15:16:28 +0000 (11:16 -0400)]
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>
5 years agodoc: Add an example how to filter BGP bogon ASNs 6322/head
Donatas Abraitis [Thu, 30 Apr 2020 14:35:49 +0000 (17:35 +0300)]
doc: Add an example how to filter BGP bogon ASNs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #6318 from opensourcerouting/fix-exit-vrf
Donald Sharp [Thu, 30 Apr 2020 11:30:01 +0000 (07:30 -0400)]
Merge pull request #6318 from opensourcerouting/fix-exit-vrf

lib: update the CLI xpath index when exiting from the VRF node