Commit Graph

23768 Commits

Author SHA1 Message Date
Igor Ryzhov
e82acdce22 lib: remove enabled flag for bfd sessions
Currently this flag is only helpful in an extremely rare situation when
the BFD session registration was unsuccessful and after that zebra is
restarted. Let's remove this flag to simplify the API. If we ever want
to solve the problem of unsuccessful registration/deregistration, this
can be done using internal flags, without API modification.

Also add the error log to help user understand why the BFD session is
not working.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-22 16:39:29 +03:00
Sri Mohana Singamsetty
97444b25ad
Merge pull request #8500 from ton31337/fix/indentation_for_show_ip_bgp_large_community_list_cmd
bgpd: Fix clang-format/indentation for show_ip_bgp_large_community_list_cmd
2021-04-19 17:12:24 -07:00
Igor Ryzhov
8d31c67c79
Merge pull request #8502 from ranjanyash54/core_dump
ospf6d: Fix coredump when "no interface IFNAME area <A.B.C.D>" is called
2021-04-18 18:23:01 +03:00
Yash Ranjan
f85a41124b ospf6d: Fix coredump when "no interface IFNAME area <A.B.C.D>" is called
When oi->area == NULL, it tries to print the
interface's area name, but no area is present.
Print the area name from the command argument instead.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-04-18 04:22:56 -07:00
David Lamparter
79ec61be27
Merge pull request #8491 from qlyoung/fix-alpine-libelf-dev-build 2021-04-18 08:50:20 +02:00
Donatas Abraitis
ef3364f0f5 bgpd: Fix clang-format/indentation for show_ip_bgp_large_community_list_cmd
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-18 07:52:07 +03:00
Martin Winter
6e0368f61a
Merge pull request #8434 from donaldsharp/python_bullshit
Python pylint stuff
2021-04-16 23:17:04 +02:00
Mark Stapp
c1f42d2614
Merge pull request #8490 from qlyoung/fix-bgp-handle-socket-read-errors-in-main-pthread
bgpd: fix uninit value when handling bgp read errs
2021-04-16 16:07:50 -04:00
Quentin Young
9513086d4e docker: pin alpine base image to 3.13
'latest' isn't appropriate for us

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-16 13:02:18 -04:00
Quentin Young
daff938c7e alpine: add missing libelf-dev dependency
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-16 13:02:15 -04:00
Mark Stapp
861ea6f268
Merge pull request #8465 from opensourcerouting/vtysh-scan-snafu
fix vtysh_scan SNAFUs
2021-04-16 08:23:20 -04:00
Quentin Young
b8cfb2cd41 bgpd: fix uninit value when handling bgp read errs
Compiler warns about uninitialized value, although in practice it is
unreachable.

