]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
6 years agodebian: add python3-pytest build dependency
David Lamparter [Fri, 14 Dec 2018 16:09:15 +0000 (17:09 +0100)]
debian: add python3-pytest build dependency

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agotools/tarsource.sh: fix GZIP_ENV
David Lamparter [Fri, 14 Dec 2018 15:59:51 +0000 (16:59 +0100)]
tools/tarsource.sh: fix GZIP_ENV

Some older versions of Automake don't escape this properly.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebian: drop unused lintian overrides
David Lamparter [Fri, 14 Dec 2018 15:40:30 +0000 (16:40 +0100)]
debian: drop unused lintian overrides

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebian: full & proper copyright file
David Lamparter [Fri, 14 Dec 2018 13:58:10 +0000 (14:58 +0100)]
debian: full & proper copyright file

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebian: flag as "no stop on upgrade"
David Lamparter [Thu, 13 Dec 2018 17:50:15 +0000 (18:50 +0100)]
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>
6 years agodoc/developer: document new Debian packaging
David Lamparter [Thu, 25 Oct 2018 20:28:49 +0000 (22:28 +0200)]
doc/developer: document new Debian packaging

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebian: don't install ssd & daemons.conf
David Lamparter [Wed, 12 Dec 2018 21:50:56 +0000 (22:50 +0100)]
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>
6 years agodebian: cleanly split off from dist tarball
David Lamparter [Fri, 14 Dec 2018 15:08:25 +0000 (16:08 +0100)]
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>
6 years agotools/tarsource.sh: create debian changelog
David Lamparter [Mon, 10 Dec 2018 23:18:12 +0000 (00:18 +0100)]
tools/tarsource.sh: create debian changelog

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebian: fix up for new initscripts
David Lamparter [Mon, 10 Dec 2018 23:03:17 +0000 (00:03 +0100)]
debian: fix up for new initscripts

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebian: clean up debian/ directory for git build
David Lamparter [Mon, 10 Dec 2018 21:46:55 +0000 (22:46 +0100)]
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>
6 years agodoc: drop deprecated Ubuntu 12.04 docs
David Lamparter [Wed, 12 Dec 2018 00:32:17 +0000 (01:32 +0100)]
doc: drop deprecated Ubuntu 12.04 docs

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebian: make package "official"
David Lamparter [Mon, 10 Dec 2018 21:34:49 +0000 (22:34 +0100)]
debian: make package "official"

Move us into place in debian/

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebian: move changelog out of the way
David Lamparter [Fri, 7 Dec 2018 21:33:57 +0000 (22:33 +0100)]
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>
6 years agodebianpkg: fill in changelog proper
David Lamparter [Thu, 25 Oct 2018 14:56:09 +0000 (16:56 +0200)]
debianpkg: fill in changelog proper

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: restrict to linux-any
David Lamparter [Mon, 10 Dec 2018 20:53:23 +0000 (21:53 +0100)]
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>
6 years agodebianpkg: enable FPM (w/o protobuf)
David Lamparter [Mon, 10 Dec 2018 21:17:01 +0000 (22:17 +0100)]
debianpkg: enable FPM (w/o protobuf)

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: enable rtrlib by default
David Lamparter [Mon, 10 Dec 2018 21:15:22 +0000 (22:15 +0100)]
debianpkg: enable rtrlib by default

librtr is in Debian unstable now, so this should default on.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: cut down unneeded bits
David Lamparter [Mon, 29 Oct 2018 17:56:30 +0000 (18:56 +0100)]
debianpkg: cut down unneeded bits

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: install libraries to /usr/lib64/frr
David Lamparter [Sun, 28 Oct 2018 17:54:14 +0000 (18:54 +0100)]
debianpkg: install libraries to /usr/lib64/frr

This makes them "private libraries" (which they are, since we don't
maintain a proper versioned ABI on libfrr.)  This also properly fixes
another few lintian warnings.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: fix remaining lintian warnings
David Lamparter [Sun, 28 Oct 2018 16:53:36 +0000 (17:53 +0100)]
debianpkg: fix remaining lintian warnings

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: include docs and register with doc-base
David Lamparter [Sun, 28 Oct 2018 15:58:24 +0000 (16:58 +0100)]
debianpkg: include docs and register with doc-base

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: rewrite description texts
David Lamparter [Sun, 28 Oct 2018 16:42:28 +0000 (17:42 +0100)]
debianpkg: rewrite description texts

