Commit Graph

19665 Commits

Author SHA1 Message Date
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
Paul Manley
692ce87393 tools: create sub-context for bfd peers
add lines starting with 'peer' to the list of sub-contexts that are handled by frr-reload.py.

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

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

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

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

Fixes: #6573

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Actually handle argv_find the way it was meant to be.

Ticket:CM-29926
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-07-01 14:03:31 -04:00