Commit Graph

15063 Commits

Author SHA1 Message Date
Renato Westphal
f24f3450c9 pbrd: fix removal of ipv6 nexthops
Fix bug in the code that compares IPv6 addresses. If memcmp()
returns 0 then the two addresses are equal.

Because of this problem, hash_release() could return NULL in a few
places, leading to the following crashes (found by the CLI fuzzer):
pbrd aborted: vtysh -c "configure terminal" -c "pbr-map WORD seq 100" -c "no set nexthop 2001:db8::1"
pbrd aborted: vtysh -c "configure terminal" -c "nexthop-group NHGROUP" -c "no nexthop 2001:db8::1"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-20 23:04:12 -03:00
Donald Sharp
7f9adc7c67 lib: Allow DEFPY_HIDDEN to exist in vtysh
The DEFPY_HIDDEN commands were not being picked up
into vtysh.  Fix this issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-20 19:26:15 -05:00
Donald Sharp
70fd22bd03 pimd: Add 'test pim keepalive-reset A.B.C.D A.B.C.D' command
Add a test command to pim that allows you to reset the keepalive timer
for an upstream to it's max value.  This is to allow purposeful testing
of cleanup code in pim, by forcing the keeaplive timer to expire later.

robot# show ip pim upstream
Iif       Source          Group           State       Uptime   JoinTimer RSTimer   KATimer   RefCnt
enp3s0    192.168.201.136 225.1.0.0       NotJ,RegP   00:00:10 00:00:52  00:00:25  00:02:54       1
robot# show ip pim upstream
Iif       Source          Group           State       Uptime   JoinTimer RSTimer   KATimer   RefCnt
enp3s0    192.168.201.136 225.1.0.0       NotJ,RegP   00:00:11 00:00:51  00:00:24  00:02:53       1
robot# test pim keep 192.168.201.136 225.1.0.0
Setting (192.168.201.136,225.1.0.0) to current keep alive time: 210
robot# show ip pim upstream
Iif       Source          Group           State       Uptime   JoinTimer RSTimer   KATimer   RefCnt
enp3s0    192.168.201.136 225.1.0.0       NotJ,RegP   00:00:27 00:00:35  00:00:08  00:03:27       1
robot#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-20 19:26:05 -05:00
Sri Mohana Singamsetty
e60eb780e4 FRR: Python script to generate support bundle for FRR
This has a python script that helps in collecting various CLI show command outputs in an automated way.

This commit has two files.

1.Text Configuration file: support_bundle_commands.conf - This file has list of CLI show commands to be executed. This file will be in tools/etc/frr/ directory. On executing command "sudo install -m 644 tools/etc/frr/ support_bundle_commands.conf /etc/frr/support_bundle_commands.conf", as part of FRR installation, this file will be copied into /etc/frr directory.

2.Python script file: generate_support_bundle.py - This file has the python code that has the below functionality.
  * It reads the support_bundle_commands.conf file. For each process present in the conf file, it creates a support_bundle file. For example, it creates bgp_support_bundle.log file for BGP and zebra_support_bundle.log file for Zebra. These files will be created in /var/log/frr/ directory. This is where regular FRR log files are also stored currently.
  * The script reads the CLI command specified between CLI_START and CLI_END key words for each process. It will execute the commands one by one.
  * For each such command, the script also appends the current time stamp at which the CLI command is executed.
  * In case of successful execution of the CLI command, it will copy the CLI output into the above support bundle file.
  * In case of CLI command failure, it will capture the error thrown and the error is also written into the same file.
  * A small snippet of the output file is as below.

  >>[2019-01-02 13:55:23.318987]show bgp summary

  IPv4 Unicast Summary:
  BGP router identifier 203.0.113.1, local AS number 65000 vrf-id 0
  BGP table version 4
  RIB entries 7, using 1176 bytes of memory
  Peers 1, using 21 KiB of memory
  Peer groups 1, using 64 bytes of memory

  Neighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
  203.0.113.2     4      65001      34      34        0    0    0 00:29:47            2

  Total number of neighbors 1
  >>[2019-01-02 13:55:23.619953]show ip bgp

  BGP table version is 4, local router ID is 203.0.113.1, vrf id 0
  Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
                 i internal, r RIB-failure, S Stale, R Removed

Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
2019-02-20 11:56:22 -08:00
Renato Westphal
c06c9ded21
Merge pull request #3835 from qlyoung/build-update-libyang-doc-link
build: update doc link for libyang warning
2019-02-20 15:14:03 -03:00
Martin Winter
831dd62a87 redhat: Require newer libyang (> 0.16.74) for embedded extensions
The support of embedded extensions doesn't allow to build the
RPM with and without (for older version). Require new version of
Lbyang with embedded extensions supported

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2019-02-20 05:09:03 -08:00
David Lamparter
d09b51d127 bgpd: make valgrind suppression more generic
No point in restriction the suppression that far down the call stack.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 22:00:34 +01:00
David Lamparter
591f57cff3 lib: yang: use common yang_ctx_new_setup()
After creating a libyang context, we need to hook up our callback to use
embedded built-in modules.  I hadn't added this to the yang translator
code.