...to actually document what is in each of the subpackages.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: update copyright file
David Lamparter [Sun, 28 Oct 2018 01:14:10 +0000 (02:14 +0100)]
debianpkg: update copyright file

Extracted from git history with a bit of polish applied.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: update debhelper dependency
David Lamparter [Fri, 26 Oct 2018 12:30:54 +0000 (14:30 +0200)]
debianpkg: update debhelper dependency

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: add & document lintian overrides
David Lamparter [Thu, 25 Oct 2018 18:44:42 +0000 (20:44 +0200)]
debianpkg: add & document lintian overrides

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: make URLs https
David Lamparter [Thu, 25 Oct 2018 18:33:51 +0000 (20:33 +0200)]
debianpkg: make URLs https

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: fix whitespace
David Lamparter [Thu, 25 Oct 2018 17:44:00 +0000 (19:44 +0200)]
debianpkg: fix whitespace

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: drop superfluous control entries
David Lamparter [Thu, 25 Oct 2018 17:41:21 +0000 (19:41 +0200)]
debianpkg: drop superfluous control entries

Some header lines are duplicate and unneccessary, and the entire frr-dbg
package doesn't need an entry in control (it's autogenerated.)

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: update maintainer
David Lamparter [Thu, 25 Oct 2018 17:39:32 +0000 (19:39 +0200)]
debianpkg: update maintainer

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: use set -e in maintscripts
David Lamparter [Thu, 25 Oct 2018 17:34:05 +0000 (19:34 +0200)]
debianpkg: use set -e in maintscripts

Fixes maintainer-script-without-set-e Lintian warning.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: add -0 to version
David Lamparter [Tue, 23 Oct 2018 11:55:36 +0000 (13:55 +0200)]
debianpkg: add -0 to version

We need a -something suffix since otherwise part of our version number
(e.g. -dev or -DATE) will get taken as Debian sub-version.  (Everything
after the last -)

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: add watch file
David Lamparter [Thu, 25 Oct 2018 16:22:14 +0000 (18:22 +0200)]
debianpkg: add watch file

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: change frr-pythontools dep to python3
David Lamparter [Thu, 25 Oct 2018 16:17:23 +0000 (18:17 +0200)]
debianpkg: change frr-pythontools dep to python3

The shebang can't be both at the same time;  since python2 is going to
be removed from Debian soon let's just stick with python3.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: fix install for {frr,rfptest,ospfclient}
David Lamparter [Thu, 25 Oct 2018 14:21:35 +0000 (16:21 +0200)]
debianpkg: fix install for {frr,rfptest,ospfclient}

The frr init script is always installed to /usr/lib/frr/frr because
watchfrr setups expect to have it there.

The rfptest and ospfclient binaries are not installed since they are
testing/development tools that don't have an user function.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: install HTML docs, drop tools/
David Lamparter [Thu, 25 Oct 2018 14:09:21 +0000 (16:09 +0200)]
debianpkg: install HTML docs, drop tools/

No reason not to enable HTML docs really.  Also why the f* were we
installing the entire tools/ directory into the doc package?

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: put frr-doc package in 'doc' section
David Lamparter [Thu, 25 Oct 2018 14:05:59 +0000 (16:05 +0200)]
debianpkg: put frr-doc package in 'doc' section

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: always install /etc/init.d/frr
David Lamparter [Thu, 25 Oct 2018 13:37:28 +0000 (15:37 +0200)]
debianpkg: always install /etc/init.d/frr

There is no point in making this conditional, systemd correctly prefers
the service file over the init script when it is present.  Also, people
can install an init system that doesn't match their distribution and
even change init systems on an installation.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: disable zeromq and FPM
David Lamparter [Thu, 25 Oct 2018 13:09:32 +0000 (15:09 +0200)]
debianpkg: disable zeromq and FPM

The ZeroMQ is just straight up useless for now, and the FPM module needs
to be properly encapsulated with protobuf deps.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: modernise dh_missing and use fail mode
David Lamparter [Thu, 25 Oct 2018 13:08:04 +0000 (15:08 +0200)]
debianpkg: modernise dh_missing and use fail mode

Things that aren't installed should be in debianpkg/not-installed.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: ditch development-only files
David Lamparter [Thu, 25 Oct 2018 13:00:55 +0000 (15:00 +0200)]
debianpkg: ditch development-only files

It is currently impossible to build external stuff that links against
installed FRR headers or libraries.  Such projects need to directly
reference an FRR source tree until we revamp the library installation
semantics.

