thirdparty/quagga.git
13 months agolib/thread: Address other paths from thread_execute to thread_add_unuse master
Paul Jakma [Sat, 3 Mar 2018 15:22:58 +0000 (15:22 +0000)]
lib/thread: Address other paths from thread_execute to thread_add_unuse

* lib/thread.c: There are further paths from thread_execute to
  thread_add_unuse, beyond that from bugzilla bug#975.

  Make the paths from thread_execute to thread_add_unuse, inc.
  thread_add_unuse itself, tolerant to the "dummy" threads of
  thread_execute.

  Another option would be to have thread_execute properly obtain a
  thread struct, rather than fake one on its heap.

  (thread_add_unuse) Be tolerant of NULL master threads passed in, that
  /ought/ to be dummy/non-heap threads, and just ignore.  Don't assert.
  (thread_call) no point checking for NULL master here anymore.

See https://bugzilla.quagga.net/show_bug.cgi?id=977

With thanks to John Hay, john@sanren.ac.za, for testing and verifying
the fix.

13 months agorelease: Quagga 1.2.4 quagga-1.2.4
Paul Jakma [Mon, 19 Feb 2018 21:24:55 +0000 (21:24 +0000)]
release: Quagga 1.2.4

Brown paper bag release.

13 months agolib: Fix assert in thread_add_unuse if thread_execute was used
Paul Jakma [Mon, 19 Feb 2018 20:55:20 +0000 (20:55 +0000)]
lib: Fix assert in thread_add_unuse if thread_execute was used

* thread.c: (thread_call) thread_execute passes in a dummy thread, on its
  stack, with a NULL thread master. Those shouldn't be added to the unuse
  list or thread_add_unuse rightly asserts.

  Fix this very dumb bug.

  See https://bugzilla.quagga.net/show_bug.cgi?id=975

  With thanks to Sergey Popov, admin@pinkbyte.ru, and Andreas Nilsson,
  andrnils@resilans.se, for help with diagnosis and testing.

14 months agolib: Avoid re-definition of IPPROTO_IP with some versions of Linux
Xiami [Sun, 4 Feb 2018 16:35:42 +0000 (16:35 +0000)]
lib: Avoid re-definition of IPPROTO_IP with some versions of Linux

* Starting from linux-4.11 [commit
  bcb41c6bced1ee778d23c53a6b4807fb08cf5540], linux/mroute.h includes
  linux/in.h , that makes gcc roar a lot of things like "error:
  redeclaration of enumerator 'IPPROTO_IP'" when compiling quagga-1.2.2

  lib/zebra.h includes sys/capability.h first, then includes
  netinet/in.h . In sys/capability.h, it includes linux/xattr.h, and
  that includes linux/libc-compat.h . Since at that time netinet/in.h is
  not included yet, _NETINET_IN_H is not defined, causing libc-compat.h
  set __UAPI_DEF_IN_IPPROTO to 1. Then, a include of netinet/in.h
  defines IPPROTO_IP. Later a include of linux/mroute.h includes
  linux/in.h. Because __UAPI_DEF_IN_IPPROTO is set to non zero,
  IPPROTO_IP is redeclared.

* lib/zebra.h: Move the privs/capabilities include block to after the
  network block.

14 months agorelease/scripts: Add short subject log location to print out
Paul Jakma [Sun, 4 Feb 2018 20:18:06 +0000 (20:18 +0000)]
release/scripts: Add short subject log location to print out

* The short, by subject log is useful too, include its location in summary

14 months agorelease: Quagga 1.2.3 quagga-1.2.3
Paul Jakma [Sun, 4 Feb 2018 17:34:34 +0000 (17:34 +0000)]
release: Quagga 1.2.3

14 months agodoc/security: Security announcements for 4 issues
Paul Jakma [Sun, 21 Jan 2018 17:02:32 +0000 (17:02 +0000)]
doc/security: Security announcements for 4 issues

* doc/security/Quagga-2018-0543.txt: attr_endp used for NOTIFY data
* doc/security/Quagga-2018-1114.txt: bgpd double free
* doc/security/Quagga-2018-1550.txt: debug overrun in notify lookup tables
* doc/security/Quagga-2018-1975.txt: BGP capability inf. loop

14 months agodoc/security: Add a doc/security folder and template for announcements
Paul Jakma [Sun, 21 Jan 2018 17:01:18 +0000 (17:01 +0000)]
doc/security: Add a doc/security folder and template for announcements

* doc/security: New folder to store Quagga security announcements,
  where they can be revision controlled.
* doc/security/template.txt: Template for announcements

14 months agodoc: Add commit message template, suitable for commit.template
Paul Jakma [Sat, 20 Jan 2018 12:15:40 +0000 (12:15 +0000)]
doc: Add commit message template,  suitable for commit.template

* doc/commit-template.txt: Add git commit template, that can be enabled
  via:

  git config --add commit.template doc/commit-template.txt

14 months agobgpd: remove stream_pnt use for notify data
Paul Jakma [Thu, 4 Jan 2018 00:22:53 +0000 (00:22 +0000)]
bgpd: remove stream_pnt use for notify data

* bgp_packet.c: (bgp_open_receive) Remove the stream_pnt introduced
  in c69698704806a9ac50. stream_pnt / BGP_INPUT_PNT / etc. should be avoided
  as much possible, and I/O put through the lib/stream checked buffer as much
  as possible.

  Not really any functional effect here given the fixed size, other than to
  remove something that shouldn't be copied.

