Commit Graph

19747 Commits

Author SHA1 Message Date
Donald Sharp
abe94d6562
Merge pull request #6298 from opensourcerouting/build-assorted-20200423
build: spring cleaning
2020-04-27 09:06:19 -04:00
Mark Stapp
97cfd5d207 doc: fix typo in archlinux doc
Fix a typo to remove a warning when building the dev
docs.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-27 08:47:34 -04:00
Donatas Abraitis
7d16d76f4c lib: Delete the entire access-list only if there are no more entries
When you enter the access-list with the same sequence number but with a
different prefix AND access-list has only a single entry, then the entry
is deleted and the whole access-list is deleted.

That means that "replace entry" never be re-inserted.

With fix:
```
~# vtysh -c 'c' -c 'access-list 1 seq 10 permit 127.0.0.10/32'
~# vtysh -c 'sh run' | grep access-list
access-list 1 seq 10 permit 127.0.0.10/32
~# vtysh -c 'c' -c 'access-list 1 seq 10 permit 127.0.0.20/32'
~# vtysh -c 'sh run' | grep access-list
access-list 1 seq 10 permit 127.0.0.20/32
~# vtysh -c 'c' -c 'access-list 1 seq 11 permit 127.0.0.11/32'
~# vtysh -c 'sh run' | grep access-list
access-list 1 seq 10 permit 127.0.0.20/32
access-list 1 seq 11 permit 127.0.0.11/32
~# vtysh -c 'c' -c 'no access-list 1 seq 10 permit 127.0.0.20/32'
~# vtysh -c 'sh run' | grep access-list
access-list 1 seq 11 permit 127.0.0.11/32
~#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-27 12:13:48 +03:00
Donatas Abraitis
7351b95754 lib: Convert access_list_empty to bool
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-27 12:13:04 +03:00
David Lamparter
209135f188 build: silence idiotic libtool warnings
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 10:02:11 +02:00
David Lamparter
bc76ad3f2d build: move python 2.x to the very last preference
Also try explicit 3.9 & 3.10.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:52:41 +02:00
David Lamparter
189be3996d bfdd: fix frr-format false warning
Dealing with PRIu64 is unfortunately a bit hacky in the frr-format
plugin, as in, it works correctly with snprintfrr, but breaks on plain
snprintf.  There's no good solution unfortunately :/.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:52:41 +02:00
David Lamparter
c2527ed21b lib/zlog: fix printfrr format attribute
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:52:41 +02:00
David Lamparter
7309092bf4 *: fix first header
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:52:41 +02:00
David Lamparter
980ab2de52 python: add check-first-header tool
The first #include statement in all FRR .c files should be either
zebra.h or config.h.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:52:41 +02:00
David Lamparter
94cfb0692e build: make clippy Makefile rules nicer
These are easy to get subtly wrong, and doing so can cause
nondeterministic failures when racing in parallel builds.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:52:41 +02:00
David Lamparter
ec8f987e91 tools/symalyzer: fix copypasta
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:30:01 +02:00
David Lamparter
879a9dc5cd python: move MakeVars class into separate module
... so I can reuse it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:30:01 +02:00
David Lamparter
2768748b88 build: use VPATH for vtysh_scan
No need to put $(top_srcdir) everywhere.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:30:01 +02:00
Rafael Zalamena
98dc08cdda
Merge pull request #6249 from chiragshah6/yang_nb5
lib: yang wrapper for date-and-time
2020-04-24 10:17:55 -03:00
Donatas Abraitis
9188c32faa tests: Adopt some tests to PfxSnt counter
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-24 15:35:24 +03:00
Donatas Abraitis
db92d22638 bgpd: Show PfxSnt for show bgp <afi> <safi> command
JSON output was already in, just printing in CLI as well.

```
root@exit1-debian-9:~# vtysh -c 'show bgp ipv4 summary'

IPv4 Unicast Summary:
BGP router identifier 10.10.10.1, local AS number 65001 vrf-id 0
BGP table version 100003
RIB entries 200005, using 37 MiB of memory
Peers 1, using 21 KiB of memory

... MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
...      64       157        0    0    0 00:01:18            0   100003