In any case these files would then be in a frr-dev Debian package.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: raise debhelper compat level to 9
David Lamparter [Wed, 24 Oct 2018 18:57:32 +0000 (20:57 +0200)]
debianpkg: raise debhelper compat level to 9

Compat level 7 has long been deprecated.  9 works fine for us, though it
does change the library installation directories to multi-arch.  (Which
is not a problem.)

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: update to Debian Policy version 4.2.1
David Lamparter [Wed, 24 Oct 2018 18:57:16 +0000 (20:57 +0200)]
debianpkg: update to Debian Policy version 4.2.1

This bundles up a few smaller changes prompted by walking through the
upgrade checklist from 3.9.6 to 4.2.1.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: use redistclean target
David Lamparter [Wed, 24 Oct 2018 16:32:11 +0000 (18:32 +0200)]
debianpkg: use redistclean target

Now we can run dpkg-buildpackage from a dirty directory and it properly
cleans up.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: make frr-pythontools a "Recommends:"
David Lamparter [Wed, 24 Oct 2018 15:20:29 +0000 (17:20 +0200)]
debianpkg: make frr-pythontools a "Recommends:"

From the Debian policy:
  Recommends:
    This declares a strong, but not absolute, dependency.
    The Recommends field should list packages that would be found
    together with this one in all but unusual installations.

I'd say, yes, we do want the python-based reload functionality in all
but unusual installations.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: create frr-snmp and frr-rpki-rtrlib
David Lamparter [Wed, 3 Oct 2018 17:14:27 +0000 (19:14 +0200)]
debianpkg: create frr-snmp and frr-rpki-rtrlib

This splits off SNMP and RPKI support so that users can install these
packages (with the appropriate dependencies) independently of main FRR.
It also obsoletes out the weird multi-variant package distribution we've
been doing for RPKI support.

The snmpd dependency is also changed to Recommends: on frr-snmp since
the frr-snmp package is essentially useless without snmpd.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: remove bogus shlib:Depends on frr-dbg
David Lamparter [Tue, 23 Oct 2018 12:31:44 +0000 (14:31 +0200)]
debianpkg: remove bogus shlib:Depends on frr-dbg

The debug package doesn't have shlib dependencies.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: use better dependency for pythontools
David Lamparter [Tue, 23 Oct 2018 11:54:07 +0000 (13:54 +0200)]
debianpkg: use better dependency for pythontools

As described in https://wiki.debian.org/binNMU, arch-indep packages
should have an "almost identical" dependency so "+..." changes can be
made to arch-dep packages without breaking the arch-indep pkgs.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agotools: add new tarsource.sh helper
David Lamparter [Wed, 24 Oct 2018 15:01:11 +0000 (17:01 +0200)]
tools: add new tarsource.sh helper

It cleans your house and cooks dinner.  Or maybe it creates a clean dist
tarball for you, plus a Debian .dsc if you have dpkg installed - and
GPG-signs the result appropriately if requested.

In any case the resulting tarball should be distributed for our
releases.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: kill backports
David Lamparter [Mon, 22 Oct 2018 11:37:53 +0000 (13:37 +0200)]
debianpkg: kill backports

The debianpkg/backports system is rather complicated and actually slows
down Debian package building quite a lot since the backports/rules file
is evaluated a zillion times during a normal build.

This just folds up everything into a single Debian package build that
works on all OSes.  The only real difference that the backports stuff
was used for is switching between systemd and init.d, the latter for
Ubuntu 12.04 and 14.04.

With this, that switch is controlled by the pkg.frr.nosystemd
Build-Profile instead.  Package builds for Ubuntu 14.04 need to supply
the -Ppkg.frr.nosystemd option to dpkg-buildpackage.  (12.04 isn't
supported anymore anyway.)

Note that the update-rc.d step that was previously coded into
postinst/postrm is now handled by the dh_installinit magic.

Other than this, there were some minor build dependency differences, all
of which are now just handled as | in the central deps.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agodebianpkg: wrap & sort dependency lines in control
David Lamparter [Fri, 26 Oct 2018 12:00:43 +0000 (14:00 +0200)]
debianpkg: wrap & sort dependency lines in control

Muuuuch more readable...

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agoMerge pull request #3594 from pguibert6WIND/flowspec_support_nh_tracking_70
Lou Berger [Tue, 15 Jan 2019 16:50:38 +0000 (11:50 -0500)]
Merge pull request #3594 from pguibert6WIND/flowspec_support_nh_tracking_70

