]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
4 years agolib: correctly exit CLI nodes on file config load 8580/head
David Lamparter [Thu, 8 Apr 2021 11:35:09 +0000 (13:35 +0200)]
lib: correctly exit CLI nodes on file config load

The (legacy) code for reading split configs tries to execute config
commands in parent nodes, but doesn't call the node_exit function when
it goes up to a parent node.  This breaks BGP RPKI setup (and extended
syslog, which is in the next commit.)

Doing this correctly is a slight bit involved since the node_exit
callbacks should only be called if the command is actually executed on a
parent node.

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

4 years agolib: fix possible assert() fail in zlog_fd()
David Lamparter [Sat, 10 Apr 2021 19:02:06 +0000 (21:02 +0200)]
lib: fix possible assert() fail in zlog_fd()

If the last message in a batched logging operation isn't printed due to
priority, this skips the code that flushes prepared messages through
writev() and can trigger the assert() at the end of zlog_fd().

Since any logmsg above info priority triggers a buffer flush, running
into this situation requires a log file target configured for info
priority, at least 1 message of info priority buffered, a debug message
buffered after that, and then a buffer flush (explicit or due to buffer
full).

I haven't seen this chain of events happen in the wild, but it needs
fixing anyway.

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

4 years agoMerge pull request #7538 from ton31337/fix/zebra_set_src_7.4
Donald Sharp [Fri, 20 Nov 2020 00:26:50 +0000 (19:26 -0500)]
Merge pull request #7538 from ton31337/fix/zebra_set_src_7.4

zebra: [7.4] Allow `set src X` to work on startup

4 years agozebra: Allow `set src X` to work on startup 7538/head
Donald Sharp [Fri, 13 Nov 2020 17:06:57 +0000 (12:06 -0500)]
zebra: Allow `set src X` to work on startup

If a route-map in zebra has `set src X` and the interface
X is on has not been configured yet, we are rejecting the command
outright.  This is a problem on boot up especially( and where I
found this issue ) in that interfaces *can* and *will* be slow
on startup and config can easily be read in *before* the
interface has an ip address.

Let's modify zebra to just warn to the user we may have a problem
and let the chips fall where they may.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoMerge pull request #7468 from ton31337/fix/default-originate-match_7.4
Donald Sharp [Fri, 6 Nov 2020 23:41:08 +0000 (18:41 -0500)]
Merge pull request #7468 from ton31337/fix/default-originate-match_7.4

bgpd: [7.4] Handle route-maps properly for `default-originate route-map` command

4 years agobgpd: Handle route-maps properly for `default-originate route-map` command 7468/head
Donatas Abraitis [Thu, 29 Oct 2020 19:41:12 +0000 (21:41 +0200)]
bgpd: Handle route-maps properly for `default-originate route-map` command

The problem is that only prefixes were handled and any other `match`
commands were ignored. Let's do not forget them as well.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agotests: Add more tests for BGP default-originate command
Donatas Abraitis [Fri, 30 Oct 2020 10:47:44 +0000 (12:47 +0200)]
tests: Add more tests for BGP default-originate command

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #7406 from c-po/7.4-backports
Donald Sharp [Wed, 28 Oct 2020 23:11:30 +0000 (19:11 -0400)]
Merge pull request #7406 from c-po/7.4-backports

VyOS backports from 7.5 series for FRR 7.4

4 years agobfdd: fix parameter length 7406/head
Igor Ryzhov [Mon, 24 Aug 2020 15:45:53 +0000 (18:45 +0300)]
bfdd: fix parameter length

There is no space reserved for "[source-addr='']".

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit e6426ace1edadd3c27ac612815ebc994ea54ba39)

4 years agoospf6d: decimal area format in interface command
Patrick Ruddy [Wed, 3 Oct 2018 17:22:34 +0000 (18:22 +0100)]
ospf6d: decimal area format in interface command

The ospf6 "interface <blah> area <x>" command only allows the area to
be specified in the ipv4 address format, whereas the show run command
always shows it in the format in which the area was created. This causes
the frr-reload script to be unable to remove ospfv3 interfaces when the
area was created in decimal format. The solution is to allow both formats
to be configured as they can be for other area commands.

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
(cherry picked from commit de842255f9a1930d7f927e94e7ea800bcfd1434c)

