Commit Graph

12858 Commits

Author SHA1 Message Date
Renato Westphal
91e5b43ab4 lib, vtysh: fix inconsistent interface commands in vtysh
The definition of the interface commands in vtysh.c were outdated.
Currently, all daemons that call if_cmd_init() will have the "no interface
IFNAME" command and the "[no] description" commands as well, so there's
no need to define exceptions for these commands anymore.

To fix this, make extract.pl parse the if.c file so that vtysh can get the
interface commands from there automatically. Only the "interface IFNAME
[vrf NAME]" must be kept in vtysh.c because it changes the vty node and
thus needs special treatment.

Finally, make pimd and pbrd display interface descriptions on "sh run"
when they are configured.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-13 18:59:31 -03:00
Renato Westphal
34c4627457 lib, vtysh: fix inconsistent VRF commands in vtysh
* Only zebra and pimd call vrf_cmd_init(), so these are the only daemons
  that should receive VRF commands from vtysh;
* "netns NAME" and "no netns NAME" are available only in zebra, write
  custom DEFSHs in vtysh to make it aware of that;
* Remove the "no vrf NAME" definition from vtysh.c and expose the
  original command to vtysh by converting the DEFUN_NOSH to a simple
  DEFUN. This command doesn't change the vty node so there's no need to
  special case it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-13 18:59:31 -03:00
Renato Westphal
1e9d118345 zebra: fix "no pseudowire IFNAME" on vtysh
We must hide only "pseudowire IFNAME" from vtysh, the "no" form of the
command should be made available to the extract.pl script. Split the
command into two to fix this problem.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-13 18:59:31 -03:00
Renato Westphal
281bd4dddf ldpd: use DEFPY_NOSH whenever possible
All ldpd commands were written using DEFPY except the ones that needed
to be ignored by vtysh, in which case we were using DEFUN_NOSH. Now that
DEFPY_NOSH is available, convert the remaining commands for consistency
and to simplify the code a little bit.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-13 18:59:31 -03:00
Renato Westphal
26d19c83b4 lib: implement DEFPY_NOSH
This is the DEFPY equivalent of DEFUN_NOSH.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-13 18:59:31 -03:00
Renato Westphal
cd02856824 babeld: avoid reading the configuration file twice
The frr_config_fork() function called by all FRR daemons during
initialization already takes care of reading the startup configuration
file.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-13 18:59:31 -03:00
Renato Westphal
9ea82f28d4 lib: add listnode_add_head()
Provide a new convenience function that adds an element to the beginning
of a list.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-13 18:59:31 -03:00
Martin Winter
138aa674c2 snapcraft: Add new staticd to snap package
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-08-13 14:55:59 -07:00
Martin Winter
45d005874e vtysh: Fix missing tailing / in --config_dir option parsing
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-08-13 14:55:59 -07:00
Renato Westphal
4373435488 zebra: remove unguarded debugging leftovers
These debug messages were committed by accident.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-13 18:53:45 -03:00
David Lamparter
27982ebc9d
Merge pull request #2830 from pacovn/Coverity_1221459_revert
ospf6d: revert fix for Coverity 1221459
2018-08-13 21:05:34 +02:00
Quentin Young
cd22c8ca74
Merge pull request #2820 from opensourcerouting/err-prep
remove alloc return value checks + minor babeld cleanup
2018-08-13 14:56:56 -04:00
F. Aragon
e26253c08b
ospf6d: revert fix for Coverity 1221459
The correction in commit 7edb6aa (PR #2502) was wrong, as it is was not
taking in consideration the unlock counter. Thanks to @eqvinox for noticing
it.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-08-13 19:46:56 +02:00
Quentin Young
5487152318
Merge pull request #2827 from pacovn/Coverity_1472310_Unchecked_return_value
bgpd: return value check (Coverity 1472310)
2018-08-13 13:22:17 -04:00
Rafael Zalamena
9af533f1d9
Merge pull request #2828 from pacovn/Coverity_1472311_null_check
staticd: null check (Coverity 1472311)
2018-08-13 14:09:31 -03:00
David Lamparter
a8c96c10bd
Merge pull request #2825 from dslicenc/frr-reload-vni
tools: correct frr-reload.py handling of bgp vni/exit-vni config
2018-08-13 19:04:52 +02:00
David Lamparter
6229137f6b
Merge pull request #2824 from vishaldhingra/reg_case
peer_delete did not trigger ZEBRA_NEXTHOP_UNREGISTER to ZEBRA
2018-08-13 19:04:13 +02:00
vivek
148b548c65 bgpd: Check for L3VNI before sending RMAC/L3 RTs
Ensure that the presence of L3VNI is checked before we generate
Router MAC and L3 Route Target extended communities. Without this
check, the router would send an all-zeros RMAC in some situations,
which may cause problems for receivers.

Ticket: CM-21014
Testing Done:
a) Verification of failed scenario
b) Interop verification by Scott Laffer
c) evpn-smoke

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-08-13 12:31:26 -04:00
F. Aragon
45b28d099c
staticd: null check (Coverity 1472311)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-08-13 18:10:09 +02:00
F. Aragon
4d8405699e
bgpd: return value check (Coverity 1472310)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-08-13 18:05:42 +02:00
vishaldhingra
d5c4bac937 peer_delete did not trigger ZEBRA_NEXTHOP_UNREGISTER to ZEBRA
bgp_unlink_nexthop_check() PEER should be NULL and bgp_info list count should be 0

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2018-08-12 00:20:17 -07:00
Martin Winter
7e5a886a0b doc: Add missing flowspec.rst to distribution tar file
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-08-11 16:39:35 -07:00
Donald Sharp
e8c8f2e064 babeld: Use enum instead of #defines for kernel route type information
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-11 19:58:23 +02:00
Donald Sharp
1314370166 tests: Cleanup assumption that ALLOC could fail.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-11 19:58:23 +02:00
Donald Sharp
5cecdba9d1 lib: Remove memory check test
Found a missed memory check test that can just be removed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-11 17:14:58 +02:00
Quentin Young
aad95a7dc2 ripd: re-add check for rip_create fail
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-11 17:14:58 +02:00
Donald Sharp
0ce1ca805d *: ALLOC calls cannot fail
There is no need to check for failure of a ALLOC call
as that any failure to do so will result in a assert
happening.  So we can safely remove all of this code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-11 17:14:58 +02:00
Quentin Young
1408cdfc07
Merge pull request #2809 from opensourcerouting/routemap-rpki-fix
bgpd: Fix bgp rpki to match route-map update from PR #2697
2018-08-10 16:42:37 -04:00
David Lamparter
7aea4b8167 tools/checkpatch: fix some bogus macro warnings
checkpatch was throwing an error for "#define FOO , bar"

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-10 20:46:35 +02:00
Don Slice
d60f480010 tools: correct frr-reload.py handling of bgp vni/exit-vni config
Problem reported that when a peer-group was added in certain
configurations, it would be rejected because of the order of the
commands put in by nclu. Issued turned out to be how frr-reload.py
was handling the sub-sub-context of the vni under the address-family
and subsequently how it handled the following exit-vni.