bgpd: flowspec redirect IP info is retrieved into nh tracking

6 years agoMerge pull request #3608 from opensourcerouting/70-bfd-24-minutes
Donald Sharp [Mon, 14 Jan 2019 15:26:56 +0000 (10:26 -0500)]
Merge pull request #3608 from opensourcerouting/70-bfd-24-minutes

7.0: bfdd: Fix timer print-out function

6 years agobfdd: Fix timer print-out function
Donald Sharp [Sat, 12 Jan 2019 21:22:32 +0000 (16:22 -0500)]
bfdd: Fix timer print-out function

The timer2str function thought 24 minutes was an hour and had a
couple of other issues that needed to be corrected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 23586b0552ee08e24d4c1f54bb4913c48c1e14aa)

6 years agoMerge pull request #3593 from donaldsharp/label_to_zebra_7.0
Renato Westphal [Mon, 14 Jan 2019 12:47:03 +0000 (10:47 -0200)]
Merge pull request #3593 from donaldsharp/label_to_zebra_7.0

bgpd: Do not send a label to zebra that it doesn't understand

6 years agobgpd: flowspec redirect IP info is retrieved into nh tracking
Philippe Guibert [Tue, 4 Dec 2018 08:33:21 +0000 (09:33 +0100)]
bgpd: flowspec redirect IP info is retrieved into nh tracking

redirect IP nh of flowspec entry is retrieved so that the nexthop
IP information is injected into the nexthop tracking, and is associated
to the bgp_path structure. This permits validating or unvalidating the
bgp_path for injection in zebra or not.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #3598 from pguibert6WIND/handle_multiple_netns_delete_event_70
Donald Sharp [Fri, 11 Jan 2019 12:32:35 +0000 (07:32 -0500)]
Merge pull request #3598 from pguibert6WIND/handle_multiple_netns_delete_event_70

zebra: handle multiple events for netns deletion event

6 years agozebra: handle multiple events for netns deletion event
Philippe Guibert [Tue, 18 Dec 2018 17:00:31 +0000 (18:00 +0100)]
zebra: handle multiple events for netns deletion event

When handling events from /var/run/netns folder, if several netns are
removed at the same time, only the first one is deleted in the frr. Fix
this behaviour by applying continue in the loop.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #3596 from donaldsharp/pthread_7.0
Mark Stapp [Thu, 10 Jan 2019 18:27:02 +0000 (13:27 -0500)]
Merge pull request #3596 from donaldsharp/pthread_7.0

dev/7.0 DC of #3589 and #3590

6 years agolib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can
Donald Sharp [Wed, 9 Jan 2019 17:18:21 +0000 (12:18 -0500)]
lib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can

When using getrusage, we have multiple choices about what
to call for data gathering about this particular thread of execution.

RUSAGE_SELF -> This means gather all cpu run time for all pthreads associated
with this process.

RUSAGE_THREAD -> This means gather all cpu run time for this particular
pthread.

Clearly with data gathering for slow thread as well as `show thread cpu`
it would be preferable to gather only data about the current running
pthread.  This probably was the original behavior of using RUSAGE_SELF
when we didn't have multiple pthreads.  So it didn't matter so much.

Prior to this change, 10 iterations of 1 million routes install/remove
from zebra would give us this cpu time for the dataplane pthread:

Showing statistics for pthread Zebra dplane thread
--------------------------------------------------
                      CPU (user+system): Real (wall-clock):
Active   Runtime(ms)   Invoked Avg uSec Max uSecs Avg uSec Max uSecs  Type  Thread
    0     280902.149    326541      860   2609982      550   2468910    E  dplane_thread_loop

After this change we are seeing this:

Showing statistics for pthread Zebra dplane thread
--------------------------------------------------
                      CPU (user+system): Real (wall-clock):
Active   Runtime(ms)   Invoked Avg uSec Max uSecs Avg uSec Max uSecs  Type  Thread
    0      58045.560    334944      173    277226      539   2502268    E  dplane_thread_loop

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, bgpd: Convert frr_pthread_set_name to only cause it to set os name of the thread
Donald Sharp [Wed, 9 Jan 2019 19:59:22 +0000 (14:59 -0500)]
lib, bgpd: Convert frr_pthread_set_name to only cause it to set os name of the thread

The current invocation of frr_pthread_set_name was causing it reset the os_name.
There is no need for this, we now always create the pthread appropriately
to have both name and os_name.  So convert this function to a simple
call through of the pthread call now.