4 years agoMerge pull request #7208 from deastoe/zebra-fpm-blackhole-abort_7.4
Rafael Zalamena [Wed, 30 Sep 2020 13:25:14 +0000 (10:25 -0300)]
Merge pull request #7208 from deastoe/zebra-fpm-blackhole-abort_7.4

[7.4] zebra: fix FPM abort for blackhole/unreach/prohibit routes

4 years agozebra: fix FPM abort for unreach/prohibit routes 7208/head
Duncan Eastoe [Mon, 28 Sep 2020 11:51:19 +0000 (12:51 +0100)]
zebra: fix FPM abort for unreach/prohibit routes

f4517a795d9b719b220fa9013810c1a234e69568 fixed an issue whereby
zebra would abort while building an update for a blackhole route.

The same issue, `assert(data_len)` failing in
`zfpm_build_route_updates()`, can be observed when building updates
for unreachable and prohibit routes.

To address this `netlink_route_info_fill()` is updated to not
indicate failure, due to lack of nexthops, for any blackhole routes.

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
(cherry picked from commit 94f7786375030e08063cdae5b4577edf26adb456)

4 years agozebra: Fix zebra crashed in building FPM netlink message when bgp sends aggregation...
Richard Wu [Wed, 3 Jun 2020 01:44:16 +0000 (09:44 +0800)]
zebra: Fix zebra crashed in building FPM netlink message when bgp sends aggregation routes to zebra.

Issue:
    When BGP sends aggregation routes to zebra, the next hop is black hole.
    Then Zebra will try to build the netlink FPM message, but there is no
    next hop as it is a black hole route. Then the netlink_route_info_fill
    function returns 0. In the result, zebra will crashed in
    "assert(data_len)" of zfpm_build_route_updates.
    This issue also happen when I create a static black hole route via
    staticd.
Fix:
    As the netlink message of the blackhole route is legal, it should return
    success.

Signed-off-by: Richard Wu <wutong23@baidu.com>
(cherry picked from commit b0e9567ed162da708f8d0b3a3caf87cd03b62e96)

4 years agoMerge pull request #7191 from ton31337/feature/bgpd_cherry_picks_7.4
Patrick Ruddy [Tue, 29 Sep 2020 08:58:33 +0000 (09:58 +0100)]
Merge pull request #7191 from ton31337/feature/bgpd_cherry_picks_7.4

bgpd: [7.4] timers, static routes, router-id backports

4 years agobgpd: allow derived router-id update if previously 0x0 7191/head
Don Slice [Tue, 22 Sep 2020 13:14:52 +0000 (06:14 -0700)]
bgpd: allow derived router-id update if previously 0x0

Problem found that if a router-id was not defined or derived
initially, the bgp->router_id would be set to 0x0 and used
for determining auto-rd values. When bgp received a subsequent
router-id update from zebra, bgp would not completely process
the update since it was treated as updating an already derived
router-id with a new value, which is not desired.  This also
could leave the auto rd/rt inforamation missing or invalid in
some cases.  This fix allows updating the derived router-id if
the previous value was 0/0.

Ticket: CM-31441
Signed-off-by: Don Slice <dslice@nvidia.com>
4 years agobgpd: Use bgp instance's default keepalive interval if < (holdtime/3)
Trey Aspelund [Wed, 23 Sep 2020 18:16:50 +0000 (14:16 -0400)]
bgpd: Use bgp instance's default keepalive interval if < (holdtime/3)

bgp->default_keepalive was not considered when setting
peer->v_keepalive, causing the effective keepalive interval to
always be (holdtime/3), even when default_keepalive < (holdtime/3).
This ensures that the default_keepalive is used when it's set and
is < (holdtime/3).

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
(cherry picked from commit d8bf8c6128f2e493d473148213bd663a500c7f73)

