Commit Graph

19578 Commits

Author SHA1 Message Date
Donald Sharp
848a8ed789
Merge pull request #6409 from ton31337/feature/missing_to_7.4
[7.4] bgpd two fixes
2020-05-15 07:47:05 -04:00
Donatas Abraitis
7288f0807b
Merge pull request #6408 from donaldsharp/reload_74
[7.4] DC's
2020-05-15 09:04:29 +03:00
Donatas Abraitis
90a80a85c4 bgpd: Set a proper SAFI for labaled-unicast when looking for scount
The problem is that peer_af_array returns NULL when SAFI is changed to
unicast. We use unicast table, but peer is created and activated under
labeled-unicast, hence we should lookup with a proper SAFI id.

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

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

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

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

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

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

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

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-14 15:44:55 -04:00
Donatas Abraitis
cb390caaa7
Merge pull request #6393 from opensourcerouting/7.4/init-config-perms
[7.4] build: use configfile mode in init script
2020-05-14 12:46:38 +03:00
David Lamparter
1d4cdc165e 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 5c90637711)
2020-05-13 22:20:36 +02:00
Mark Stapp
faad472899
Merge pull request #6365 from donaldsharp/bsd_v6_Null_bs
zebra: Add code to install v6 blackhole routes on *bsd
2020-05-07 13:12:55 -04:00
Donald Sharp
381477e8a6 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>
2020-05-07 11:24:05 -04:00
Donald Sharp
b4b1d1ebdb
Merge pull request #6356 from ton31337/fix/aggregator_0_ignore
bgpd: Ignore aggregator attribute if it's malformed (0.0.0.0)
2020-05-06 19:43:21 -04:00
Jafar Al-Gharaibeh
a9b763e381
Merge pull request #6358 from donaldsharp/zebra_onlink
zebra: Loosen ONLINK restrictions a tiny bit
2020-05-06 15:25:48 -05:00
Mark Stapp
03ab61c488
Merge pull request #6359 from sworleys/NHG-No-IPv4-IPv6
zebra: abstract 5549 check into a function
2020-05-06 15:42:52 -04:00
Renato Westphal
57ecb94d17
Merge pull request #6357 from mjstapp/fix_ldp_topo1_how
tests: remove unused ref files from ldp topotest
2020-05-06 12:23:36 -03:00
Renato Westphal
ee02198a38
Merge pull request #6352 from volta-networks/fix_ldp_dscp
ldpd: LDP does not always send traffic with correct DSCP value.
2020-05-06 12:23:01 -03:00
Donald Sharp
5cfaa2d92b 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>
2020-05-06 10:15:41 -04:00
Karen Schoener
def23eb395 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>
2020-05-06 09:46:07 -04:00
Mark Stapp
fa6e939421 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>
2020-05-06 09:31:21 -04:00
Donatas Abraitis
cbfc39df11 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>
2020-05-06 12:55:55 +03:00
Donatas Abraitis
6ded3e181b bgpd: Use slightly modified version of error message if AS path contains 0
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-05-06 12:55:13 +03:00
Quentin Young
6f2f2e6172
Merge pull request #6347 from opensourcerouting/llvm-callgraph
tools: LLVM-based call graphs
2020-05-05 17:40:21 -04:00
Quentin Young
794c2b2d73
Merge pull request #6350 from pureport/fix/bgp_double_community_free
bgpd: Check to ensure community attributes exist before freeing them
2020-05-05 17:39:28 -04:00
Josh Cox
2c15754ea3 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>
2020-05-05 15:59:38 -04:00
David Lamparter
d973526821
Merge pull request #6349 from qlyoung/hook-cpp-compat 2020-05-05 21:42:29 +02:00
Stephen Worley
002e5c4357 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>
2020-05-05 15:05:30 -04:00
Quentin Young
e01a788c44 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>
2020-05-05 14:05:03 -04:00
Donald Sharp
44fb33ee58
Merge pull request #6103 from mjstapp/fix_all_unnumbered
zebra: don't treat every interface as unnumbered
2020-05-05 13:00:26 -04:00
David Lamparter
fd0cca8fe2
Merge pull request #6335 from ton31337/feature/show_policy_in_bgp_summary 2020-05-05 15:29:09 +02:00
David Lamparter
43436c155e build: don't link ldpd.c twice
... this breaks LLVM bitcode linking.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-05-05 14:39:12 +02:00
David Lamparter
3d62176b18 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>
2020-05-05 14:39:12 +02:00
David Lamparter
8fb40377de 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>
2020-05-05 14:39:12 +02:00
David Lamparter
0045c13067 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>
2020-05-05 14:39:12 +02:00
David Lamparter
5999439549 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>
2020-05-05 14:06:42 +02:00
David Lamparter
15e9c561b2 Merge commit '97cfd5d207e46a027809125cfb356fd301af0cf5'
(from PR #6137)
2020-05-04 21:02:13 +02:00
Donatas Abraitis
62c42b0efe doc: Add an example about what "(Policy)" means under show bgp summary
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-05-04 15:31:13 +03:00
Donatas Abraitis
d3ada36668 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>
2020-05-03 21:49:46 +03:00
Mark Stapp
81ad029173
Merge pull request #6330 from sworleys/No-NHG-Install-With-VRFns
zebra: force off kernel NHG install with netns VRFs
2020-05-01 14:23:49 -04:00
Mark Stapp
061a8eb349
Merge pull request #6329 from donaldsharp/zebra_more_info
zebra: Display ifindex of interface being installed on
2020-05-01 13:48:50 -04:00
Stephen Worley
d982012a0e 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>
2020-05-01 12:34:43 -04:00
Donald Sharp
2c77ddee4b 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>
2020-05-01 11:58:20 -04:00
Quentin Young
af6642f0e7
Merge pull request #6326 from mjstapp/ignore_emacs_desktop
git: ignore emacs desktop
2020-04-30 18:23:27 -04:00
Mark Stapp
7b7190e249 git: ignore emacs desktop
Ignore the emacs desktop files - should never ever be committed

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-30 14:19:10 -04:00
Mark Stapp
02d5306306
Merge pull request #6323 from donaldsharp/floom
bgpd: Ensure that we have a ifp pointer
2020-04-30 13:25:42 -04:00
Donald Sharp
5a48025ccc
Merge pull request #6322 from ton31337/feature/bgp_bogon_filter_example
doc: Add an example how to filter BGP bogon ASNs
2020-04-30 13:14:30 -04:00
Donald Sharp
68cecc3b69 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>
2020-04-30 11:16:28 -04:00
Donatas Abraitis
125cec1a8f doc: Add an example how to filter BGP bogon ASNs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-30 17:38:31 +03:00
Donald Sharp
ba3f5f06d0
Merge pull request #6318 from opensourcerouting/fix-exit-vrf
lib: update the CLI xpath index when exiting from the VRF node
2020-04-30 07:30:01 -04:00
Donald Sharp
58df03afb1
Merge pull request #6320 from opensourcerouting/fix-vrf-misconfig-detection
zebra: fix detection of VRF misconfiguration
2020-04-30 07:29:17 -04:00
Renato Westphal
2e86d16d99 zebra: fix detection of VRF misconfiguration
The netlink_vrf_change() function is called both when a VRF device
is created in the Linux kernel and when it is activated. This
commit changes this function to perform the VRF misconfiguration
detection only when the VRF device is created, as doing the check
twice would cause a false positive followed by a hard failure (not
to mention the double check is unnecessary since the VRF table ID
can't change once the device is created).

Fixes #6319.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-29 23:34:06 -03:00