Before(any of these changes):
sharpd@robot ~/frr1> ps -L -p 16895
  PID   LWP TTY          TIME CMD
16895 16895 ?        00:01:39 bgpd
16895 16896 ?        00:00:54
16895 16897 ?        00:00:07 bgpd_ka

After:
sharpd@donna ~/frr1> ps -L -p 1752
  PID   LWP TTY          TIME CMD
 1752  1752 ?        00:00:00 bgpd
 1752  1753 ?        00:00:00 bgpd_io
 1752  1754 ?        00:00:00 bgpd_ka

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Cleanup thread name setting to happen at start
Donald Sharp [Wed, 9 Jan 2019 19:32:44 +0000 (14:32 -0500)]
lib: Cleanup thread name setting to happen at start

When we start a thread we always call fpt_run and since
the last commit we know os_name is filled with something,
therefore we can just set the name on startup.

This creates this output now for zebra:

sharpd@donna ~/frr2> ps -L -p 25643
  PID   LWP TTY          TIME CMD
25643 25643 ?        00:00:00 zebra
25643 25644 ?        00:00:00 Zebra dplane
25643 25684 ?        00:00:00 zebra_apic
sharpd@donna ~/frr2>

I removed the abstraction to frr_pthread_set_name because
it was snprintf'ing into the same buffer which was the
real bug here( the first character of os_name became null).
In the next commit I'll remove that api because
it is unneeded and was a horrible hack to get
this to work for the one place it was wanted.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: On frr_pthread_new save a os_name
Donald Sharp [Wed, 9 Jan 2019 18:41:46 +0000 (13:41 -0500)]
lib: On frr_pthread_new save a os_name

On call of frr_pthread_new, save the os_name if given,
if not given use the name passed in( shortening to fit
in available space ) and finally if the name was not
passed in use the default value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Do not send a label to zebra that it doesn't understand
Donald Sharp [Wed, 9 Jan 2019 13:48:37 +0000 (08:48 -0500)]
bgpd: Do not send a label to zebra that it doesn't understand

When using an `import vrf` mechanism we are marking
the vrf label as BGP_PREVENT_VRF_2_VRF_LEAK, and then sending
this down to zebra.  Since zebra knows nothing about this special
value, convert it to a value that it does know MPLS_LABEL_NONE.

This bug was introduced by: 13b7e7f007833c4e2942f40cbd2c2f93a2767e78

And shows up with this error message in the zebra log:

2019/01/09 08:25:16 ZEBRA: Extended Error: Label >= configured maximum in platform_labels
2019/01/09 08:25:16 ZEBRA: [EC 4043309093] netlink-cmd (NS 0) error: Invalid argument, type=RTM_NEWROUTE(24), seq=8, pid=3321825991
2019/01/09 08:25:16 ZEBRA: [EC 4043309103] LSP Install Failure: 4294967294

And zebra kept the label as:
donna.cumulusnetworks.com# show mpls table
 Inbound                            Outbound
   Label     Type          Nexthop     Label
--------  -------  ---------------  --------
      -2      BGP            GREEN
      -2      BGP             BLUE

After this fix, neither the labels are stored in zebra nor do we see
the log error message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3585 from pguibert6WIND/fix_vrf_netns_broken_70
Donald Sharp [Tue, 8 Jan 2019 18:28:28 +0000 (13:28 -0500)]
Merge pull request #3585 from pguibert6WIND/fix_vrf_netns_broken_70

zebra: update local ns_id field

6 years agoMerge pull request #3584 from opensourcerouting/70-freebsd-route-fix
Donald Sharp [Tue, 8 Jan 2019 18:20:46 +0000 (13:20 -0500)]
Merge pull request #3584 from opensourcerouting/70-freebsd-route-fix

dev/7.0: zebra: fix FreeBSD breakage

6 years agozebra: update local ns_id field
Philippe Guibert [Mon, 7 Jan 2019 08:55:10 +0000 (09:55 +0100)]
zebra: update local ns_id field

ns_id field must be synced with ns_id from netns service.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: fix another FreeBSD warning message
Rafael Zalamena [Tue, 8 Jan 2019 12:37:22 +0000 (10:37 -0200)]
zebra: fix another FreeBSD warning message

When an empty netmask a wrong end size is calculated, lets handle this
corner case to avoid spurious warning messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 2d100aa5f12d1b5e09411fd27d0e3938cf4305db)