4 years agobgpd: Allow bgp static routes to use /32's
Donald Sharp [Fri, 25 Sep 2020 13:45:24 +0000 (09:45 -0400)]
bgpd: Allow bgp static routes to use /32's

If you are including a network statement of a /32
then the current bgp martian checks will match the /32
together.

Problem:
!
router bgp 3235
 neighbor 192.168.161.2 remote-as external
 neighbor 192.168.161.131 remote-as external
 !
 address-family ipv4 unicast
  network 10.10.3.11/32
  network 192.168.161.0/24
  no neighbor 192.168.161.2 activate
  neighbor 192.168.161.2 route-map BLUE in
 exit-address-family
!
eva# show bgp ipv4 uni
BGP table version is 1, local router ID is 10.10.3.11, vrf id 0
Default local pref 100, local AS 3235
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.10.3.11/32    0.0.0.0(eva)             0         32768 i
*> 192.168.161.0/24 0.0.0.0(eva)             0         32768 i
Displayed  2 routes and 2 total paths
eva# show bgp import-check-table
Current BGP import check cache:
 192.168.161.0 valid [IGP metric 0], #paths 1
  if enp39s0
  Last update: Fri Sep 25 08:00:42 2020
 10.10.3.11 valid [IGP metric 0], #paths 1
  if lo
  Last update: Fri Sep 25 08:00:42 2020
eva# show bgp ipv4 uni summ
BGP router identifier 10.10.3.11, local AS number 3235 vrf-id 0
BGP table version 1
RIB entries 3, using 576 bytes of memory
Peers 1, using 21 KiB of memory
Neighbor                 V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
janelle(192.168.161.131) 4      60000        69        70        0    0    0 00:03:21            0        1
Total number of neighbors 1

When we are deciding that a nexthop is valid there is not much point in checking
that a static route has a martian nexthop or not, since we self derived it already.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoMerge pull request #7153 from donaldsharp/7.4_bsd_address
Mark Stapp [Wed, 23 Sep 2020 12:15:12 +0000 (08:15 -0400)]
Merge pull request #7153 from donaldsharp/7.4_bsd_address

zebra: Allow FreeBSD to set and delete addresses from an interface

4 years agozebra: Allow FreeBSD to set and delete addresses from an interface 7152/head 7153/head
Donald Sharp [Mon, 21 Sep 2020 00:21:41 +0000 (20:21 -0400)]
zebra: Allow FreeBSD to set and delete addresses from an interface

This series of events:

$ sudo ifconfig lo0 add 4.4.4.4/32
$ sudo ifconfig lo0 inet 4.4.4.4/32 delete

would end up leaving the 4.4.4.4/32 address on the interface under
freebsd.

This all boils down to the fact that the interface is not
considered connected yet we have a destination.  If the
destination is the same and we are not connected ignore
it on freebsd.

I am sure there are other fun scenarios that someone
will have to squirrel out.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoMerge pull request #7135 from ton31337/fix/do_not_allow_setting_maximum-prefix-out_gl...
Rafael Zalamena [Sun, 20 Sep 2020 14:00:10 +0000 (11:00 -0300)]
Merge pull request #7135 from ton31337/fix/do_not_allow_setting_maximum-prefix-out_global_7.4

bgpd: [7.4] Create separate udpate-group when using `maximum-prefix-out` command

4 years agobgpd: Create separate udpate-group when using `maximum-prefix-out` command 7135/head
Donatas Abraitis [Wed, 2 Sep 2020 05:44:27 +0000 (08:44 +0300)]
bgpd: Create separate udpate-group when using `maximum-prefix-out` command

This is needed to avoid mangling update-group which is used for many peers.

Sent prefix count is managed by update-groups.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6897 from chiragshah6/evpn_7_4
Sri Mohana Singamsetty [Wed, 16 Sep 2020 06:06:07 +0000 (23:06 -0700)]
Merge pull request #6897 from chiragshah6/evpn_7_4

zebra: Revert "zebra: probe local inactive neigh"

4 years agoMerge pull request #7006 from Jafaral/pim-dup-7.4
Donald Sharp [Thu, 27 Aug 2020 11:09:55 +0000 (07:09 -0400)]
Merge pull request #7006 from Jafaral/pim-dup-7.4