Also, ly_ctx_new fails if the search directory doesn't exist.  Since
that's not a hard error for us, work around that and ignore inaccessible
YANG_MODELS_DIR.  (This is needed for snap packages.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:41:39 +01:00
David Lamparter
195f215cfc tools: fix new init script wrt. multi-instance
TBH when I looked at watchfrr I didn't see any MI support and hence
assumed this just didn't work to begin with.  However, it actually does
(transparently to watchfrr, by just using "ospfd-1" as daemon name.)

So, fix this up and make it work again.

(Also remove 2 extraneous \n in messages.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:38:23 +01:00
David Lamparter
bd2893d57f doc: update for new daemons settings
watchfrr_enable is ignored, watchfrr_options is unneeded and the
valgrind options have been replaced with daemon_wrap/all_wrap.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:38:23 +01:00
David Lamparter
3ec9556728 watchfrr: build in defaults for -r/-s/-k
There's no good reason to not have these options default to the
installation path of tools/watchfrr.sh.  Doing so allows us to ditch
watchfrr_options from daemons/daemons.conf completely.

Fixes: #3652
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:31 +01:00
David Lamparter
ae132a9497 debian: remove superseded systemd lintian override
This was fixed in f351f5f971.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:27 +01:00
David Lamparter
c4266cb65d debian: update libyang dependency to >= 0.16.74
We're using builtin extension loading, so we need libyang 0.16.74.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:24 +01:00
David Lamparter
82ab1fc506 debian: fix autopkgtest
pgrep is in procps, which is an essential package.  killall is in
psmisc, which isn't.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:10 +01:00
David Lamparter
01b5725bf7 debian: add missing Conflicts:
We were missing several Conflicts: (or Breaks:) lines.  Specifically,
- the .png diagrams in frr-doc conflict with quagga-doc
- the quagga package was split up and we conflict on each on the
  daemon's man pages
- pimd also conflicts on the man page.

This is a "conservative" fix for the time being, putting everything into
Conflicts:.  Some of these might have other options to fix them (e.g.
renaming the diagrams or man pages) but that needs more thought and
isn't appropriate for a simple fix.

There is also the "layer 9" consideration of whether to add "Replaces:
quagga" lines.  For the time being I'd say it's a bit early to have that
discussion.

Reported-by: Andreas Beckmann <anbe@debian.org>
References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=921376
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:09 +01:00
David Lamparter
75ec70d358 debian: remove bogus libjson0 dependency
Dependencies for the actual library packages are autogenerated by shlib
handling.  Removing the bogus line should hopefully get this to build
on Debian buildd...

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:09 +01:00
David Lamparter
4c3d9ff53a debian: extend comments on pre/postinst hooks
While originally created to support upgrading within non-official
previous FRR packages, the same logic makes upgrading from Quagga
configs more straightforward.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:09 +01:00
David Lamparter
1bc91be4b8 tools/tarsource.sh: deal with AC_INIT []
configure.ac got cleaned up, now there's [] around the version number.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:08 +01:00
David Lamparter
4734c22a4f tools/tarsource.sh: support FRR as a git submodule
a git submodule will have .git as a file instead of a directory... which
breaks tarsource.sh.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:08 +01:00
David Lamparter
a945249532 debian: add libyang-dev dependency
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:08 +01:00
Martin Winter
9ada5eadc6 debian: Don't create homdirectory for frr user
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2019-02-19 21:34:08 +01:00
Martin Winter
f6ff9aa59e doc: Fix path and order in debian package build doc
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2019-02-19 21:34:08 +01:00
David Lamparter
8209fe7988 debian/control: add python3-dev dependency
Just forgot to list this one.  libpython3 is not enough.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:08 +01:00
David Lamparter
380fe10b16 tools: don't watch nonexistent daemons
If we try to monitor a nonexisting daemon in watchfrr, it will
(currently) forever wait at startup since the vty connection will never
come up.  Just drop the daemon from the daemon list in such a case.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:08 +01:00
David Lamparter
5c9d1c83a8 watchfrr: don't wait forever at startup
If we wait forever for all daemons to come up, we can hang the entire
boot process, especially on init.d based systems.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:08 +01:00
David Lamparter
58b1c7b653 debian: fix dropping daemons.conf
Need to apply some manual control here, so remove it from frr.install
and just do it in rules.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:07 +01:00
David Lamparter
aaabb66e4a debian: rework autopkgtests
Ditch the old non-working one and add 3 new ones to check:
- that zebra can talk to the kernel at least somewhat
- that SNMP and RPKI modules can be loaded
- that frr-reload.py works

This should catch most build environment SNAFUs.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:07 +01:00
David Lamparter
6b37587791 tools/tarsource.sh: keep version info on non-git
extraver won't have any useful value on a non-git run.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:06 +01:00
David Lamparter
3e662ed3f1 tools: update build-debian-package.sh
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:06 +01:00
David Lamparter
f673b4f640 debian: keep working nicely with split config
Drop our configs that say integrated config when there is some
pre-existing split config.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:06 +01:00
David Lamparter
d29f324aa8 debian: chop down & rework maintainer scripts
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:06 +01:00
David Lamparter
8a91a6ef9c debian: add python3-pytest build dependency
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:32:19 +01:00
David Lamparter
3f406e3f8e tools/tarsource.sh: fix GZIP_ENV
Some older versions of Automake don't escape this properly.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:32:19 +01:00
David Lamparter
c9d06c3b06 debian: drop unused lintian overrides
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:32:18 +01:00
David Lamparter
0d60efd879 debian: full & proper copyright file
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:32:18 +01:00
David Lamparter
6fb8901930 debian: flag as "no stop on upgrade"
We don't want to break some user's internet routing that they're using
for their ssh login while upgrading...

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:32:18 +01:00
David Lamparter
443b605e76 doc/developer: document new Debian packaging
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:32:18 +01:00
David Lamparter
f35d0a76d3 debian: don't install ssd & daemons.conf
ssd is unused and duplicates a system tool.  daemons.conf is deprecated.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:31:19 +01:00
David Lamparter
74afa5e686 debian: cleanly split off from dist tarball
The debian/ directory is distributed separately for tarballs in 3.0
(quilt) format.  Including it in the dist tarball causes problems with
automake when the separately distributed debian directory is unpacked on
top of the dist tarball;  the clean and correct thing to do here is to
not include the debian/ directory in dist tarballs.

Users have two choices for building FRR Debian packages:
- build straight off git
- build from a "frr.tar" + "frr-debian.tar"

The tarsource.sh tool does the right thing when invoked with the -D
("Debian") option.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:31:18 +01:00
David Lamparter
081253fcd5 tools/tarsource.sh: create debian changelog
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:31:18 +01:00
David Lamparter
cf3ae51c88 debian: fix up for new initscripts
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:31:18 +01:00
David Lamparter
4741497b94 debian: clean up debian/ directory for git build
Running `dpkg-buildpackage` with source-format "git" complains about
newly created files under debian/.  Remove the build-created frr.init &
frr.service to avoid the build erroring out due to this.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:31:18 +01:00
David Lamparter
fbeed19878 doc: drop deprecated Ubuntu 12.04 docs
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:31:18 +01:00
David Lamparter
b3c4c164b5 debian: make package "official"
Move us into place in debian/

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:30:54 +01:00
David Lamparter
93b389bb9e debian: move changelog out of the way
The official Debian package will have a manually maintained changelog in
place of the symlink.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:30:53 +01:00
David Lamparter
98b429c40b debianpkg: fill in changelog proper
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:30:53 +01:00
David Lamparter
ff52c7d8a5 debianpkg: restrict to linux-any
We don't support GNU/Hurd, and we haven't tested Debian kFreeBSD.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:30:53 +01:00
David Lamparter
dda2f3eb42 debianpkg: enable FPM (w/o protobuf)
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:30:53 +01:00
David Lamparter
600db12aa1 debianpkg: enable rtrlib by default
librtr is in Debian unstable now, so this should default on.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:30:53 +01:00
David Lamparter
452a48cfab debianpkg: cut down unneeded bits
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:30:52 +01:00