14 months agolib/privs: Remove of CAP_NET_BROADCAST forgot to decrement array count
Paul Jakma [Wed, 3 Jan 2018 23:44:30 +0000 (23:44 +0000)]
lib/privs: Remove of CAP_NET_BROADCAST forgot to decrement array count

* lib/privs.c: (cap_map) Removal of Linux CAP_NET_BROADCAST from ZCAP_BIND
  forgot to decrement the array count in the 'num' field. Resulting in an
  overread of memory from zcaps2sys from zprivs_caps_init.

14 months agobgpd/security: debug print of received NOTIFY data can over-read msg array
Paul Jakma [Sat, 6 Jan 2018 22:31:52 +0000 (22:31 +0000)]
bgpd/security: debug print of received NOTIFY data can over-read msg array

Security issue: Quagga-2018-1550
See: https://www.quagga.net/security/Quagga-2018-1550.txt

* bgpd/bgp_debug.c: (struct message) Nearly every one of the NOTIFY
  code/subcode message arrays has their corresponding size variables off
  by one, as most have 1 as first index.

  This means (bgp_notify_print) can cause mes_lookup to overread the (struct
  message) by 1 pointer value if given an unknown index.

  Fix the bgp_notify_..._msg_max variables to use the compiler to calculate
  the correct sizes.

14 months agobgpd/security: fix infinite loop on certain invalid OPEN messages
Paul Jakma [Sat, 6 Jan 2018 21:20:51 +0000 (21:20 +0000)]
bgpd/security: fix infinite loop on certain invalid OPEN messages

Security issue: Quagga-2018-1975
See: https://www.quagga.net/security/Quagga-2018-1975.txt

* bgpd/bgp_packet.c: (bgp_capability_msg_parse) capability parser can infinite
  loop due to checks that issue 'continue' without bumping the input
  pointer.

14 months agobgpd/security: Fix double free of unknown attribute
Paul Jakma [Sat, 6 Jan 2018 19:52:10 +0000 (19:52 +0000)]
bgpd/security: Fix double free of unknown attribute

Security issue: Quagga-2018-1114
See: https://www.quagga.net/security/Quagga-2018-1114.txt

It is possible for bgpd to double-free an unknown attribute. This can happen
via bgp_update_receive receiving an UPDATE with an invalid unknown attribute.
bgp_update_receive then will call bgp_attr_unintern_sub and bgp_attr_flush,
and the latter may try free an already freed unknown attr.

* bgpd/bgp_attr.c: (transit_unintern) Take a pointer to the caller's storage
  for the (struct transit *), so that transit_unintern can NULL out the
  caller's reference if the (struct transit) is freed.
  (cluster_unintern) By inspection, appears to have a similar issue.
  (bgp_attr_unintern_sub) adjust for above.

14 months agobgpd/security: invalid attr length sends NOTIFY with data overrun
Paul Jakma [Wed, 3 Jan 2018 23:57:33 +0000 (23:57 +0000)]
bgpd/security: invalid attr length sends NOTIFY with data overrun

Security issue: Quagga-2018-0543

See: https://www.quagga.net/security/Quagga-2018-0543.txt

* bgpd/bgp_attr.c: (bgp_attr_parse) An invalid attribute length is correctly
  checked, and a NOTIFY prepared.  The NOTIFY can include the incorrect
  received data with the NOTIFY, for debug purposes.  Commit
  c69698704806a9ac5 modified the code to do that just, and also send the
  malformed attr with the NOTIFY.  However, the invalid attribute length was
  used as the length of the data to send back.

  The result is a read past the end of data, which is then written to the
  NOTIFY message and sent to the peer.

  A configured BGP peer can use this bug to read up to 64 KiB of memory from
  the bgpd process, or crash the process if the invalid read is caught by
  some means (unmapped page and SEGV, or other mechanism) resulting in a DoS.

  This bug _ought_ /not/ be exploitable by anything other than the connected
  BGP peer, assuming the underlying TCP transport is secure.  For no BGP
  peer should send on an UPDATE with this attribute.  Quagga will not, as
  Quagga always validates the attr header length, regardless of type.

  However, it is possible that there are BGP implementations that do not
  check lengths on some attributes (e.g.  optional/transitive ones of a type
  they do not recognise), and might pass such malformed attrs on.  If such
  implementations exists and are common, then this bug might be triggerable
  by BGP speakers further hops away.  Those peers will not receive the
  NOTIFY (unless they sit on a shared medium), however they might then be
  able to trigger a DoS.

  Fix: use the valid bound to calculate the length.

15 months agozebra/redistribute: Implicit withdraw needs to be explicit if update isn't sent volatile/next
Gerrie Roos [Wed, 17 Jan 2018 21:16:55 +0000 (21:16 +0000)]
zebra/redistribute: Implicit withdraw needs to be explicit if update isn't sent

* redistribute.{c,h}: (redistribute_add) update of redistributed route is an
  implicit withdraw of the old route. The RIB therefore doesn't bother
  deleting the old route, if doing a redistribute_add. However, if the
  updated route is /not/ sent to a client that received the previous route,
  then such a client is left with bogus state.

  This can happen when the new route is of a type that the client doesn't
  redistibute.

  Fix by passing in the old route, and adding an explicit delete of the old
  route where necessary.

* zebra_rib.c: (rib_process) pass on the old route too, as per above.
* redistribute_null.c: testing stub

See bug #971

Modification to fix the problem at the redistribute layer instead of the RIB
suggested by paul@jakma.org.

15 months agodoc: 'match aspath' should be 'match as-path'
Pier Carlo Chiodi [Tue, 19 Sep 2017 07:25:54 +0000 (09:25 +0200)]
doc: 'match aspath' should be 'match as-path'