Also updates a function comment explaining what that value does.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-15 18:07:44 -04:00
David Lamparter
010bf6f1ca python: add demo checker tool using frr.xref
More of a demo on what to do with the frr.xref file, but also slightly
useful in finding vtysh SNAFUs :)

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15 23:12:45 +02:00
David Lamparter
ee4dcee834 vtysh: add lib/thread.c to vtysh_scan
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15 23:12:45 +02:00
David Lamparter
9cb089fc43 vtysh: add lib/resolver.c to vtysh_scan
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15 23:12:45 +02:00
David Lamparter
c4e57cd52e vtysh: add lib/spf_backoff.c to vtysh_scan
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15 23:12:45 +02:00
David Lamparter
48843422d3 vtysh: add lib/log_vty.c to vtysh_scan
Rather than copying everything over, include the file in vtysh_scan for
automatic pickup.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15 23:12:45 +02:00
Quentin Young
dc92ca52c5
Merge pull request #8483 from opensourcerouting/asan-fix
lib: disable ASAN redzone around xref_p/xref_array
2021-04-15 20:46:35 +00:00
Martin Winter
0575d5a8f8
Merge pull request #8437 from donaldsharp/verify_bgp_community_no_sleep
tests: Do not sleep(5) when verifying bgp communities
2021-04-15 14:03:37 +02:00
Donald Sharp
afbb000e26 tests: test_bgp_vrf_dynamic_route_leak_topo1.py was missing a variable
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
6882ab5e7f tests: Fix test_bgp_multi_vrf_topo2.py string formatting
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
0b711f0a20 tests: test_bgp_multi_vrf_topo1.py fix formatting issues pointed out by pylint
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
f4baa8fe25 tests: Remove unnecessary formating for strings
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
d9df892180 tests: Remove duplicate functions in python code
We have basically two identical functions in test_bgp_gr_functionality_topo1.py
Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:06 -04:00
Igor Ryzhov
dceb1b6223
Merge pull request #8477 from opensourcerouting/lib-bfd-fix 2021-04-15 09:32:23 +03:00
David Lamparter
1b958b2ef8 lib: disable ASAN redzone around xref_p/xref_array
The "xref_p" variables are placed in the "xref_array" section
specifically so they're next to each other and we get an array at the
end.  The ASAN redzone that is inserted around global variables is
breaks that since it'd be inserted before and after each of the array
items.  So disable the ASAN redzone for these variables (and only these
variables, nothing else should be affected.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-15 06:27:34 +02:00
Renato Westphal
1e3937b33d
Merge pull request #8467 from idryzhov/fix-acl-delete
lib: fix access-list deletion
2021-04-14 23:58:39 -03:00
Renato Westphal
9759c5122d
Merge pull request #8469 from mjstapp/fix_bgp_nhg_mpath
bgpd: don't overrun fixed zapi array of nexthops
2021-04-14 23:54:08 -03:00
Renato Westphal
8b74cd9e6d
Merge pull request #8470 from mjstapp/fix_nhrp_cov_socket
nhrpd: fix coverity warning about os_socket()
2021-04-14 23:52:39 -03:00
Rafael Zalamena
9c39d19742 lib: fix BFD crash on interface removal
- Handle badly formatted messages (don't set `ifp` in that case)
- Handle unread messages (e.g. when family is not don't trigger `assert`)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-14 15:28:09 -03:00
Patrick Ruddy
5bb91468c5
Merge pull request #8003 from donaldsharp/timings
lib: Differentiate between real and cpu bound processes
2021-04-14 18:33:18 +01:00
Quentin Young
8a0a716f83
Merge pull request #8356 from LabNConsulting/working/lb/docker-ci-v2 2021-04-14 16:27:39 +00:00
Donald Sharp
1ff339ac05
Merge pull request #8450 from ton31337/feature/frr_history_turn_on_off
vtysh: Set history file on demand
2021-04-14 09:59:09 -04:00
Mark Stapp
f5a1fb4f32 nhrpd: fix coverity warning about os_socket()
Ensure we don't try to use an invalid fd in nhrpd, reported
by coverity.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-14 09:57:41 -04:00
Mark Stapp
719b209ce7 bgpd: don't overrun fixed zapi array of nexthops
Avoid overrunning the fixed-size array of nexthops in a
zapi_nhg.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-14 09:24:37 -04:00
Donald Sharp
8a2ec9102f
Merge pull request #8320 from idryzhov/prefix-list-seqnum
lib: remove "ip prefix-list sequence-number" command
2021-04-14 09:21:28 -04:00
Igor Ryzhov
8c4796a22d lib: fix access-list deletion
Problems with the current implementation:
* Delete hook is called before the deletion of the access-list from the
  master list, which means that daemons processing this hook successfully
  find this access-list, store a pointer to it in their structures, and
  right after that the access-list is freed. Daemons end up having stale
  pointer to the freed structure.
* Route-maps are not notified of the deletion.

This commit fixes both issues.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-14 13:08:18 +03:00
Sri Mohana Singamsetty
dea4eee59f
Merge pull request #8446 from ton31337/fix/json_output_for_specific_vs_global_should_be_the_same
bgpd: Add `show bgp json detail` command
2021-04-13 17:33:17 -07:00
Sri Mohana Singamsetty
e64a538c70
Merge pull request #8448 from ton31337/feature/show_rpki_state_in_global_show_bgp
bgpd: Show RPKI short state in `show bgp <afi> <safi>`
2021-04-13 17:32:37 -07:00
David Lamparter
5a4ee981d0 vtysh: fix extract.pl for commands with "_cmd"
If the command includes `_cmd`, hilarity ensues ;)

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-13 23:57:14 +02:00
David Lamparter
c574670847 build: don't use $(top_srcdir) in vtysh_scan
It's not necessary and can confuse scripts.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-13 23:57:14 +02:00
Donatas Abraitis
4c92d8188c doc: Add show bgp json detail command to print more verbose JSON output
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-13 22:06:34 +03:00
Donatas Abraitis
f280c93b11 bgpd: Add show bgp json detail command
Print detailed version for JSON output when dumping ALL BGP table with
`show bgp <afi> <safi> json detail`.

This output should be at some sort of identical to show_ip_bgp_route_cmd.

To avoid breaking backward-compatibility for `show bgp json`, adding
'detail' keyword for that.

In long-term it's easier for operators to compare stuff just looking at global
view instead of per-prefix for details.

Before:

```
],"192.168.100.1/32": [
  {
    "valid":true,
    "bestpath":true,
    "selectionReason":"First path received",
    "pathFrom":"external",
    "prefix":"192.168.100.1",
    "prefixLen":32,
    "network":"192.168.100.1\/32",
    "metric":0,
    "weight":32768,
    "peerId":"(unspec)",
    "path":"",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"0.0.0.0",
        "hostname":"exit1-debian-9",
        "afi":"ipv4",
        "used":true
      }
    ]
  }
] }  }
```

After:
```
],"192.168.100.1/32": [
  {
    "aspath":{
      "string":"Local",
      "segments":[
      ],
      "length":0
    },
    "origin":"incomplete",
    "metric":0,
    "weight":32768,
    "valid":true,
    "sourced":true,
    "bestpath":{
      "overall":true,
      "selectionReason":"First path received"
    },
    "lastUpdate":{
      "epoch":1618040124,
      "string":"Sat Apr 10 07:35:24 2021\n"
    },
    "nexthops":[
      {
        "ip":"0.0.0.0",
        "hostname":"exit1-debian-9",
        "afi":"ipv4",
        "metric":0,
        "accessible":true,
        "used":true
      }
    ],
    "peer":{
      "peerId":"0.0.0.0",
      "routerId":"192.168.100.1"
    }
  }
] }  }
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-13 22:06:32 +03:00
Jafar Al-Gharaibeh
d75213d260
Merge pull request #8153 from reubendowle/nhrp-multicast
nhrp, ospf: add nhrp multicast for OSPF DMVPN
2021-04-13 12:49:28 -05:00
Russ White
0ae24ff566
Merge pull request #8414 from idryzhov/fix-filter-cli
various acl/plist cli fixes
2021-04-13 11:38:51 -04:00
Russ White
a9d5dbe34b
Merge pull request #8431 from ton31337/feature/show_bgp_version_per_prefix
bgpd: Add `show bgp version <version>` command
2021-04-13 11:33:22 -04:00
Quentin Young
54bb4ab3ec
Merge pull request #8426 from idryzhov/fix-interface-nb-stale-pointers
lib: fix interface nb stale pointers
2021-04-13 15:26:51 +00:00
Mark Stapp
f3dbd9d3ef
Merge pull request #8145 from pguibert6WIND/nhrp_use_zebra
nhrp: use zebra
2021-04-13 08:02:56 -04:00
Philippe Guibert
88217099de zebra, lib: replace ZEBRA_ROUTE_NEIGH with simplified version
do not add a new route type, and consider 0 as a value meaning
that zebra should be the owner.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-13 08:58:54 +02:00
Philippe Guibert
a8807299ef nhrpd: remove useless typedef
this typedef was useless. remote it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-13 08:58:54 +02:00