Commit Graph

19679 Commits

Author SHA1 Message Date
Donatas Abraitis
a54d79af41 tests: Add more tests for BGP default-originate command
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-11-05 22:07:29 +02:00
Donald Sharp
ea8cd94b45
Merge pull request #7406 from c-po/7.4-backports
VyOS backports from 7.5 series for FRR 7.4
2020-10-28 19:11:30 -04:00
Igor Ryzhov
cf28b185ce bfdd: fix parameter length
There is no space reserved for "[source-addr='']".

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit e6426ace1e)
2020-10-28 17:30:32 +01:00
Patrick Ruddy
5580cf83b5 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 de842255f9)
2020-10-28 17:30:26 +01:00
Rafael Zalamena
c2213a2d7d
Merge pull request #7208 from deastoe/zebra-fpm-blackhole-abort_7.4
[7.4] zebra: fix FPM abort for blackhole/unreach/prohibit routes
2020-09-30 10:25:14 -03:00
Duncan Eastoe
75740b9c79 zebra: fix FPM abort for unreach/prohibit routes
f4517a795d 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 94f7786375)
2020-09-30 10:33:46 +01:00
Richard Wu
f4517a795d 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 b0e9567ed1)
2020-09-30 10:33:27 +01:00
Patrick Ruddy
81ce430b7e
Merge pull request #7191 from ton31337/feature/bgpd_cherry_picks_7.4
bgpd: [7.4] timers, static routes, router-id backports
2020-09-29 09:58:33 +01:00
Don Slice
63b70c84b7 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>
2020-09-28 11:22:05 +03:00
Trey Aspelund
b3382a4c64 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)
2020-09-28 11:22:03 +03:00
Donald Sharp
0dd8f34328 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>
2020-09-28 11:22:00 +03:00
Mark Stapp
69436f30df
Merge pull request #7153 from donaldsharp/7.4_bsd_address
zebra: Allow FreeBSD to set and delete addresses from an interface
2020-09-23 08:15:12 -04:00
Donald Sharp
8d20ecbd88 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>
2020-09-22 10:05:53 -04:00
Rafael Zalamena
25580c2c3c
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
2020-09-20 11:00:10 -03:00
Donatas Abraitis
d6fbec85fe 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>
2020-09-19 20:14:24 +03:00
Sri Mohana Singamsetty
fc6a59c328
Merge pull request #6897 from chiragshah6/evpn_7_4
zebra: Revert "zebra: probe local inactive neigh"
2020-09-15 23:06:07 -07:00
Donald Sharp
ff6ef24733
Merge pull request #7006 from Jafaral/pim-dup-7.4
[7.4] pimd: fix igmp querier election and IP address mapping
2020-08-27 07:09:55 -04:00
Nathan Bahr
6e84089005 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>
2020-08-26 11:14:51 -05:00
Nathan Bahr
e0d28b66f1 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>
2020-08-26 11:14:41 -05:00
Nathan Bahr
496c870bac 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>
2020-08-26 11:14:31 -05:00
Donatas Abraitis
e655bb7198
Merge pull request #6953 from opensourcerouting/74_fix_python27_build
[7.4] python: Make FRR build compatible with python 2.7 and 3.x
2020-08-22 22:07:28 +03:00
Rafael Zalamena
d752b00409
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()
2020-08-20 11:23:04 +00:00
Martin Winter
1b460db6b8
python: Make FRR build compatible with python 2.7 and 3.x
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-08-19 19:39:24 +02:00
Donatas Abraitis
b9ad14e5e8 bgpd: Use sizeof() in bgp_dump_attr()
Missed this in 5022c8331d

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-08-19 15:59:30 +03:00
Donatas Abraitis
6e03b29bb0 bgpd: Use sizeof() in bgp_dump_attr()
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-08-19 15:54:05 +03:00
Donald Sharp
d959dd83c8
Merge pull request #6942 from LabNConsulting/working/lb/7.4/valgrind-supp-libyang
[7.4] bgpd: suppress new libyang_1.0 related loss reports
2020-08-19 07:42:33 -04:00
Lou Berger
3db2bb1b97 bgpd: suppress new libyang_1.0 related loss reports
Signed-off-by: Lou Berger <lberger@labn.net>
2020-08-18 11:46:40 -04:00
Donatas Abraitis
45fa94a942 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>
2020-08-14 07:22:22 +03:00
Chirag Shah
7d4c8d060e 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: 44bc8ae550

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-08-11 14:30:07 -07:00
Renato Westphal
e9faa35ccd
Merge pull request #6865 from volta-networks/fix_ldp_oc_withdraw_7.4
ldpd: ldp-oc withdraw fix
2020-08-05 20:59:34 -03:00
lynne
93580adb9c 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>
2020-08-05 17:11:28 -04:00
Donatas Abraitis
599a268911
Merge pull request #6846 from sworleys/Evpn-Fix_74
[7.4] Zebra macfdb fixup
2020-08-04 09:22:01 +03:00
vivek
f0b014fdae 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>
2020-08-03 17:06:33 -04:00
vivek
9c0a2e5a29 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>
2020-08-03 17:06:22 -04:00
Donald Sharp
2c44ac162c
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
2020-07-27 07:49:24 -04:00
Quentin Young
78292ed227
Merge pull request #6772 from opensourcerouting/7.4/netbsd-tls-buf
[7.4] lib: fix TLS log buffer on NetBSD
2020-07-24 14:53:35 -04:00
Donatas Abraitis
ad30a4304f 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>
2020-07-23 15:56:45 +03:00
Donatas Abraitis
b5bae2c827 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>
2020-07-23 15:56:39 +03:00
David Lamparter
cacc6cc95e 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 6a3b431b85)
2020-07-20 06:30:00 +02:00
Rafael Zalamena
5693f6e1c8
Merge pull request #6768 from ton31337/fix/bgp_mrai_bug_7.4
bgpd: [7.4] Fix the bug that BGP MRAI does not work
2020-07-19 11:39:52 -03:00
Richard Wu
2bbe7133eb 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>
2020-07-18 21:44:49 +03:00
Rafael Zalamena
57fe007c77
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
2020-07-16 09:53:16 -03:00
Donatas Abraitis
8df39282ea doc: Add some words about bgp default show-[nexthop]-hostname
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-07-15 21:27:22 +03:00
Donatas Abraitis
104dfe5258 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>
2020-07-15 21:27:19 +03:00
Donatas Abraitis
e7cc3d2145 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>
2020-07-15 21:27:15 +03:00
Donatas Abraitis
c6a5994609 tests: Remove bgp_show_ip_bgp_fqdn test
Not really relevant for now.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-07-15 21:27:10 +03:00
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