Ticket: CM-21996
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-10 09:59:24 -07:00
David Lamparter
0a62b87392 doc: add "show memory" user documentation
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-09 22:53:08 +02:00
Quentin Young
7a07a176cf
Merge pull request #2806 from opensourcerouting/vty-term-fd
lib: fix "-t" command line option
2018-08-09 12:43:02 -04:00
David Lamparter
53741000f2
Merge pull request #2812 from manuhalo/fix-staticd-coverity
staticd: Fix null pointer access (coverity 1472311)
2018-08-09 15:40:21 +02:00
Emanuele Di Pascale
bacd8eea47 staticd: Fix null pointer access (coverity 1472311)
Aded a check to ensure that if_is_vrf() is not called on a NULL if pointer.
Incidentally this was causing PR #2805 to fail.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-08-09 14:26:55 +02:00
Chirag Shah
5cc359b232 bgpd: print evpn nd ext community in route
Route [2]:[0]:[0]:[48]:[00:02:00:00:00:0e]:[128]:[2001:fee1::a] VNI
1000
   4435 5551
27.0.0.16 from MSP1(uplink-1) (27.0.0.9)
   Origin IGP, valid, external
   Extended Community: RT:5551:1000 ET:8 ND: Router
   Flag
   AddPath ID: RX 0, TX 1125
   Last update: Thu Aug  9 04:31:37 2018

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-08-08 21:45:37 -07:00
Renato Westphal
359b4722b3
Merge pull request #2807 from mjstapp/configure_help_fixes
configure.ac : fix help text
2018-08-08 22:01:50 -03:00
Martin Winter
898c4e6621 bgpd: Fix bgp rpki to match route-map update from PR #2697
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-08-08 15:08:22 -07:00
Rafael Zalamena
64dc4b2d7a bgpd/ospf(6)d/pimd: hide BFD commands with timers
Don't show BFD commands with timers since it might confuse users
("show running-config" won't display timers in client daemons anymore),
but keep accepting this command from previous configurations.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
43adc702e1 bfdd: fix IPv6 peers using link-local address
When using link-local address we must specify the scope-id for the
address in order to bind to the interface.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
788378fefa bfdd: clean-up bfd clients data on shutdown
On `zebra` / `bfdd` shutdown we now clean up all client data to avoid
memory leaks (ghost clients). This also prevents 'slow' shutdown on
`zebra` sparing us from seeing some rare topotests shutdown failures
(signal handler getting stopped by signal).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
03e7f08881 bfdd: improve logging messages
Show a little more details, remove some duplicated calls and remove the
macro compatibility with old debugging functions.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
6ed8494935 bfdd: clean up header inclusion
Most of the headers we need are included by zebra.h, so lets simplify
this.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
9d63adda98 bfdd: code refactory for simplification
Simplify code and remove unnecessary log messages. The old log messages
are going to be shown by the caller anyway.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
a375de5c46 bfdd: free zebra clients data on unregistration
Avoid a memory leak on client daemons restart by getting rid of old
registrations.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
971532e2e7 bfdd: send replay request on zebra connection
This will make `bfdd` synchronize with its client when zebra dies or
bfdd is restarted.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
f85498ef0a bfdd: show single hop local-address
Show local-address on single hop when configured.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
d3f3a2c4dc bfdd: smooth configuration transition
After configuring a new value set the polling bit to negotiate speeds
again next transmission cycle.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
674680df69 bfdd: show the correct transmission speed
When configured transmission speed doesn't match the actual speed, show
the difference in the output.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Rafael Zalamena
c44032c1ff bfdd: add documentation
Add BFD daemon documentation:
* commands;
* man page;
* manual / description;

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:04 -03:00
Rafael Zalamena
a0841732ab bgpd/ospf(6)d/pimd: don't show BFD timers
When BFD timers are configured, don't show it anymore in the daemon
side. This will help us migrate the timers command from daemons to
`bfdd`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:04 -03:00