Total number of neighbors 1
```

JSON:

```
root@exit1-debian-9:~# vtysh -c 'show bgp ipv4 summary json' \ |
> jq '.ipv4Unicast.peers."192.168.0.2".pfxSnt'
100003
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-24 15:35:19 +03:00
Donald Sharp
967ebd2431
Merge pull request #6279 from opensourcerouting/nb-cb-args
*: change the signature of the northbound callbacks to be  more flexible
2020-04-24 08:09:16 -04:00
Donald Sharp
e0b029c65e
Merge pull request #6282 from opensourcerouting/fix-isisd-sh-run
isisd: fix display of "isis bfd" in the running configuration
2020-04-24 08:07:57 -04:00
Donald Sharp
5905ebf157
Merge pull request #6292 from ton31337/fix/revert_6277
Revert "bgpd: Show PfxSnt for `show bgp <afi> <safi>` command"
2020-04-24 08:05:09 -04:00
Olivier Dugeon
814f6fc80a
Merge pull request #6274 from mjstapp/fix_lde_blocking_sleep
ldpd: use a timer instead of sleeping in LM init
2020-04-24 09:34:27 +02:00
Donatas Abraitis
3525e23388 Revert "tests: Adopt some tests to PfxSnt counter"
This reverts commit 6e0f90413e.
2020-04-24 10:00:17 +03:00
Donatas Abraitis
9da4aaa36d Revert "bgpd: Show PfxSnt for show bgp <afi> <safi> command"
This reverts commit 776e7cf5ce.
2020-04-24 10:00:13 +03:00
Sri Mohana Singamsetty
7a54a2caf7
Merge pull request #6277 from ton31337/feature/show_bgp_afi_safi_sndpfx
bgpd: Show PfxSnt for `show bgp <afi> <safi>` command
2020-04-23 20:20:07 -07:00
David Lamparter
c334a16ef1
Merge pull request #6262 from qlyoung/remove-sprintf 2020-04-23 20:27:26 +02:00
Renato Westphal
05e4ec3798 isisd: fix display of "isis bfd" in the running configuration
Since this command is modeled using YANG, it's already displayed
as part of the call to nb_cli_show_dnode_cmds(). Calling the
'isis_circuit_config_write' hook was only making that command
to be displayed twice.

The aforementioned hook is still necessary for fabricd, which wasn't
converted to the new northbound model yet.

Fixes #6281.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-23 13:05:51 -03:00
Stephen Worley
e17316e56b
Merge pull request #6184 from kssoman/route
bgpd: When static default route is present in RIB and advertised to p…
2020-04-23 11:10:59 -04:00
Mark Stapp
9d694b0b01 ldpd: use a timer instead of sleeping in LM init
Stop sleeping if synchronous label-manager zapi session
has trouble during init: retry using a timer instead. Move
initial label-block request to a point where the LM zapi
session is known to be running. Remove the use of the
daemon 'instance' - we're using the session_id to distinguish
the LM zapi session.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-23 10:17:34 -04:00
Renato Westphal
60ee8be107 *: change the signature of the northbound callbacks to be more flexible
Having a fixed set of parameters for each northbound callback isn't a
good idea since it makes it difficult to add new parameters whenever
that becomes necessary, as several hundreds or thousands of existing
callbacks need to be updated accordingly.

To remediate this issue, this commit changes the signature of all
northbound callbacks to have a single parameter: a pointer to a
'nb_cb_x_args' structure (where x is different for each type
of callback). These structures encapsulate all real parameters
(both input and output) the callbacks need to have access to. And
adding a new parameter to a given callback is as simple as adding
a new field to the corresponding 'nb_cb_x_args' structure, without
needing to update any instance of that callback in any daemon.

This commit includes a .cocci semantic patch that can be used to
update old code to the new format automatically.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-23 10:14:32 -03:00
Donald Sharp
37a816b3a1
Merge pull request #6278 from opensourcerouting/cpp-extern-blocks
lib, zebra: add missing extern "C" {} blocks to new header files
2020-04-23 08:01:00 -04:00
Donatas Abraitis
6e0f90413e tests: Adopt some tests to PfxSnt counter
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-23 13:35:26 +03:00
Donatas Abraitis
776e7cf5ce bgpd: Show PfxSnt for show bgp <afi> <safi> command
JSON output was already in, just printing in CLI as well.

```
root@exit1-debian-9:~# vtysh -c 'show bgp ipv4 summary'

IPv4 Unicast Summary:
BGP router identifier 10.10.10.1, local AS number 65001 vrf-id 0
BGP table version 100003
RIB entries 200005, using 37 MiB of memory
Peers 1, using 21 KiB of memory

... MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
...      64       157        0    0    0 00:01:18            0   100003

Total number of neighbors 1
```

JSON:

```
root@exit1-debian-9:~# vtysh -c 'show bgp ipv4 summary json' \ |
> jq '.ipv4Unicast.peers."192.168.0.2".pfxSnt'
100003
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-23 11:48:14 +03:00
Donatas Abraitis
5e20fb8176
Merge pull request #6025 from patrasar/rp-info-igmp-group-json-fix
pimd: Modified rp-info json o/p
2020-04-23 11:05:06 +03:00
Renato Westphal
97cd849362 lib: create a wrapper function for all northbound callbacks
The intention here is to keep the code more organized. These wrappers
should be used by the northbound clients only, and never directly
by any YANG backend code.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-23 01:21:46 -03:00
Lou Berger
e252fc22b8
Merge pull request #6275 from donaldsharp/fix_frr
yang: Convert to `FRRouting` for organization
2020-04-22 23:49:41 -04:00
Renato Westphal
17e38209a5 lib, zebra: add missing extern "C" {} blocks to new header files
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-22 23:49:22 -03:00
Soman K S
f55c9a4653 bgpd: Configuring default-originate withdraws default route
Issue:
Configuring default-originate when static default route is previously
advertised results in withdrawal of the route.

Fix :
Delete the adj-out entry for the previously advertised static
default route without sending explicit withdraw message.

Signed-off-by: kssoman <somanks@gmail.com>
2020-04-22 22:34:12 +05:30
Quentin Young
86ac1facf3
Merge pull request #6242 from pguibert6WIND/flowspec_nlri_too_big
bgpd: handle fs nlri over 240 bytes
2020-04-22 13:02:50 -04:00
Quentin Young
c6615abb1a
Merge pull request #6272 from opensourcerouting/duplicated-fpm-doc
doc: remove duplicated command documentation
2020-04-22 13:01:47 -04:00
Donald Sharp
78891caff6 yang: Convert to FRRouting for organization
We should be using `FRRouting` as our organization.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-22 12:45:37 -04:00
Quentin Young
cd3b8cdf0a
Merge pull request #6265 from patrasar/pim-yang
yang: Defining yang files for pim
2020-04-22 12:43:02 -04:00
Sarita Patra
da787004cc yang: Defining yang files for pim
Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-04-22 09:21:28 -07:00
Chirag Shah
8d0c8ff55a lib: yang wrapper for date-and-time
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-22 08:55:07 -07:00
Russ White
e4306dc695
Merge pull request #5944 from donaldsharp/vrf_stoppage
Vrf stoppage
2020-04-22 11:35:53 -04:00
Sarita Patra
ac8e400cd9 pimd: Added a new field "rpAddress" in "show ip pim rp-info json
Fix: Added a new field "rpAddress" in "show ip pim rp-info json"
Before:
"40.0.0.2":[
    {
      "outboundInterface":"ens224",
      "group":"224.0.0.0\/4",
      "source":"Static"
    }
After:
"40.0.0.2":[
    {
      "rpAddress":"40.0.0.2",
      "outboundInterface":"ens224",
      "group":"224.0.0.0\/4",
      "source":"Static"
    }

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-04-22 08:12:24 -07:00
Donald Sharp
5e0311982a zebra: Prevent awful misconfiguration in vrf's
Currently the linux kernel allows you to specify the same
table id -> multiple vrf's.  While I am arguing with
the kernel people about proper behavior here let's
just remove this as a possiblity from happening and
mark it a zebra stopable misconfiguration.

(Effectively we are preventing a crash down the line
as that all over FRR we assume it's a unique
mapping not a many to one).

Why fail hard?  Because we hope to get the person
who misconfigured it to actually notice immediately
not hours or days down the line when shit hits the fan.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-22 10:57:29 -04:00
Donald Sharp
9d866c07c8 zebra: Expose vrf lookup by table id out of rt_netlink.c
The function rt_netlink.c is using to lookup the vrf by
passed in table id.

I'm also going to pretend that this function is not
so awful to run when we have a large number of routes
incoming.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-22 10:56:06 -04:00
Rafael Zalamena
6d8589daea doc: improve FPM clear command doc
Use the old description as it looks more complete than the current.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-22 10:46:18 -03:00
Rafael Zalamena
026f7db453 doc: remove duplicated command documentation
Fixes a documentation warning during compilation.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-22 10:32:06 -03:00
Donatas Abraitis
0f90b81558
Merge pull request #6269 from donaldsharp/coverity_likes_coverity
Coverity likes coverity
2020-04-22 16:16:57 +03:00