6 years agozebra: fix FreeBSD warning on fresh OS boot
Rafael Zalamena [Tue, 8 Jan 2019 12:32:28 +0000 (10:32 -0200)]
zebra: fix FreeBSD warning on fresh OS boot

Handle corner case where a warning log message is issued on interface
address netmask handling with sockaddr type AF_LINK: it may come empty
or with match all (all 0xFF).

In the first case all lengths are zero and we only need to copy the
first bytes, second case it comes with a zero index and all 0xFF bytes.

In any case we only need to figure out a few of the first bytes instead
of all data.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 75e710df7a21d980bba9e5b2260408a3b30d4145)

6 years agozebra: implement FreeBSD route attr handling
Rafael Zalamena [Tue, 8 Jan 2019 10:14:28 +0000 (08:14 -0200)]
zebra: implement FreeBSD route attr handling

When porting routing socket macro data handling to functions, the
attribute function was forgotten. The only difference between the
attribute and address handler is the family type check.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 19fb538dc116c837af3bb1a76526cbb9a39d1bfc)

6 years agoMerge pull request #3576 from LabNConsulting/working/7.0/no-bgp-attr-255
Donald Sharp [Mon, 7 Jan 2019 23:45:06 +0000 (18:45 -0500)]
Merge pull request #3576 from LabNConsulting/working/7.0/no-bgp-attr-255

7.0: bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined

6 years agoMerge pull request #3573 from manuhalo/dev7_fix_isis_p2p
Donald Sharp [Mon, 7 Jan 2019 22:31:46 +0000 (17:31 -0500)]
Merge pull request #3573 from manuhalo/dev7_fix_isis_p2p

[dev/7.0] isisd: fix point-to-point network type config

6 years agobgp_rfapi_basic_sanity_config2: delayed timeouts not supported without VNC attr
Lou Berger [Mon, 7 Jan 2019 22:16:37 +0000 (22:16 +0000)]
bgp_rfapi_basic_sanity_config2: delayed timeouts not supported without VNC attr

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgp_rfapi_basic_sanity: delayed timeouts not supported without VNC attr
Lou Berger [Mon, 7 Jan 2019 20:00:34 +0000 (20:00 +0000)]
bgp_rfapi_basic_sanity: delayed timeouts not supported without VNC attr

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined
Lou Berger [Mon, 7 Jan 2019 16:32:54 +0000 (11:32 -0500)]
bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agoisisd: fix point-to-point network type config
Emanuele Di Pascale [Mon, 7 Jan 2019 11:29:29 +0000 (12:29 +0100)]
isisd: fix point-to-point network type config

`isis network point-to-point` was being rejected from the configuration
file as it was being processed before the reception of the UP zebra
notification for the interface. This meant that the `circ_type` was set
at CIRCUIT_T_UNKNOWN, which led the northbound callback to fail. This
check was removed as it was not really necessary; when the zebra
notification is received, the correct circuit type will be enforced,
but now the point-to-point config will be saved and correctly applied
when zebra recognizes the interface as a broadcast one.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agoMerge pull request #3561 from opensourcerouting/northbound-freebsd-fix
Quentin Young [Thu, 3 Jan 2019 16:48:31 +0000 (11:48 -0500)]
Merge pull request #3561 from opensourcerouting/northbound-freebsd-fix

lib: fix segfault on freebsd when using vsnprintf() incorrectly

6 years agoMerge pull request #3558 from opensourcerouting/silence-ioctl-warning
Russ White [Thu, 3 Jan 2019 02:43:18 +0000 (21:43 -0500)]
Merge pull request #3558 from opensourcerouting/silence-ioctl-warning

zebra: silence harmless ioctl warning when retrieving interface speed

6 years agoMerge pull request #3560 from opensourcerouting/fix-sh-bgp-community
Russ White [Thu, 3 Jan 2019 02:42:50 +0000 (21:42 -0500)]
Merge pull request #3560 from opensourcerouting/fix-sh-bgp-community

bgpd: fix parsing of community number in the "show bgp community" command

6 years agoMerge pull request #3549 from chiragshah6/mdev
Russ White [Thu, 3 Jan 2019 02:39:58 +0000 (21:39 -0500)]
Merge pull request #3549 from chiragshah6/mdev

bgpd: evpn command to restrict to default vrf

6 years agolib: fix segfault on freebsd when using vsnprintf() incorrectly
Renato Westphal [Thu, 3 Jan 2019 00:32:13 +0000 (22:32 -0200)]
lib: fix segfault on freebsd when using vsnprintf() incorrectly