15 months agobgpd: fix SIGBUS
Rolf Eike Beer [Mon, 4 Dec 2017 17:36:21 +0000 (18:36 +0100)]
bgpd: fix SIGBUS

There is one test failure in the testsuite on sparc:

Running ./bgpd.tests/testbgpcap.exp ...
failed: testbgpcap ORF: ORF, simple, single entry, single tuple -- testbgpcap  aborted!

The error is a SIGBUS in bgp_capability_mp_data() because of an unaligned
memory access.  Use memcpy() instead of direct assignments.  Compilers on
platforms that support unaligned accesses should be clever enough to
optimize the function call away and do the direct store, so this should not
hurt there.

16 months agobgpd: Fix mistake in NHT of connected IPv6 next-hops preventing route advertisement
Mathieu Jadin [Thu, 14 Dec 2017 16:53:53 +0000 (17:53 +0100)]
bgpd: Fix mistake in NHT of connected IPv6 next-hops preventing route advertisement

Since quagga-1.2.0, the Next Hop validation for directly connected peers
using IPv6 does not work.

In this setup, BGP updates contain two next hops: a global IPv6 address and
a link-local IPv6 address (a correct behavior according to RFC 2545).  This
means that the length of the next hop attribute is 32 and not 16.

The problem comes from the function "make_prefix()" in "bgpd/bgp_nht.c".  It
refuses to build a prefix structure for a route when the length of the
[Anext hop attribute is different from 16, even if a valid global IPv6
address is available.

The route is mistakenly considered invalid and thus, it is not installed in
the routing table.

Details: "make_prefix()" was not modified in quagga-1.2.0 but its
interpretation was changed in commit
3dda6b3eccb9a2a88d607372c83c04c796e7daac.  Before this commit, the failure
of "make_prefix()" was interpreted as a successful validation of the next
hop.

16 months agoUpdated the protocol supported list
Balaji Gurudoss [Tue, 2 May 2017 16:20:31 +0000 (21:50 +0530)]
Updated the protocol supported list

16 months agolib/command: make config file robust more robust and kinder to system
Paul Jakma [Tue, 5 Dec 2017 21:09:46 +0000 (21:09 +0000)]
lib/command: make config file robust more robust and kinder to system

* command.c: (config_write_file) Remove two very heavyweights sync()s and
  replace with an fdatasync of just the freshly writen config file data.
  Make the move of the new config into place more robust, by using
  rename instead of unlink/link.

  This should fix a performance issue on systems with slow storage,
  where the syncs were disrupting performance, see bugzilla #966. Should
  also be more robust.

  Problem diagnosed and reported by:

   Patrick Kuijvenhoven <patrick.kuijvenhoven@gmail.com>

  with an initial fix, on which this commit develops, and further work on
  testing.

16 months agodoc: Bring documentation on Zserv header up to date.
Paul Jakma [Sun, 4 Jun 2017 14:25:22 +0000 (15:25 +0100)]
doc: Bring documentation on Zserv header up to date.

16 months agobgpd: distance comment
Paul Jakma [Wed, 26 Apr 2017 12:59:40 +0000 (13:59 +0100)]
bgpd: distance comment

16 months agodoc: Fix small but important logical mistake in community-list example
Borg [Mon, 24 Apr 2017 08:51:07 +0000 (09:51 +0100)]
doc: Fix small but important logical mistake in community-list example

* bgpd.texi: Comm-lists must match all communities specified. The text to
  accompany the example however says it is an "or" match, which is wrong
  and very misleading. Fix.

16 months agodoc: document that changing bgp distance needs a hard clear of routes
Paul Jakma [Thu, 13 Apr 2017 16:48:55 +0000 (17:48 +0100)]
doc: document that changing bgp distance needs a hard clear of routes

16 months agobgpd: malformed attribute handling: don't pass on, and add missing notify
Paul Jakma [Tue, 27 Mar 2012 11:11:52 +0000 (12:11 +0100)]
bgpd: malformed attribute handling: don't pass on, and add missing notify

* bgpd/bgp_attr.c: (bgp_attr_malformed) A malformed attribute should
  never be passed on, even if we proceed with parsing the UPDATE.
  The default reset case should send the NOTIFY itself, so the given subcode
  is used.

16 months agolib/filter: change add/delete callback hooks to robustly delete
Paul Jakma [Mon, 3 Apr 2017 21:02:38 +0000 (22:02 +0100)]
lib/filter: change add/delete callback hooks to robustly delete

* Prior band-aids were made to address use-after-frees in lib/filter
  with deletes, but they introduced another error.  They allowed the
  access-list being deleted to be visible by access_list_lookup from
  the users' delete callback, causing deleted access-list references to
  not be removed, leading to different use-after-frees instead.

  Fix in a robust manner within the filter code.

  This bug was reported and debugged by matt@kontoff.com, with an
  initial fix, on which this commit builds.  See
  https://bugzilla.quagga.net/show_bug.cgi?id=945.

* filter.h: Change the callback hooks to take the access-list name, not
  the access-list reference.  The name can be a weaker, more opaque
  ref.
* filter.c: Update hooks calls to pass name.
  (access_list_{insert,lookup})
  guard strcmp of name, as name may now potentially be NULL for access-lists
  in process of being deleted.
  (access_list_filter_delete) Transfer ownership of the access-list name
  to a local, so the access-list can be deleted, and the name then passed
  to the callback.
  (no_access_list_all) ditto.
  (no_ipv6_access_list_all) ditto.
  (filter_show) guard name strcmp, shouldn't be possible to see an access-list
  being deleted here, but better safe.
* ospfd/ospf_zebra.c: (ospf_filter_update) adjust for hook change.
* bgpd/bgpd.c: (peer_distribute_update) adjust for hook change, not using the
  arg.
* ripd/ripd.c: (rip_distribute_update_all_wrapper) ditto
* ripngd/ripngd.c: (ripng_distribute_update_all_wrapper) ditto.

16 months agoRevert "lib: Fix Free Pointer dereference in lib/filter.c"
Paul Jakma [Mon, 3 Apr 2017 16:45:51 +0000 (17:45 +0100)]
Revert "lib: Fix Free Pointer dereference in lib/filter.c"

This reverts commit 4fdb5f401eb277fa54d80e99d241bd9b03895a6a.

This introduces bugs, as callers are using the same hook for add/delete.
Using a pattern of looking up the access-list by name, and updating their
internal references by its result.  With the access-list still active when
the delete hook is called, this swaps a use-after-free or NULL deref in one
hook for use-after-frees in many other places.

See https://bugzilla.quagga.net/show_bug.cgi?id=945

16 months agoRevert "lib: call filter delete hook before freeing access list"
Paul Jakma [Mon, 3 Apr 2017 16:36:47 +0000 (17:36 +0100)]
Revert "lib: call filter delete hook before freeing access list"

This reverts commit 6a2e0f36b103386e57dbe3a6ee4716e809111198.

This introduces bugs, as callers are using the same hook for add/delete.
Using a pattern of looking up the access-list by name, and updating their
internal references by its result.  With the access-list still active when
the delete hook is called, this swaps a NULL deref in one hook for
use-after-frees in many other places.

See https://bugzilla.quagga.net/show_bug.cgi?id=945

16 months agoinfra/buildbot: allow bots to be picked out by installed compiler.
Paul Jakma [Wed, 29 Mar 2017 10:51:59 +0000 (11:51 +0100)]
infra/buildbot: allow bots to be picked out by installed compiler.

* master.cfg: add "compilers" function to return available compilers.
  Add "ccbots" to select the bots with given compiler tag present.

  workers: Change the compiler info lists from tuples to dicts, so
  the name can be picked out and to allow optional information.

16 months agoinfra/buildbot: Add bots, add JSON "env" config variable, poll all git branches
Paul Jakma [Wed, 29 Mar 2017 08:10:09 +0000 (09:10 +0100)]
infra/buildbot: Add bots, add JSON "env" config variable, poll all git branches

* master.cfg: Add an "env" key to config, to store environment variables
  to set.  Has to be stored as JSON in order to be able to have the builder
  pass the envs in as a property that the build steps can access later.
  Needed for OpenBSD, where auto* commands are wrappers that redirect to
  auto*-<ver> binaries based on env.

  Add ubuntu bot.

  Scan all branches in upstream git.

  Factor out common steps, to variables that can be re-used in addSteps.

16 months agolib: ptr macro arg may need brackets in some cases
Paul Jakma [Tue, 29 Mar 2011 13:06:21 +0000 (14:06 +0100)]
lib: ptr macro arg may need brackets in some cases

16 months agodistro/systemd: add man page ref and set config file permissions
Scott Leggett [Thu, 23 Mar 2017 12:36:15 +0000 (12:36 +0000)]
distro/systemd: add man page ref and set config file permissions

* redhat/*.service: Add "Documentation=man:..." lines.  Chmod and chown the
  config files as appropriate.
* redhat/quagga.sysconfig: Make configure generated, to substitute in the
  configured user/groups to an Env var, for use in the service files.

Note: This is partial and edited version of Scott's patch, by Paul Jakma.
Stupid mistakes will be mine.

Note2: Would be good to move distro agnostic files, like systemd service files,
to a neutral dirctory.

16 months agodoc: Fix manpage number for ospfclient.
Scott Leggett [Fri, 11 Nov 2016 16:27:41 +0000 (03:27 +1100)]
doc: Fix manpage number for ospfclient.

16 months agovtysh: Fix spelling errors in strings flagged by lintian.
Scott Leggett [Fri, 11 Nov 2016 14:58:52 +0000 (01:58 +1100)]
vtysh: Fix spelling errors in strings flagged by lintian.

16 months agodoc: Tweak grammar in zebra manpage to keep lintian happy.
Scott Leggett [Fri, 11 Nov 2016 14:26:10 +0000 (01:26 +1100)]
doc: Tweak grammar in zebra manpage to keep lintian happy.

16 months agovtysh: print error if PAM auth does not succeed
Debian QA Group [Fri, 11 Nov 2016 14:16:08 +0000 (01:16 +1100)]
vtysh: print error if PAM auth does not succeed

16 months agolib/thread: get rid of the shallow-copy thread_fetch add a sane thread_main
Paul Jakma [Fri, 17 Mar 2017 13:30:56 +0000 (13:30 +0000)]
lib/thread: get rid of the shallow-copy thread_fetch add a sane thread_main

* thread.h: (thread_{fetch,call}) unexport these functions. thread_fetch
  has a funny "return a cloned, shallow-copied thread struct" semantics that
  are needless.
  thread_call has no users other than the usual main thread loop, which
  should be replaced with:
  (thread_main) encapsulated main thread loop.
* thread.c: (thread_run) no need for this shallow-copy anymore.
  (thread_add_unuse) no need for a separate master argument. Update
  all callers to match. Setting type to THREAD_UNUSED can be done here.
  (thread_fetch) no need to copy the thread or add to unused _before_
  running it, so return the chosen thread directly.
  (thread_call) This runs the thread, so add_unuse best done here, at end.
  (thread_main) Simple main loop for public use.
* */*main.c: update to thread_main

16 months agobuildbot/master: use a helper generator for make cmd string list
Paul Jakma [Thu, 16 Mar 2017 16:32:53 +0000 (16:32 +0000)]
buildbot/master: use a helper generator for make cmd string list

16 months agobuildbot/master: fix the common steps
Paul Jakma [Thu, 16 Mar 2017 15:22:47 +0000 (15:22 +0000)]
buildbot/master: fix the common steps

* master.cfg: Trailing commas on common steps, left from moving out from a
  list, had made the assignment be of tuples. All kinds of funniness ensued.
  Also, rpm builder, had dropped configure step in using common steps.

16 months agobuildbot/master: Add OBSD bot, and support for environment variable config
Paul Jakma [Thu, 16 Mar 2017 13:03:49 +0000 (13:03 +0000)]
buildbot/master: Add OBSD bot, and support for environment variable config

* master.cfg: Add OpenBSD buildbot.
  Add an "env" key to the configuration dictionary, allowing for a
  JSON string of env variables, to be passed into the properties of
  BuildSlaves.
  Add a get_config_env Renderer, to allow build Steps to convert
  JSON env variable property to a python dictionary and give to
  the env= argument of some steps.

16 months agobuild: AC_EGREPP_CPP actions wrong way around, worked by accident mostly.
Paul Jakma [Fri, 31 Mar 2017 16:23:22 +0000 (17:23 +0100)]
build: AC_EGREPP_CPP actions wrong way around, worked by accident mostly.

* configure.ac: Sense of actions wrong way around. Guess it worked by accident
  by virtue of any non-GCC compilers being used having GCC still set, or
  else working with SUNPRO cflags.

16 months agobuild: Work around illumos still shipping a prehistoric AWK as default
Paul Jakma [Wed, 15 Mar 2017 15:30:41 +0000 (15:30 +0000)]
build: Work around illumos still shipping a prehistoric AWK as default

* configure.ac: illumos still ships 'oawk' (old AWK) as the default 'awk'.
  A pre-historic version of AWK, from the mists of Unix history (AT&T System
  V Release 4), which Sun kept around deliberately not updating it or fixing
  non-critical bugs, to ensure bug-for-bug compatibility.

  It doesn't support the -F <regex> argument AWK has had since...  slightly
  less deeper in the mist (e.g.  SysV R4.2, shipped as 'nawk' in Solaris and
  illumos).  Only -Fc.

  Joyent apparently has updated the default awk in SmartOS to nawk +
  extensions, and may upstream it to illumos.

16 months agotests: Remove DejaGNU, automake already supports tallying exit based tests
Paul Jakma [Wed, 15 Mar 2017 13:28:09 +0000 (13:28 +0000)]
tests: Remove DejaGNU, automake already supports tallying exit based tests

* Automake already knows how to tally up exit status based tests. There's
  not much point wrapping such unit tests up in a whole ball of tcl and
  expect to scrape the output to determine the same thing and tally.

  Remove the DejaGNU stuff. Run the tests directly from automake, using
  TESTS = ...

  This removes the "check output doesn't differ" testcli and testcommand
  tests from testing, but those were testing exit status of the diff, which
  was succesful anyway.  So would pass even if output differed and should
  fail.

* test-cli.c: Add example usage.
* test-commands.c: ditto. And add missing nodes.

16 months agobuild: LT_INIT obsoletes AC_PROG_RANLIB
Paul Jakma [Tue, 14 Mar 2017 14:20:13 +0000 (14:20 +0000)]
build: LT_INIT obsoletes AC_PROG_RANLIB

16 months agodoc: tweak CSS to Quagga colours
Paul Jakma [Fri, 10 Mar 2017 17:00:28 +0000 (17:00 +0000)]
doc: tweak CSS to Quagga colours

16 months agobgpd: fix file descriptor leaks in vty_close
Evgeny Uskov [Fri, 24 Nov 2017 13:03:32 +0000 (16:03 +0300)]
bgpd: fix file descriptor leaks in vty_close

In vty_close output file descriptor was not properly closed. It caused
file descriptor leak each time an updated config file was saved on disk.

16 months agoFix wrong command persisted by vtysh
Alban Browaeys [Mon, 13 Nov 2017 13:32:31 +0000 (14:32 +0100)]
Fix wrong command persisted by vtysh

Fixes invalid syntax when applying integrated configuration a file
with vtysh -b.

Commit d8aa4beab72cdd2c2d78f9e624fd4b704eec488f ("vtysh: Fix Quagga.conf file read in.")
replaced NULL cmd argument but only in one instance of the cmd_execute_command_strict
call. This patch fixes the second instance.

18 months agoFix malformed AS_SEQUENCE segments for long as path
Eugene Bogomazov [Fri, 13 Oct 2017 13:28:34 +0000 (16:28 +0300)]
Fix malformed AS_SEQUENCE segments for long as path

18 months agoBumped up the version to 1.2.2 quagga-1.2.2
Balaji Gurudoss [Tue, 3 Oct 2017 14:57:10 +0000 (20:27 +0530)]
Bumped up the version to 1.2.2

18 months agobgpd: Fix AS_PATH size calculation for long paths
Andreas Jaggi [Mon, 2 Oct 2017 14:08:43 +0000 (19:38 +0530)]
bgpd: Fix AS_PATH size calculation for long paths

If you have an AS_PATH with more entries than
what can be written into a single AS_SEGMENT_MAX
it needs to be broken up.  The code that noticed
that the AS_PATH needs to be broken up was not
correctly calculating the size of the resulting
message.  This patch addresses this issue.

18 months agozebra: Fix to set tag for a static route configured.
Balaji Gurudoss [Mon, 2 Oct 2017 13:51:57 +0000 (19:21 +0530)]
zebra: Fix to set tag for a static route configured.

Fixes bug #955.

Removed the installation of vrf specific tag and distance command.

Reported by: goodman <gbcbooksmj@gmail.com>

20 months agonhrpd: use hop count 1 for registration requests
Timo Teräs [Thu, 17 Aug 2017 13:55:43 +0000 (16:55 +0300)]
nhrpd: use hop count 1 for registration requests

Cisco has a bug that it rejects packets with zero hop count.
Use one to avoid potential forwarding of registration requests.

21 months agonhrpd: add example nhrp event processing script (in lua)
Timo Teräs [Fri, 14 Jul 2017 08:20:12 +0000 (11:20 +0300)]
nhrpd: add example nhrp event processing script (in lua)

22 months agonhrpd: add few tested kernels, improve readme notes
Timo Teräs [Thu, 15 Jun 2017 06:37:16 +0000 (09:37 +0300)]
nhrpd: add few tested kernels, improve readme notes

22 months agoripd: ripv2 fails to send packets on non multicast interface
Mark [Tue, 19 Jul 2011 16:24:06 +0000 (21:54 +0530)]
ripd: ripv2 fails to send packets on non multicast interface

Fix to resolve ripv2 update process from skipping over non multicast interfaces when sending updates.

Reported by: Christian Hammers <ch@debian.org>

22 months agovtysh:address-family vpnv6 and vpnv6 unicast added to resolve
Balaji Gurudoss [Sat, 13 May 2017 07:35:58 +0000 (13:05 +0530)]
vtysh:address-family vpnv6 and vpnv6 unicast added to resolve
" % Ambiguous command."
Fixes bug #950

Signed-off-by: Balaji Gurudoss <balajig81@gmail.com>
23 months agonhrpd: configure mgre ipv6 nd for nhrp
Timo Teräs [Fri, 19 May 2017 11:08:35 +0000 (14:08 +0300)]
nhrpd: configure mgre ipv6 nd for nhrp

23 months agonhrpd: announce ipv6 routes to zebra
Timo Teräs [Thu, 18 May 2017 09:00:22 +0000 (12:00 +0300)]
nhrpd: announce ipv6 routes to zebra

23 months agonhrpd: Fix crash in 'no nhrp event socket..' command
Donald Sharp [Wed, 17 May 2017 22:31:02 +0000 (18:31 -0400)]
nhrpd: Fix crash in 'no nhrp event socket..' command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
23 months agonhrpd: Fix some missing newlines
Donald Sharp [Thu, 18 May 2017 05:55:51 +0000 (08:55 +0300)]
nhrpd: Fix some missing newlines

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
23 months agonhrp: improve CIE prefix length handling
Timo Teräs [Wed, 3 May 2017 05:40:43 +0000 (08:40 +0300)]
nhrp: improve CIE prefix length handling

RFC2332 states that prefix length MUST be 0xff for unique bindings.
However, it seems at least some Cisco firmwares use host prefix
length instead (which on wire level makes sense). Relax the handling
of prefix length to treat all value longer than address length as
0xff. Additionally treat 0x00 the same way too, this is required
by the RFC. This also fixes the prefix length address family to be
checked against protocol address.

2 years agonhrp: parse and log command response errors from strongSwan
Timo Teräs [Fri, 21 Apr 2017 11:58:17 +0000 (14:58 +0300)]
nhrp: parse and log command response errors from strongSwan

helps to debug configuration problems

2 years agonhrp: fix potential crash when vici profile name is not configured
Timo Teräs [Fri, 21 Apr 2017 11:57:57 +0000 (14:57 +0300)]
nhrp: fix potential crash when vici profile name is not configured

2 years agonhrp: notify 'tunnel protection' changes
Timo Teräs [Fri, 21 Apr 2017 11:56:45 +0000 (14:56 +0300)]
nhrp: notify 'tunnel protection' changes

to triggers refresh of IKE SAs immediately on this command

2 years agonhrp: explicitly cast ints to size_t for vici_request_vc va_list handling
Timo Teräs [Fri, 21 Apr 2017 10:57:28 +0000 (13:57 +0300)]
nhrp: explicitly cast ints to size_t for vici_request_vc va_list handling

2 years agonhrp: fix protocol address family parsing on receive
Timo Teräs [Thu, 20 Apr 2017 13:24:14 +0000 (16:24 +0300)]
nhrp: fix protocol address family parsing on receive

See bugzilla #948

2 years agonhrp: implement 'no ip nhrp map' command
Timo Teräs [Fri, 21 Apr 2017 10:37:07 +0000 (13:37 +0300)]
nhrp: implement 'no ip nhrp map' command

was accidentally not implemented earlier

2 years agonhrpd: implement 'show ip nhrp nhs'
Timo Teräs [Sat, 25 Mar 2017 15:27:24 +0000 (17:27 +0200)]
nhrpd: implement 'show ip nhrp nhs'

2 years agorelease: Quagga 1.2.1 quagga-1.2.1
Paul Jakma [Fri, 10 Mar 2017 12:55:06 +0000 (12:55 +0000)]
release: Quagga 1.2.1

2 years agobuildbot: build documentation, add nightly upload of master docs, other tweaks
Paul Jakma [Thu, 9 Mar 2017 17:58:39 +0000 (17:58 +0000)]
buildbot: build documentation, add nightly upload of master docs, other tweaks

* master.cfg: Add a "build-docs" builder to test generation of HTML and PDF
  docs into the commit checks.  With nightly=true property, upload generated
  docs to a static dir on the master.  Run from a NightlyScheduler.

  Add the properties from the internal worker config to the buildbot
  BuildSlave properties, so they're visible in the web UI. Filter through
  a workers2publicprops helper, to whitelist allowed props.

2 years agodoc: Nearly all the world uses A4 paper, set as default for TeX output
Paul Jakma [Thu, 9 Mar 2017 00:56:32 +0000 (00:56 +0000)]
doc: Nearly all the world uses A4 paper, set as default for TeX output

2 years agodoc: Clean the tex index files up
Paul Jakma [Thu, 9 Mar 2017 00:54:44 +0000 (00:54 +0000)]
doc: Clean the tex index files up

2 years agodoc: Fix overfull hboxes errors that cause PDF build to return fail
Paul Jakma [Wed, 8 Mar 2017 23:31:47 +0000 (23:31 +0000)]
doc: Fix overfull hboxes errors that cause PDF build to return fail

* overfull hboxes cause texi2dvi to return fail, even if the PDf is written.
  We hacked around this by running it with '...  || true', but that
  sucks for buildboting the docs.

  Fix all the overfull hboxes.

* ospfd.texi: Long command definitions can cause hbox overruns in the
  columnar command definitions index.  This leads to strange errors
  about "Missing number, treated as zero." when building the index -
  very hard to figure out.

  'show ip ospf database ...' was the culprit.  Use a distinct deffnx
  alias for each option instead of trying to stuff them into 1 line.

2 years agodoc: Remove refs to removed topology figures
Paul Jakma [Wed, 8 Mar 2017 23:31:03 +0000 (23:31 +0000)]
doc: Remove refs to removed topology figures

2 years agodoc: Explicit quagga.pdf rule can go now
Paul Jakma [Wed, 8 Mar 2017 23:29:08 +0000 (23:29 +0000)]
doc: Explicit quagga.pdf rule can go now

* Makefile.am: The Quagga specific PDF dependency is gone.  The
  overfull boxes that caused texi2dvi to return fail code are gone.  So
  the custom rule can go.

2 years agodoc/routeserver: Remove needless figures, centre and tweak other figs
Paul Jakma [Wed, 8 Mar 2017 22:01:37 +0000 (22:01 +0000)]
doc/routeserver: Remove needless figures, centre and tweak other figs

* routeserver.texi: The full-mesh v RS topology diagrammes are fairly obvious
  and don't deserve so much space.  As smaller wrap-floats they might be
  acceptable, but there seems no way to access that TeX feature from
  Texinfo.  So nuke them.

  Centre the 2 other figures. Tweak size to avoid bbox overflow messages.

2 years agodoc: Tweak internal layout of fig-rs-processing slightly
Paul Jakma [Wed, 8 Mar 2017 21:58:30 +0000 (21:58 +0000)]
doc: Tweak internal layout of fig-rs-processing slightly

2 years agodoc: pdftex works with PNGs now, remove dependency on PDF figures
Paul Jakma [Wed, 8 Mar 2017 21:54:09 +0000 (21:54 +0000)]
doc: pdftex works with PNGs now, remove dependency on PDF figures

* Makefile.am: pdftex seems to work fine with PNGs now. So the need to build
  PDF versions of the figures using ImageMagick convert is gone. Remove
  the dependency. Can leave the rule for now, no benefit removing it.

2 years agoconfigure: Add commonly used GCC security flags
Paul Jakma [Wed, 8 Mar 2017 17:15:58 +0000 (17:15 +0000)]
configure: Add commonly used GCC security flags

2 years agodoc: Add a nice CSS file for HTML texinfo
Paul Jakma [Wed, 8 Mar 2017 17:15:00 +0000 (17:15 +0000)]
doc: Add a nice CSS file for HTML texinfo

2 years agobuildbot: Add revlink to map quagga git repo to Savannah cgit URI
Paul Jakma [Wed, 8 Mar 2017 10:27:54 +0000 (10:27 +0000)]
buildbot: Add revlink to map quagga git repo to Savannah cgit URI

2 years agosolaris/buildbot: Add SMF service manifest for buildbot-slave/worker
Paul Jakma [Tue, 7 Mar 2017 15:25:44 +0000 (15:25 +0000)]
solaris/buildbot: Add SMF service manifest for buildbot-slave/worker

2 years agobuildbot: add OpenIndiana hipster bot
Paul Jakma [Tue, 7 Mar 2017 14:54:28 +0000 (14:54 +0000)]
buildbot: add OpenIndiana hipster bot

2 years agoHACKING: git diff ... | buildbot try example
Paul Jakma [Tue, 7 Mar 2017 14:38:48 +0000 (14:38 +0000)]
HACKING: git diff ... | buildbot try example

2 years agoconfigure: use AC_C_FLAG for Sun Studio cc
Paul Jakma [Tue, 7 Mar 2017 14:35:29 +0000 (14:35 +0000)]
configure: use AC_C_FLAG for Sun Studio cc

2 years agoconfigure: libtool < 2.4.6 doesn't work with fstack-protector-strong
Paul Jakma [Tue, 7 Mar 2017 10:36:14 +0000 (10:36 +0000)]
configure: libtool < 2.4.6 doesn't work with fstack-protector-strong

* configure.ac: GCC -fstack-protector-strong gives undefined symbol error
  when linking on __stack_chk_fail_local with libtool < 2.4.6.  The gcc arg
  is not passed on when linking.  OpenIndiana hipster has 2.4.2 at the
  moment. Test the libtool version and drop the arg and warn the user.

2 years agodoc: make netmasks in 4.3 Static Route Commands the same
Jakub Zawadzki [Sat, 4 Mar 2017 19:41:02 +0000 (20:41 +0100)]
doc: make netmasks in 4.3 Static Route Commands the same

In 4.3 documentation shows example for defining static routes:
--------------------------------------------------------------
  ip route 10.0.0.0/8 10.0.0.2
  (...)
  ip route 10.0.0.0 255.255.255.0 10.0.0.2
  (...)
  These statements are equivalent to those in the previous example.
--------------------------------------------------------------

10.0.0.0/8 is not equivalent to 10.0.0.0/255.255.255.0, fix it.

should fix #811 after html regenerating.

2 years agovtysh: Bug 789 - vtysh ripngd does not have distribute-list command
Jakub Zawadzki [Sat, 4 Mar 2017 18:43:46 +0000 (19:43 +0100)]
vtysh: Bug 789 - vtysh ripngd does not have distribute-list command

Make commands added by distribute_list_init() from ripd/ripngd daemon known
to vtysh.

Babeld leftovers not included, also other commands (show, write) from
bug #789 not included.

2 years agoinfra/buildbot: fix "for w workers", use common defs for common sets
Paul Jakma [Sun, 5 Mar 2017 14:53:59 +0000 (14:53 +0000)]
infra/buildbot: fix "for w workers", use common defs for common sets

2 years agoinfra/buildbot: Add initial RPM check builders
Paul Jakma [Sun, 5 Mar 2017 14:27:11 +0000 (14:27 +0000)]
infra/buildbot: Add initial RPM check builders

* master.cfg: Add an initial RPM rpm check builders, to run rpmlint and
  rpmbuild tests on builders with "pkg" == "rpm".
  some issues in buildbot (least on F24):
  - RpmLint doesn't get imported, have to run manually.
  - RpmBuild always sets 'dist', it shouldn't really. urg.
  - RpmBuild 'rpmdir' argument doesn't get Interpolated, so can't
    put the built RPMs cleanly into a distinct directory.

  When fixed, can auto-publish RPMs. For now, just check.

2 years agodistro/redhat: Allow for split info files
Paul Jakma [Sun, 5 Mar 2017 13:33:25 +0000 (13:33 +0000)]
distro/redhat: Allow for split info files

2 years agodistro/redhat: Make texi2html conditional, default off, to avoid TeX deps
Paul Jakma [Sun, 5 Mar 2017 12:39:41 +0000 (12:39 +0000)]
distro/redhat: Make texi2html conditional, default off, to avoid TeX deps

2 years agodistro/redhat: fix rpmlint warnings
Paul Jakma [Sun, 5 Mar 2017 10:21:02 +0000 (10:21 +0000)]
distro/redhat: fix rpmlint warnings

* quagga.spec.in: Use %global when defining globals inside conditional
  blocks.
  Comment Obsoletes as rpmlint wants specific versions. The packages are
  long gone, but leave as historical documentation.
  Don't use %version in changelog entries, or other live macros.
  Fix spaces-for-indent everywhere, use tab (sorry spaces people).

2 years agoinfra/patchwork: systemd files and production.py settings
Paul Jakma [Sat, 4 Mar 2017 15:09:41 +0000 (15:09 +0000)]
infra/patchwork: systemd files and production.py settings

* systemd/patchwork-delivery*: on demand socket to take mail in a localhost
  TCP socket, to allow patchwork to be in a separate container from
  email.
* production.py: patchwork.settings.production file.
* pass.py: example pass.py file

2 years agoinfra: buildbot master configs and slave systemd service file
Paul Jakma [Sat, 4 Mar 2017 14:30:44 +0000 (14:30 +0000)]
infra: buildbot master configs and slave systemd service file

* master: master.cfg and example pass.cfg file
* worker: systemd service unit file.

  Setting up a slave/worker is trivial:

  su - buildbot
  buildslave create-slave . radia.quagga.net buildbot-<name> <password>

2 years agoHACKING: fix indentation in URLs list, remove super obsolete import section
Paul Jakma [Sat, 4 Mar 2017 00:10:30 +0000 (00:10 +0000)]
HACKING: fix indentation in URLs list, remove super obsolete import section

2 years agoHACKING: example config for buildbot client and usage for 'try' command
Paul Jakma [Sat, 4 Mar 2017 00:08:19 +0000 (00:08 +0000)]
HACKING: example config for buildbot client and usage for 'try' command

2 years agobuild: Fix distcheck errors
Paul Jakma [Fri, 3 Mar 2017 18:08:03 +0000 (18:08 +0000)]
build: Fix distcheck errors

* doc/Makefile.am: Clean up the info files.  Ignore errors with DVI
  building, who cares.

* tests/Makefile.am: cleanup stuff to fix distcleancheck

2 years agodoc: stop generating defines.texi from configure
Paul Jakma [Sat, 4 Mar 2017 00:11:57 +0000 (00:11 +0000)]
doc: stop generating defines.texi from configure

* generating defines.texi from configure means quagga.info will always have
  to be rebuilt by end-users, even from dist tarballs. Also breaks
  distcheck assumptions that info won't need to be built - which can be
  fixed with 'info-in-builddir' automake option, but that's too recent
  to rely on.
* doc/defines.texi.in: nuke
* doc/defines.texi: Add static version.
* {doc/Makefile.am,configure}: nuke autogen of above
* doc/quagga.texi: remove the 1 use of PACKAGE_STRING