[7.4] pimd: fix igmp querier election and IP address mapping

4 years agopimd: fix IGMP querier election 7006/head
Nathan Bahr [Mon, 24 Aug 2020 18:52:51 +0000 (13:52 -0500)]
pimd: fix IGMP querier election

Match by exact address rather than by prefix match to
determine if we generated the IGMPP query. Othwerwise
we will be ignoring IGMP queries coming from other
hosts on the same subnet.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Reviewed-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
4 years agopimd: fix IGMP source address on transmit
Nathan Bahr [Wed, 19 Aug 2020 19:42:07 +0000 (14:42 -0500)]
pimd: fix IGMP source address on transmit

IGMP queries should contain the source address of the IGMP socket
they are being sent from.
Added binding the IGMP sockets to their specific source, otherwise
interfaces with multiple addresses will send multiple queries using
the same source, which is determined by the kernel.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Reviewed-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
4 years agopimd: fix IGMP receive handling
Nathan Bahr [Wed, 19 Aug 2020 19:26:41 +0000 (14:26 -0500)]
pimd: fix IGMP receive handling

IGMP packets received from a source that does not match the subnet
of any configured addresses on the receive interface should be
ignored.
Also, find and use the correct IGMP socket object for the received
IGMP packet.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
4 years agoMerge pull request #6953 from opensourcerouting/74_fix_python27_build
Donatas Abraitis [Sat, 22 Aug 2020 19:07:28 +0000 (22:07 +0300)]
Merge pull request #6953 from opensourcerouting/74_fix_python27_build

[7.4] python: Make FRR build compatible with python 2.7 and 3.x

4 years agoMerge pull request #6916 from ton31337/feature/dump_attributes_for_debugging_if_malfo...
Rafael Zalamena [Thu, 20 Aug 2020 11:23:04 +0000 (11:23 +0000)]
Merge pull request #6916 from ton31337/feature/dump_attributes_for_debugging_if_malformed_7.4

bgpd: [7.4] Dump attributes before returning from bgp_attr_malformed()

4 years agopython: Make FRR build compatible with python 2.7 and 3.x 6953/head
Martin Winter [Wed, 19 Aug 2020 17:17:32 +0000 (19:17 +0200)]
python: Make FRR build compatible with python 2.7 and 3.x

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agobgpd: Use sizeof() in bgp_dump_attr() 6916/head
Donatas Abraitis [Wed, 19 Aug 2020 12:57:26 +0000 (15:57 +0300)]
bgpd: Use sizeof() in bgp_dump_attr()

Missed this in 5022c8331d0119886a08dcef7b1eee4525b4d63a

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Use sizeof() in bgp_dump_attr()
Donatas Abraitis [Tue, 18 Aug 2020 18:43:07 +0000 (21:43 +0300)]
bgpd: Use sizeof() in bgp_dump_attr()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6942 from LabNConsulting/working/lb/7.4/valgrind-supp-libyang
Donald Sharp [Wed, 19 Aug 2020 11:42:33 +0000 (07:42 -0400)]
Merge pull request #6942 from LabNConsulting/working/lb/7.4/valgrind-supp-libyang

[7.4] bgpd: suppress new libyang_1.0 related loss reports

4 years agobgpd: suppress new libyang_1.0 related loss reports 6942/head
Lou Berger [Tue, 18 Aug 2020 15:43:07 +0000 (11:43 -0400)]
bgpd: suppress new libyang_1.0 related loss reports

Signed-off-by: Lou Berger <lberger@labn.net>
4 years agobgpd: Dump attributes before returning from bgp_attr_malformed()
Donatas Abraitis [Thu, 13 Aug 2020 15:42:31 +0000 (18:42 +0300)]
bgpd: Dump attributes before returning from bgp_attr_malformed()

This would be handy for situations when a notification was sent, but it's
absolutely not clear who triggered that.