FreeBSD's libc segfaults when vsnprintf() is called with a null
format string. Add a null check before calling vsnprintf() to
resolve this problem.

Fixes #3537

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agobgpd: fix parsing of community number in the "show bgp community" command
Renato Westphal [Wed, 2 Jan 2019 21:25:02 +0000 (19:25 -0200)]
bgpd: fix parsing of community number in the "show bgp community" command

Fixes #3545.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agozebra: silence harmless ioctl warning when retrieving interface speed
Renato Westphal [Wed, 2 Jan 2019 18:47:51 +0000 (16:47 -0200)]
zebra: silence harmless ioctl warning when retrieving interface speed

zebra uses the SIOCETHTOOL ioctl with the ETHTOOL_GSET command to
fetch the speed of interfaces from the kernel. The only problem is
that ETHTOOL_GSET returns EOPNOTSUPP when the given interface is a
virtual interface. This leads to zebra emitting warnings like this
at startup:

ZEBRA: IOCTL failure to read interface lo speed: 95 Operation not supported
ZEBRA: IOCTL failure to read interface dummy0 speed: 95 Operation not supported
ZEBRA: IOCTL failure to read interface ovs-system speed: 95 Operation not supported

Silence these warnings by ignoring EOPNOTSUPP errors, since we know
they are harmless. This is similar to how we handle EINVAL errors
from the BSD SIOCGIFMEDIA ioctl (commit c69f2c1ff).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoMerge pull request #3553 from opensourcerouting/fix-interface-vrf-update-msg
Quentin Young [Wed, 2 Jan 2019 18:50:47 +0000 (13:50 -0500)]
Merge pull request #3553 from opensourcerouting/fix-interface-vrf-update-msg

zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message

6 years agoMerge pull request #3550 from donaldsharp/sharp_nhg
Renato Westphal [Wed, 2 Jan 2019 16:42:34 +0000 (14:42 -0200)]
Merge pull request #3550 from donaldsharp/sharp_nhg

Sharp nhg

6 years agoMerge pull request #3534 from opensourcerouting/netlink-length-duplicated
Quentin Young [Wed, 2 Jan 2019 15:53:49 +0000 (10:53 -0500)]
Merge pull request #3534 from opensourcerouting/netlink-length-duplicated

zebra: remove duplicated code

6 years agozebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
Renato Westphal [Wed, 2 Jan 2019 15:05:53 +0000 (13:05 -0200)]
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message

Unlike the other interface zapi messages, ZEBRA_INTERFACE_VRF_UPDATE
identifies interfaces using ifindexes and not interface names. This
is a problem because zebra always sends ZEBRA_INTERFACE_DOWN
and ZEBRA_INTERFACE_DELETE messages before sending
ZEBRA_INTERFACE_VRF_UPDATE, and the ZEBRA_INTERFACE_DELETE callback
from all daemons set the interface index to IFINDEX_INTERNAL. Hence,
when decoding a ZEBRA_INTERFACE_VRF_UPDATE message, the interface
lookup would always fail since the corresponding interface lost
its ifindex. Example (ospfd):

OSPF: Zebra: Interface[rt1-eth2] state change to down.
OSPF: Zebra: interface delete rt1-eth2 vrf default[0] index 8 flags 11143 metric 0 mtu 1500
OSPF: [EC 100663301] INTERFACE_VRF_UPDATE: Cannot find IF 8 in VRF 0

To fix this problem, use interface names instead of ifindexes to
indentify interfaces like the other interface zapi messages do.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agosharpd: Allow sharpd to accept nexthop group as part of route install
Donald Sharp [Mon, 31 Dec 2018 22:49:47 +0000 (17:49 -0500)]
sharpd: Allow sharpd to accept nexthop group as part of route install

When installing routes via sharpd 'sharp install route... ' command
add the ability to specify a nexthop-group to use.  This will
allow sharpd to create ECMP routes into zebra.

Nexthop-group:
!
nexthop-group JANELLE
  nexthop 192.168.209.1
  nexthop 192.168.210.1
!

The install:

donna.cumulusnetworks.com# sharp install routes 10.0.50.0 nexthop-group JANELLE 10
donna.cumulusnetworks.com# end
donna.cumulusnetworks.com# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route

K>* 0.0.0.0/0 [0/106] via 10.0.2.2, enp0s3, 00:20:38
C>* 10.0.2.0/24 is directly connected, enp0s3, 00:20:38
D>* 10.0.50.0/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.1/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.2/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.3/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.4/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.5/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.6/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.7/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.8/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.9/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
C>* 192.168.209.0/24 is directly connected, enp0s8, 00:20:38
C>* 192.168.210.0/24 is directly connected, enp0s9, 00:20:38
donna.cumulusnetworks.com#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agosharpd/vtysh: Allow sharpd to use nexthop-groups
Donald Sharp [Mon, 31 Dec 2018 22:48:36 +0000 (17:48 -0500)]
sharpd/vtysh: Allow sharpd to use nexthop-groups

Allow the sharp daemon to understand and use nexthop-groups.

This commit is merely to allow sharpd to understand them
when accepted in a future commit

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agosharp: Modify route install to take nexthop groups
Donald Sharp [Mon, 31 Dec 2018 22:28:13 +0000 (17:28 -0500)]
sharp: Modify route install to take nexthop groups

Modify the route_add function to take nexthop groups.  Future commits
will allow sharpd to use nexthop groups as the install mechanism
for routes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3543 from donaldsharp/eigrp_router_id_is_the_bee
Renato Westphal [Wed, 2 Jan 2019 00:39:03 +0000 (22:39 -0200)]
Merge pull request #3543 from donaldsharp/eigrp_router_id_is_the_bee

Eigrp router id cleanup

6 years agoMerge pull request #3540 from donaldsharp/staic
Renato Westphal [Wed, 2 Jan 2019 00:36:59 +0000 (22:36 -0200)]
Merge pull request #3540 from donaldsharp/staic

staticd: Do not ready prefix for printing till it's decoded

6 years agoMerge pull request #3246 from pguibert6WIND/distribute_vrf_aware
Renato Westphal [Wed, 2 Jan 2019 00:34:59 +0000 (22:34 -0200)]
Merge pull request #3246 from pguibert6WIND/distribute_vrf_aware

Distribute vrf aware

6 years agobgpd: evpn command to restrict to default vrf
Chirag Shah [Mon, 31 Dec 2018 21:18:21 +0000 (13:18 -0800)]
bgpd: evpn command to restrict to default vrf

Certain EVPN configuartions should only be applied
under DEFAULT VRF bgpd instance.

reject the cli for non default bgp instance

Ticket:CM-18950

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #3546 from opensourcerouting/ospf-show-neighbor-fix
Donald Sharp [Mon, 31 Dec 2018 14:26:37 +0000 (09:26 -0500)]
Merge pull request #3546 from opensourcerouting/ospf-show-neighbor-fix

ospfd: fix wrong argv index in the "show ip ospf neighbor" command

6 years agoospfd: convert a couple of "show" commands to DEFPY
Renato Westphal [Mon, 31 Dec 2018 13:11:15 +0000 (11:11 -0200)]
ospfd: convert a couple of "show" commands to DEFPY

DEFPY commands are easier to maintain and less susceptible to
bugs. In the long term we should try to merge the plethora of
"show ip ospf neighbor" commands (total of 14) into a single DEFPY.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoospfd: fix wrong argv index in the "show ip ospf neighbor" command
Renato Westphal [Mon, 31 Dec 2018 13:02:49 +0000 (11:02 -0200)]
ospfd: fix wrong argv index in the "show ip ospf neighbor" command

Fixes Issue #3544.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoeigrpd: Allow eigrp to set/unset the router-id as a value.
Donald Sharp [Mon, 31 Dec 2018 00:59:52 +0000 (19:59 -0500)]
eigrpd: Allow eigrp to set/unset the router-id as a value.

This code addition allows eigrp to set/unset the router-id
value.  At this point I am not 100% sure that we do all the necessary
rework when a router-id changes.  But on startup if read in before
a network statement we should be ok.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: eigrp usage of uint32_t to struct in_addr for router_id data
Donald Sharp [Mon, 31 Dec 2018 00:54:25 +0000 (19:54 -0500)]
eigrpd: eigrp usage of uint32_t to struct in_addr for router_id data

In eigrp we were using a uint32_t to hold the `struct in_addr` data
for the router id values.  This caused us to do unnecessary conversions
pre and post for in/out.  Let's just use the standard `struct in_addr`

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: Write eigrp config even if no network statements yet
Donald Sharp [Mon, 31 Dec 2018 00:44:27 +0000 (19:44 -0500)]
eigrpd: Write eigrp config even if no network statements yet

Let's write the eigrp config even if we have no network statements
as that the other functions return safely if nothing to do here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>