Just in case dumping all attributes under the debug mode would help finding
the _bad_ attribute.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agozebra: Revert "zebra: probe local inactive neigh" 6897/head
Chirag Shah [Tue, 11 Aug 2020 21:28:20 +0000 (14:28 -0700)]
zebra: Revert "zebra: probe local inactive neigh"

Reverting probing of neigh entry. There is a timing where
probe and remote macip add request comes at the same time resulting
in neigh to remain in local state event though it should be remote.

In mobility case, the host moves to remote VTEP, first MAC only type-2
route is received which triggers a PROBE of neighs (associated to MAC).
PROBE request can go via network port to remote VTEP.

PROBE request picks up local neigh with MAC entry's outgoing port is
remote VTEP tunnel port.
The PROBE reply and MAC-IP (containing IP) almost comes same time at
DUT.

DUT first processes remote macip and installs neigh as remote.
Followed by receives neigh as REACHABLE which marks neigh as LOCAL.

FRR does have BPF filter which does not allow its own netlink request
to receive. Otherwise frr's request to program neigh as remote can move
neigh from local to remote.

Though ordering can not be guranteed that REACHABLE (PROBE's repsonse)
can come at anytime and move it to LOCAL.

This fix would not suffice the needs of converging LOCAL inactive neighs
to remove from DB. As mobility draft sugges to PROBE local neigh when
MAC moves to remote but it is not working with current framework.

Ticket:CM-22864

Reverts commit: 44bc8ae5508975f216ad1cbb42884579896e7258

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoMerge pull request #6865 from volta-networks/fix_ldp_oc_withdraw_7.4
Renato Westphal [Wed, 5 Aug 2020 23:59:34 +0000 (20:59 -0300)]
Merge pull request #6865 from volta-networks/fix_ldp_oc_withdraw_7.4

ldpd: ldp-oc withdraw fix

4 years agoldpd: ldp-oc withdraw fix 6865/head
lynne [Wed, 5 Aug 2020 20:54:43 +0000 (16:54 -0400)]
ldpd: ldp-oc withdraw fix

When LDP is configured in Order Control mode and we receive a
label withdraw message, we should only resend label withdraws to
peers that are the NH for that fec being withdrawn.  This is a
double commit.   Original fix in master is #6864.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
4 years agoMerge pull request #6846 from sworleys/Evpn-Fix_74
Donatas Abraitis [Tue, 4 Aug 2020 06:22:01 +0000 (09:22 +0300)]
Merge pull request #6846 from sworleys/Evpn-Fix_74

[7.4] Zebra macfdb fixup

4 years agozebra: Install bridge FDB entries with correct VTEP IP 6846/head
vivek [Fri, 15 May 2020 21:01:59 +0000 (14:01 -0700)]
zebra: Install bridge FDB entries with correct VTEP IP

Fixes: zebra: adapt and export rmac netlink functions
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agozebra: Pass correct buffer to MAC FDB netlink message build
vivek [Fri, 15 May 2020 20:58:30 +0000 (13:58 -0700)]
zebra: Pass correct buffer to MAC FDB netlink message build

Fixes: zebra: adapt and export rmac netlink functions
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agoMerge pull request #6794 from ton31337/fix/handle_bgp_vrf_all_statistics_crash_7.4
Donald Sharp [Mon, 27 Jul 2020 11:49:24 +0000 (07:49 -0400)]
Merge pull request #6794 from ton31337/fix/handle_bgp_vrf_all_statistics_crash_7.4

bgpd: [7.4] Handle default bgp vrf all for statistics

4 years agoMerge pull request #6772 from opensourcerouting/7.4/netbsd-tls-buf
Quentin Young [Fri, 24 Jul 2020 18:53:35 +0000 (14:53 -0400)]
Merge pull request #6772 from opensourcerouting/7.4/netbsd-tls-buf

[7.4] lib: fix TLS log buffer on NetBSD

4 years agobgpd: Do not crash if bgp argument is NULL for bgp_table_stats() 6794/head
Donatas Abraitis [Sun, 12 Jul 2020 19:12:36 +0000 (22:12 +0300)]
bgpd: Do not crash if bgp argument is NULL for bgp_table_stats()

```
(gdb) bt
0  0x00007f45a6f0a781 in raise () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007f45a6ef455b in abort () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007f45a7781920 in core_handler (signo=11, siginfo=0x7fffac7b84b0, context=<optimized out>) at lib/sigevent.c:228
3  <signal handler called>
4  0x000055a4133c0f32 in bgp_table_stats (vty=vty@entry=0x55a415acb240, bgp=0x0, afi=AFI_IP, safi=SAFI_UNICAST, json_array=json_array@entry=0x0) at bgpd/bgp_route.c:11412
5  0x000055a4133c13fb in show_ip_bgp_afi_safi_statistics (self=<optimized out>, vty=0x55a415acb240, argc=6, argv=<optimized out>) at bgpd/bgp_route.c:10749
6  0x00007f45a773917d in cmd_execute_command_real (vline=vline@entry=0x55a415ab7e10, vty=vty@entry=0x55a415acb240, cmd=cmd@entry=0x0, filter=FILTER_RELAXED)
    at lib/command.c:909
7  0x00007f45a773afdf in cmd_execute_command (vline=vline@entry=0x55a415ab7e10, vty=vty@entry=0x55a415acb240, cmd=0x0, vtysh=vtysh@entry=0) at lib/command.c:968
8  0x00007f45a773b135 in cmd_execute (vty=vty@entry=0x55a415acb240, cmd=cmd@entry=0x55a415ace950 "show ip bgp vrf all statistics", matched=matched@entry=0x0,
    vtysh=vtysh@entry=0) at lib/command.c:1122
9  0x00007f45a7794d62 in vty_command (vty=vty@entry=0x55a415acb240, buf=0x55a415ace950 "show ip bgp vrf all statistics") at lib/vty.c:526
10 0x00007f45a7794fb6 in vty_execute (vty=vty@entry=0x55a415acb240) at lib/vty.c:1293
11 0x00007f45a7797804 in vtysh_read (thread=<optimized out>) at lib/vty.c:2126
12 0x00007f45a778f641 in thread_call (thread=thread@entry=0x7fffac7bb040) at lib/thread.c:1550
13 0x00007f45a775b6d8 in frr_run (master=0x55a415542820) at lib/libfrr.c:1098
14 0x000055a4133815d6 in main (argc=10, argv=0x7fffac7bb2a8) at bgpd/bgp_main.c:509
```

"show ip bgp vrf all statistics" should show statistics for all VRFs if "all"
is specified.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Show the instance name when displaying statistics
Donatas Abraitis [Wed, 15 Jul 2020 14:52:12 +0000 (17:52 +0300)]
bgpd: Show the instance name when displaying statistics

```
exit1-debian-9# sh ip bgp vrf all statistics json
{
  "ipv4Unicast":[
    {
      "instance":"VRF default",
      "totalAdvertisements":2,
      "totalPrefixes":2,
      "averagePrefixLength":24,
      "unaggregateablePrefixes":2,
      "maximumAggregateablePrefixes":0,
      "bgpAggregateAdvertisements":0,
      "addressSpaceAdvertised":512,
      "%announced":1.1920928955078125e-05,
      "\/8equivalent":3.0517578125e-05,
      "\/24equivalent":2,
      "advertisementsWithPaths":2,
      "longestAsPath":0,
      "averageAsPathLengthHops":0,
      "largestAsPath":0,
      "averageAsPathSizeBytes":0,
      "highestPublicAsn":0
    },
    {
      "instance":"VRF testas",
      "totalAdvertisements":0,
      "totalPrefixes":0,
      "averagePrefixLength":0,
      "unaggregateablePrefixes":0,
      "maximumAggregateablePrefixes":0,
      "bgpAggregateAdvertisements":0,
      "addressSpaceAdvertised":0,
      "%announced":0,
      "\/8equivalent":0,
      "\/24equivalent":0,
      "advertisementsWithPaths":0,
      "longestAsPath":0,
      "averageAsPathLengthHops":0,
      "largestAsPath":0,
      "averageAsPathSizeBytes":0,
      "highestPublicAsn":0
    }
  ]
}
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
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>