]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
12 years agoRevert "ospfd: Do not fall back to intervening router."
Paul Jakma [Mon, 6 Aug 2012 11:17:12 +0000 (12:17 +0100)]
Revert "ospfd: Do not fall back to intervening router."

This reverts commit 9289c6ff55cd96c943d23e43fc9e5f987aa965ed.

The commit reverted an earlier change which was fixed a bug that caused
black-holes to remote destinations with multiple paths, that could occur
during convergence. Overall, the previous code is more correct.

12 years agolib/table: add route_table_get_next() and iterator
Avneesh Sachdev [Fri, 17 Aug 2012 15:19:50 +0000 (08:19 -0700)]
lib/table: add route_table_get_next() and iterator

  * lib/table.[ch]

    - Add a function (route_table_get_next()) to get the route_node in
      a tree that succeeds a given prefix in iteration order.

      This allows one to reliably walk nodes in a tree while allowing
      modifications, and is useful for achieving scale and
      performance. Other approaches are also possible -- the main plus
      point of this one is that it does not require any state about
      the walk to be maintained in the table data structures.

    - Add an iterator for walking the nodes in a tree. This introduces
      a new structure (route_table_iter_t) and the following main
      functions.

        route_table_iter_init()
        route_table_iter_pause()
        route_table_iter_next()
        route_table_iter_cleanup()

      The iterator normally uses node pointers and the existing
      route_next() function to walk nodes efficiently. When an
      iteration is 'paused' with route_table_iter_pause(), it stores
      the last prefix processed. The next call to
      route_table_iter_next() transparently invokes
      route_table_get_next() with the prefix to resume iteration.

  * bgpd/bgp_table.[ch]

    Add wrappers for the new table features described above.

  * tests/table_test.c

    Add tests for the new table code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: make bgp_table a wrapper around table library
Avneesh Sachdev [Fri, 17 Aug 2012 15:19:49 +0000 (08:19 -0700)]
bgpd: make bgp_table a wrapper around table library

Make the BGP table code a thin wrapper around the table implementation
in libzebra.

  * bgpd/bgp_table.[ch]

    - Use the ROUTE_NODE_FIELDS macro to embed the fields of a
      route_node in the bgp_node structure.

    - Add a route_table field to the bgp_table structure.

      Initialize the route_table with a delegate, such that the nodes
      in the table are bgp_node structures.

    - Add inline wrappers that call route_table functions underneath,
      and accept/return the correct BGP types.

  * bgpd/bgp_route.c

    Change some code to use inline wrappers instead of accessing
    fields of nodes/tables directly. The latter does not always work
    because the types of some fields need to be translated now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agolib: prepare table code for reuse by bgp_table
Avneesh Sachdev [Fri, 17 Aug 2012 15:19:48 +0000 (08:19 -0700)]
lib: prepare table code for reuse by bgp_table

  * lib/table.[ch]

    - Add a macro (ROUTE_NODE_FIELDS) that expands to all the fields
      of a route_node structure.

    - Add the route_table_delegate_t structure, a function vector
      which allows clients to customize the behavior of one or more
      tables.

      The delegate currently contains the 'create_node' and
      'destroy_node' functions, and hence enables a table to use an
      alternative node structure. The alternative node is expected to
      embed the fields of a route_node using ROUTE_NODE_FIELDS.

    - Add route_table_init_with_delegate() to create a new table with
      a given delegate.

    - Make route_table_init() a thin wrapper around
      route_table_init_with_delegate(). The delegate it passes in
      simply creates/destroys route_node structures as before.

    - Add a user data pointer (info) to the route_table
      structure. This can be used by a client to keep per-table state.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agolib: bring some changes over from bgp_table to table
Avneesh Sachdev [Fri, 17 Aug 2012 15:19:47 +0000 (08:19 -0700)]
lib: bring some changes over from bgp_table to table

  * lib/table.c

    - Maintain table node count. Expose it via the route_table_count()
      function (from revision cbdfbaa5).

    - route_unlock_node(): Add assertion (from revision 228da428).

    - route_table_free(): Make static and fix up cleanup code (from
      revision 228da428).

    - route_node_delete(): Change to be static.

    - Add 'const' qualifier in a couple places.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobuild: fix extract.pl for cross compilation
Serj Kalichev [Fri, 7 Sep 2012 09:29:42 +0000 (13:29 +0400)]
build: fix extract.pl for cross compilation

extract.pl should invoke the C preprocessor for the target system, not the
host.

* vtysh/extract.pl.in: use @CPP@ to get target cpp

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agoripd: clear sockaddr_in before using
Nick Hilliard [Sat, 18 Aug 2012 15:10:57 +0000 (15:10 +0000)]
ripd: clear sockaddr_in before using

ripd_create_socket() failed in bind() on Mac OS X 10.7 since there was garbage
in unused fields of struct sockaddr_in.

* ripd/ripd.c: zero out struct sockaddr_sin from before filling.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobuild: fix autoconf multicast check on OpenBSD
Brad Smith [Thu, 9 Aug 2012 00:44:28 +0000 (00:44 +0000)]
build: fix autoconf multicast check on OpenBSD

Fix the "BSD struct ip_mreq hack" autoconf test to work with OpenBSD.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobuild: correct libtool parameter used within Makefiles
Brad Smith [Thu, 9 Aug 2012 00:40:09 +0000 (00:40 +0000)]
build: correct libtool parameter used within Makefiles

This corrects the parameters passed to libtool when linking
the shared libraries. The paramter name is -version-info not
-version.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agoospfd: Do not fall back to intervening router.
Joakim Tjernlund [Sat, 7 Jul 2012 15:06:14 +0000 (17:06 +0200)]
ospfd: Do not fall back to intervening router.

The patch in bug 330 did two things. It add a return value
whether ospf_nexthop_calculation() failed or not and also
moved the return stmt for 16.1.1 para 5 so now SPF
will fallback to the intervening router when no back links are found
by 16.1.1 para 5. This is wrong and can potentially create black holes
or routing loops according to Dave Katz and Acee Lindem at ospf@ietf.org

Even if the current code could be proved to be harmless in all cases,
it adds substantial extra processing and memory allocations.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agoospfd: use ZEBRA_NEXTHOP_IPV4_IFINDEX
Joakim Tjernlund [Sat, 7 Jul 2012 15:06:13 +0000 (17:06 +0200)]
ospfd: use ZEBRA_NEXTHOP_IPV4_IFINDEX

OSPF really needs to specify interface in its routes. Otherwise
ospf may change the wrong route.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
[fixed up some whitespace errors, split patch in two]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agozebra: Add support for ZEBRA_NEXTHOP_IPV4_IFINDEX
Joakim Tjernlund [Sat, 7 Jul 2012 15:06:13 +0000 (17:06 +0200)]
zebra: Add support for ZEBRA_NEXTHOP_IPV4_IFINDEX

Actually implement the IPV4_IFINDEX nexthop type that has been drifting
around as a definition forever (without any warning about it being a
placeholder).

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agoospf_spf_process_stubs: use LSA pos to find OSFP interface
Joakim Tjernlund [Sat, 7 Jul 2012 15:06:12 +0000 (17:06 +0200)]
ospf_spf_process_stubs: use LSA pos to find OSFP interface

This is better than a prefix lookup as prefixes may not be
unique, that is, the same prefix can exist on several interfaces.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agoospfd: Optimize and improve SPF nexthop calculation
Joakim Tjernlund [Sat, 7 Jul 2012 15:06:11 +0000 (17:06 +0200)]
ospfd: Optimize and improve SPF nexthop calculation

Maintain router LSA positions in OSPF interface.
Find the OSPF interface in nexthop_calculation using
the position in the router LSA. This is possible because
the only time nexthop_calculation needs to look up interfaces
is when dealing with its own Router LSA.

This has the following advantages:
 - Multiple PtP interfaces with the same IP address between two routers.
 - Use Unnumbered PtP on just one end of the link.
 - Faster OI lookup for the OSPF interface and only
   done once for PtoP links.

*ospf_interface.h: (struct ospf_interface) Add storage for
   storing router LSA position.

*ospf_interface.c: (ospf_if_lookup_by_lsa_pos)
   lookup OSPF I/F in an area using LSA position.

*ospf_lsa.c: (router_lsa_link_set) record Router LSA position.

*ospf_spf.c: (ospf_spf_next) Count and pass along lsa position.
     (ospf_nexthop_calculation) Add lsa position argument.
     call ospf_if_lookup_by_lsa_pos() for OSFP interface handle.
     Clean up and remove all calls ospf_if_is_configured() the
     rest. Adjust a few debug logs.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agoospfd: avoid exhausting memory with OSPF vertices (BZ#476)
David Lamparter [Mon, 23 Jul 2012 16:17:57 +0000 (18:17 +0200)]
ospfd: avoid exhausting memory with OSPF vertices (BZ#476)

This was found in scale testing at OSR;  ospfd is adding the same link
over and over again to the SPF tree.  This fix prevents the resulting
memory corruption from happening and adds a debug message to track
occurence of this issue and/or confirm a proper fix.

(This version was improved by Scott Feldman over the earlier RFC.)

* ospfd/ospf_spf.c: (ospf_spf_add_parent) loop over existing vertices
  and refuse to add duplicates.

Tested-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agolib: make IPv6 prefix parser slightly more strict
David Lamparter [Thu, 19 Jul 2012 14:11:50 +0000 (16:11 +0200)]
lib: make IPv6 prefix parser slightly more strict

This makes it possible to have both "show babel route A.B.C.D/M"
and "show babel route X:X::X:X/M" commands at the same time without
the parser complaining about ambiguity.

* lib/command.c: only accept STATE_DOT after : was seen.

Reported-by: Juliusz Chroboczek <jch@pps.jussieu.fr>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobuild: fix isisd topology out of tree build
David Lamparter [Thu, 19 Jul 2012 10:58:59 +0000 (12:58 +0200)]
build: fix isisd topology out of tree build

isisd got the include directory wrong on building with a separate build
directory.

  * configure.ac: adjust ISIS_TOPOLOGY_INCLUDES

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agozebra: lingering IP address after deletion (BZ#486)
David Lamparter [Mon, 1 Feb 2010 15:41:26 +0000 (16:41 +0100)]
zebra: lingering IP address after deletion (BZ#486)

zebra address bookkeeping is a mess. this is just a workaround to have
IPv4 address deletion somewhat working on Linux.

the if_unset_prefix call is synchronous, when it returns success the
address deletion completed successfully. this is either signaled by a
netlink ACK or by an OK return value from ioctl().

This version is wrapped by #ifdef HAVE_NETLINK so we don't touch the
BSDs for now.

* zebra/interface.c: On Linux, update zebra internal state after
  deleting an address.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agoconfigure: Add --with-pkg-extra-version=VER for packagers/distributions.
Joachim Nilsson [Wed, 30 May 2012 06:15:48 +0000 (08:15 +0200)]
configure: Add --with-pkg-extra-version=VER for packagers/distributions.

This change adds a --with-pkg-extra-version option to ./configure to allow
packagers and distributions to fine tune the version displayed to the end
user to assist in support. It is also very useful when reporting bugs on
the official Quagga mailing lists.

There are two ways of utilsing this functionality:

      a) ./configure --with-pkg-extra-version=-wmo1
      b) EXTRAVERSION=-wmo1 ./configure

The latter is a common way for many distributions to add extra version
strings to signify their own patch level to a given package.

Also, minor whitespace fix in configure summary.

Signed-off-by: Joachim Nilsson <joachim.nilsson@westermo.se>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agoMerge remote branch 'vincentbernat/feature/ospfv3-mib'
David Lamparter [Fri, 13 Jul 2012 12:05:55 +0000 (14:05 +0200)]
Merge remote branch 'vincentbernat/feature/ospfv3-mib'

12 years agoMerge remote branch 'vincentbernat/feature/agentx'
David Lamparter [Fri, 13 Jul 2012 12:05:36 +0000 (14:05 +0200)]
Merge remote branch 'vincentbernat/feature/agentx'

12 years agoospf6d: fix segfault when requesting inexistant interfaces or areas
Vincent Bernat [Tue, 10 Jul 2012 07:27:57 +0000 (09:27 +0200)]
ospf6d: fix segfault when requesting inexistant interfaces or areas

12 years agoospf6d: add SNMP notifications/traps support
Vincent Bernat [Mon, 4 Jun 2012 12:36:12 +0000 (14:36 +0200)]
ospf6d: add SNMP notifications/traps support

Only implement ospfv3NbrStateChange and ospfv3IfStateChange.

12 years agoospf6d: add SNMP support for ospfv3*LsdbTable
Vincent Bernat [Mon, 4 Jun 2012 10:59:20 +0000 (12:59 +0200)]
ospf6d: add SNMP support for ospfv3*LsdbTable

This includes:
 - ospfv3AsLsdbTable
 - ospfv3AreaLsdbTable
 - ospfv3LinkLsdbTable

12 years agoospf6d: add SNMP implementation of ospfv3IfTable
Vincent Bernat [Mon, 4 Jun 2012 09:40:04 +0000 (11:40 +0200)]
ospf6d: add SNMP implementation of ospfv3IfTable

12 years agoospf6d: complete SNMP implementation of ospfv3AreaTable
Vincent Bernat [Mon, 4 Jun 2012 08:29:49 +0000 (10:29 +0200)]
ospf6d: complete SNMP implementation of ospfv3AreaTable

12 years agoospf6d: complete SNMP implementation for scalar objects
Vincent Bernat [Fri, 1 Jun 2012 09:38:34 +0000 (11:38 +0200)]
ospf6d: complete SNMP implementation for scalar objects

12 years agoospf6d: add SNMP support for ospfv3NbrTable
Vincent Bernat [Thu, 31 May 2012 18:21:15 +0000 (20:21 +0200)]
ospf6d: add SNMP support for ospfv3NbrTable

12 years agosnmp: fix OSPFV3-MIB implementation
Vincent Bernat [Tue, 22 May 2012 11:34:24 +0000 (13:34 +0200)]
snmp: fix OSPFV3-MIB implementation

Use the real MIB from RFC 5643. Fix used ASN1 types. Indexes are not
exported any more (they are "no access"). Fix some endian
issues. Also, ID are just integers, not IPv4 addresses.

No additional OID are supported in this commit.

12 years agosnmp: let handlers accept OID from a lesser prefix
Vincent Bernat [Thu, 31 May 2012 11:30:28 +0000 (13:30 +0200)]
snmp: let handlers accept OID from a lesser prefix

Most table handlers do not expect to be given an OID whose prefix is
outside what they can handle. This is not a problem with the SMUX
implementation since it always correct the OID such that the prefix
matches. However, this is not the case for the AgentX
implementation. A new function, smux_header_table() is used to do this
normalization.

12 years agoagentx: add appropriate documentation
Vincent Bernat [Fri, 25 May 2012 10:04:51 +0000 (12:04 +0200)]
agentx: add appropriate documentation

12 years agoagentx: handle SNMP traps
Vincent Bernat [Fri, 25 May 2012 09:17:01 +0000 (11:17 +0200)]
agentx: handle SNMP traps

smux_trap() signature has been changed to provide appropriate level
information to send SNMPv2 notifications. This includes the addition
of the enterprise OID to use (from which is derived the SNMP trap OID)
and the MIB registry to locate the appropriate function for variable
bindings provided by the trap.

The SMUX implementation has been updated but ignore the provided
enterprise OID. Instead, it still uses the SMUX peer OID to keep
compatibility with previous versions of Quagga. The SMUX
implementation also ignores the provided MIB registry since it uses
smux_get() function to grab the appropriate values. This is not
possible with the AgentX implementation since there is no such
function provided by NetSNMP.

12 years agosmux: drop findVar element from trap object struct
Vincent Bernat [Fri, 25 May 2012 06:56:44 +0000 (08:56 +0200)]
smux: drop findVar element from trap object struct

This element was not unused.

12 years agosmux: remove `tick` argument from smux_trap()
Vincent Bernat [Thu, 24 May 2012 19:22:01 +0000 (21:22 +0200)]
smux: remove `tick` argument from smux_trap()

smux_trap() contains an argument whose use appears to be to set
sysUpTime.0/timestamp field in SNMP trap. However, this value is not
used in smux_trap(). Moreover, it is expected that this field is the
value of sysUpTime.0 when the trap was sent and not any other time
related to the trap. To avoid any confusion, we remove this field from
the signature of the function.

12 years agoagentx: add AgentX support to Quagga.
Vincent Bernat [Thu, 24 May 2012 07:44:43 +0000 (09:44 +0200)]
agentx: add AgentX support to Quagga.

--enable-snmp will enable AgentX support in Quagga. SMUX is still here
and can be enabled with --enable-snmp=smux. AgentX support can be
enabled with "agentx" in configuration file. As for SMUX, this command
is not understood by vtysh. It can be disabled with "no agentx",
though there is no real use of this since this command cannot be used
with vtysh.

If "agentx" and "no agentx" command were added to vtysh, it would not
be possible to disable agentx support after enabling it because
NetSNMP does not expose the appropriate methods for this.

The internals of AgentX are hidden by NetSNMP. Therefore, we don't
have a file descriptor to add to the threading system. We do not have
the timers to set either. Therefore, the event loop is modified to
make use of snmp_select_info() from NetSNMP.

Traps are not supported yet.

12 years agosmux: isolate SMUX implementation from SNMP implementation
Vincent Bernat [Tue, 22 May 2012 22:52:46 +0000 (00:52 +0200)]
smux: isolate SMUX implementation from SNMP implementation

lib/snmp.c gets OID related helper functions that can be used with
another SNMP interface. smux.h is cleaned of SMUX specific bits to
only expose functions that may be used by an alternative
implementation. We also do not redefine functions already present in
NetSNMP. Just use the appropriate headers.

12 years agobuild: use net-snmp-config to configure NetSNMP
Vincent Bernat [Tue, 22 May 2012 20:29:17 +0000 (22:29 +0200)]
build: use net-snmp-config to configure NetSNMP

The correct method to link to NetSNMP is to use net-snmp-config (which
is like pkg-config). Explicit link to libcrypto is also dropped
(NetSNMP libs are linked to libcrypto, no need to link Quagga to
it). Moreover, @SNMP_INCLUDES@ is dropped because useless. Due to a
bug in configure.ac, it was properly populated.

12 years agobuild: only define HAVE_SNMP
Vincent Bernat [Tue, 22 May 2012 20:15:20 +0000 (22:15 +0200)]
build: only define HAVE_SNMP

NetSNMP is the only SNMP implementation for Quagga. We don't need two
different symbols.

12 years agobuild: allow configure and build in a separate directory
Vincent Bernat [Tue, 22 May 2012 12:32:22 +0000 (14:32 +0200)]
build: allow configure and build in a separate directory

Some .h files in lib/ are autogenerated. The search path should
include the build directory and the source directory. They usually
match but sometimes, they may be different. For example:

 $ mkdir build
 $ cd build
 $ ../configure
 $ make

12 years agoisisd: fix typo in topology generator (BZ#731)
David Lamparter [Thu, 21 Jun 2012 07:55:38 +0000 (09:55 +0200)]
isisd: fix typo in topology generator (BZ#731)

There was a "lsp->" missing before "level" in line 2416.
(introduced by git commit e38e0df)

Reported-by: Seblu <seblu@seblu.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: Partially revert f018db8, fixes BZ#730
Jorge Boncompte [DTI2] [Wed, 20 Jun 2012 14:34:01 +0000 (16:34 +0200)]
bgpd: Partially revert f018db8, fixes BZ#730

  The change from bgp_node_get() to bgp_node_lookup() broke aggregation.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Tested-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: Fix for commit 6a4677b7, fixes BZ#729
Jorge Boncompte [DTI2] [Wed, 20 Jun 2012 15:45:50 +0000 (17:45 +0200)]
bgpd: Fix for commit 6a4677b7, fixes BZ#729

  The timers are rearmed after events processing. After 6a4677b7 we
do not generate events that can rearm the holdtime timer.

  Fix it's to call bgp_timer_set() directly as it's done from bgp_event().

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Tested-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agotests: BGP unit tests to set BGP_OPT_NO_LISTEN so they can run
Paul Jakma [Thu, 14 Jun 2012 09:42:39 +0000 (10:42 +0100)]
tests: BGP unit tests to set BGP_OPT_NO_LISTEN so they can run

BGP tests had been broken by auto-creation of listen socket. This allows
them to run at least, though at least 1 test seems to have other breakage,
aspath_test.

12 years agobgpd: Add "no listen" socket option for the BGP master configuration
Paul Jakma [Thu, 14 Jun 2012 09:40:26 +0000 (10:40 +0100)]
bgpd: Add "no listen" socket option for the BGP master configuration

* bgpd.h: add a BGP_OPT_NO_LISTEN option for the master BGP configuration,
  to prevent any listen socket being created automatically. Allows code
  to be used outside of BGP daemon settings.
* bgpd.c: (bgp_get) honour above the flag, suppress auto-creation of listen
  socket on first BGP instance if set.
  (bgp_option_set) whitelist BGP_OPT_NO_LISTEN

12 years agolib: Add back sockunion_str2su
Paul Jakma [Thu, 14 Jun 2012 09:37:40 +0000 (10:37 +0100)]
lib: Add back sockunion_str2su

* sockunion.h: Add back sockunion_str2su, its removal breaks things needlessly
  (e.g. our own unit tests).
* sockunion.c: (sockunion_str2su) implement on top of str2sockunion.

12 years agoRevert "bgpd: Make socket init separate, so unit tests work again."
Paul Jakma [Wed, 13 Jun 2012 21:50:07 +0000 (22:50 +0100)]
Revert "bgpd: Make socket init separate, so unit tests work again."

This reverts commit 7621f336e2f346edee43227f0b1ef93fe769720b. See bug #727

12 years agolib: do not allocate/free thread funcnames
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:14 +0000 (16:53 +0000)]
lib: do not allocate/free thread funcnames

  This avoids memory heap fragmentation and imposses less load on the
system memory allocator.

* thread.h: FUNCNAME_LEN defined to 64 (ISO C99 says max 63)

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[changed FUNCNAME_LEN to a less arbitrary value]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agolib: micro-op for thread_get()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:13 +0000 (16:53 +0000)]
lib: micro-op for thread_get()

thread_trim_head() already checks that the list is not empty.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agolib: remove RUSAGE_T from struct thread
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:12 +0000 (16:53 +0000)]
lib: remove RUSAGE_T from struct thread

* thread.c: It's only temporarily used in thread_call() to calculate the
  diffs. Saves 80 bytes per copy.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agomicro-op bgp_node_[get|lookup]() and route_node_[get|lookup]()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:11 +0000 (16:53 +0000)]
micro-op bgp_node_[get|lookup]() and route_node_[get|lookup]()

  Reduce indirection for values that doesn't change in the loop.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[adjusted after dropping previous patch]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: optimize bgp_aggregate_[increment|decrement]()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:10 +0000 (16:53 +0000)]
bgpd: optimize bgp_aggregate_[increment|decrement]()

  If there were no aggregates configured this functions were allocating
and freeing a struct bgp_node for every call, and it's called for every
prefix received.

* bgp_route.c: Bail out early if the there are no aggregates configured.
  Change from bgp_node_get() to bgp_node_lookup() that does not allocate
  a new struct bgp_node if not found.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: optimize bgp_update_main() in the soft_reconfig case
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:08 +0000 (16:53 +0000)]
bgpd: optimize bgp_update_main() in the soft_reconfig case

Avoids 3 checks per call.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: optimize holdtime timer cancelling
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:07 +0000 (16:53 +0000)]
bgpd: optimize holdtime timer cancelling

* bgp_packet.c: (bgp_update_receive) for every update received we queue
  an event just to cancel the holdtime timer, done in bgp_fsm_update().
  Instead cancel the timer directly an avoid a scheduling pass.

  This incidently fixes another problem found on a slow box, where thousands
of events threads were queued, and run, but never freed, because they are
moved to the unused list that grows without bounds.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: Remove useless initialization
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:06 +0000 (16:53 +0000)]
bgpd: Remove useless initialization

It's initialized below

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: reduce struct attr_extra allocations/freeing
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:05 +0000 (16:53 +0000)]
bgpd: reduce struct attr_extra allocations/freeing

Try to use on stack structs for temporary uses.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: use on stack struct attr_extra in bgp_update_receive()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:03 +0000 (16:53 +0000)]
bgpd: use on stack struct attr_extra in bgp_update_receive()

Reduce memory heap fragmentation and pressure on the memory allocator.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: fix struct attr_extra leak in bgp_default_originate()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:02 +0000 (16:53 +0000)]
bgpd: fix struct attr_extra leak in bgp_default_originate()

  The call to bgp_attr_default_set() above creates the attr_extra struct,
but the attr.extra = NULL initialization was leaking it.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: use on stack struct attr_extra in bgp_attr_unintern()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:01 +0000 (16:53 +0000)]
bgpd: use on stack struct attr_extra in bgp_attr_unintern()

  Reduce memory heap fragmentation and pressure on the memory allocator.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: cleanup bgp_attr_unintern()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:53:00 +0000 (16:53 +0000)]
bgpd: cleanup bgp_attr_unintern()

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: use on stack struct attr_extra on bgp_attr_aggregate_intern()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:52:59 +0000 (16:52 +0000)]
bgpd: use on stack struct attr_extra on bgp_attr_aggregate_intern()

Reduce memory heap fragmentation and pressure on the memory allocator.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: reduce attrhash_make_key() indirections
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:52:58 +0000 (16:52 +0000)]
bgpd: reduce attrhash_make_key() indirections

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: remove some useless initializations
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:52:57 +0000 (16:52 +0000)]
bgpd: remove some useless initializations

* bgp_attr.c: (bgp_attr_default_intern) bgp_attr_default_set() already
  initializes the memory. Fixes a struct attr_extra leak.
* bgp_route.c: Remove useless on stack struct initializations.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: optimize bgp_info_cmp()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:52:56 +0000 (16:52 +0000)]
bgpd: optimize bgp_info_cmp()

* bgp_route.c: (bgp_info_cmp) Reduce indirections, precalculate some
  values that are used several times, reduce conditionals.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: optimize loops on [e]community_hash_make()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:52:55 +0000 (16:52 +0000)]
bgpd: optimize loops on [e]community_hash_make()

  This change reduces loop count. Less jumps.

* bgp_community.c: One loop per community.
* bgp_ecommunity.c: One loop per ecommunity.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: remove calls to peer_sort() from fast-path
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:52:54 +0000 (16:52 +0000)]
bgpd: remove calls to peer_sort() from fast-path

  peer_sort() it's called so much as to be annoying. In the assumption
that the 'sort' of the peer doesn't change during an established session,
I have changed all calls to peer_sort() in the 'fast-path' to only check
the 'sort'. All the calls from the vty and such still recalculate the sort
and store it in the peer.

  There's a lot of other calls to peer_sort() that could be changed but some
maube tricky, someone more knowledgeable may try to reduce them.

  This hits peer_sort() from 5th out of the stadium^H^H list on a full
internet table loading profiling session.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: debug buffers cleanup and optimization
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:52:53 +0000 (16:52 +0000)]
bgpd: debug buffers cleanup and optimization

Just the first change pushes bgp_update_receive() from 6th to ~14th on a
full internet table load profiling session.

* bgp_debug.c: (bgp_update_receive) The attrstr initialization is expensive,
  moved under the debug conditional where it is used and just initialize the
  first char to NULL.
  (bgp_update_default_send) Initialize attrstr needed for bgp_dump_attr().
  Moved some buffers used for printing IP[4|6] addresses under the debug
  conditionals that use them and reduced its size.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: optimize bgp_nexthop_self()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:52:52 +0000 (16:52 +0000)]
bgpd: optimize bgp_nexthop_self()

  This function scores 2nd, profiling a full internet table load. It's called
for every prefix received.
  Instead of looping in the interface lists comparing addresses use a hash
to mantain them.

* bgpd.c: Init the own address hash.
* bgp_nexthop.c: Introduce methods to maintain an own address hash.
  (bgp_connected_add) add addresses to the hash.
  (bgp_connected_delete) delete addresses from the hash.
  (bgp_nexthop_self) lookup addresses in the hash. Removed the unused afi_t
  parameter.
* bgp_route.c: (bgp_update_main) Micro-optimization, rearranged condition to
  not lookup the hash for bogus nexthops (0.0.0.0 or a class D/E address)

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: optimize aspath string representation and assegments handling
Jorge Boncompte [DTI2] [Mon, 7 May 2012 16:52:51 +0000 (16:52 +0000)]
bgpd: optimize aspath string representation and assegments handling

* bgp_aspath.h: Add str_len to struct aspath.
* bgp_aspath.c: Save the aspath string representation length and use it
  instead of strlen().
  (aspath_make_str_count) assign the string buffer directly for
  consistency with the string length and change the return type to void.
  (aspath_dup) use str_len and copy the string instead of calling
  aspath_make_str_count().
  (assegment_data_new) change from XCALLOC to XMALLOC. All users initialize
  the memory before use.
  (assegment_data_free) unused, removed.
  (aspath_intern) check that there's always a ->str pointer.
  (aspath_hash_alloc) reuse assegments and string representation instead of
  copying them.
  (aspath_parse) now aspath_hash_alloc does not dupes memory, free the
  temporary structures only if the aspath it is in the hash.
  (aspath_cmp_left) remove useless NULL initialization.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agobgpd: fix crash with vpnv4 soft-reconfiguration
Jorge Boncompte [DTI2] [Mon, 7 May 2012 15:17:34 +0000 (15:17 +0000)]
bgpd: fix crash with vpnv4 soft-reconfiguration

bgp_afi_node_get() expects a non-NULL prd for a SAFI_MPLS_VPN prefix.

* bgp_route.c: pass down the struct prefix_rd from bgp_soft_reconfig_in()
  and bgp_soft_reconfig_rsclient().

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agolib: fix thread_cancel_event()
Jorge Boncompte [DTI2] [Mon, 7 May 2012 15:17:31 +0000 (15:17 +0000)]
lib: fix thread_cancel_event()

  ospfd was crashing some times on neighbour going down. The cause was that
ospf_nsm_event() was accessing already freed memory in ospf_nbr_delete()
call from ospf_nsm_event().

  What happens is that since commit b5043aab (lib: fix incorrect thread
list...) now a thread can be on the event and ready lists but
thread_cancel_event() doesn't account for that.

* thread.c: (thread_cancel_event) loop on the ready list too to cancel
  pending events.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agolib: drop heuristic IPv6 address recognition
Roman Hoog Antink [Wed, 9 May 2012 06:35:34 +0000 (06:35 +0000)]
lib: drop heuristic IPv6 address recognition

* command.c: (cmd_ipv6_match) Drop IPv6 address recognition
  heuristics and solely rely on inet_pton, because strings
  like "abcd" were mistaken for IPv6 addresses.
  This affects e.g. the command "neighbour WORD peer-group",
  which won't work with words consisting of up to 4 characters
  between 'a' and 'f' and digits.

From: Roman Hoog Antink <rha@open.ch>
[full delete instead of #if 0]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agozebra: fix up compilation without rtadv/IPv6
Joachim Nilsson [Wed, 9 May 2012 11:38:36 +0000 (13:38 +0200)]
zebra: fix up compilation without rtadv/IPv6

let's ground the rtadv.h file if route advertisements are disabled. And
fix up the CLI for it, as well as move the "show ip mroute" to its
proper place.

  * zebra/rtadv.h: #ifdef RTADV
  * zebra/main.c: #ifdef RTADV
  * zebra/zebra_vty.c: move "show ip mroute" out of #ifdef IPV6

From: Joachim Nilsson <troglobit@gmail.com>
[moved #ifdef RTADV to rtadv.h]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 years agozebra: feed Connected routes into MRIB
G.Balaji [Mon, 2 Apr 2012 18:01:29 +0000 (23:31 +0530)]
zebra: feed Connected routes into MRIB

The SAFI_MULTICAST RIB needs to contain Connected routes so that the
nexthop lookup does not fail and so that multicast routing daemons do
not need to sidestep and look into SAFI_UNICAST to be aware of connected
subnets.

  * zebra/connected.c: add & delete connected in SAFI_MULTICAST

Signed-off-by: G.Balaji <balajig81@gmail.com>
[merged add/delete patches]
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agozebra: no need to clear memory of the netlink buffers
Jorge Boncompte [DTI2] [Fri, 20 Apr 2012 12:28:40 +0000 (14:28 +0200)]
zebra: no need to clear memory of the netlink buffers

The memory is always written before sending. Clearing it before use
slows netlink_route_multipath() down considerably and it's pretty
noticeable in a full-internet table scenario loading.

  * zebra/rt_netlink.c: subtract bulk buffer size from clear

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[reworded commit message]
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agobgpd: cleanup, use correct buffer sizes for sockunion2str()
Jorge Boncompte [DTI2] [Tue, 10 Apr 2012 14:57:27 +0000 (16:57 +0200)]
bgpd: cleanup, use correct buffer sizes for sockunion2str()

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agolib: remove sockunion related unused definitions
Jorge Boncompte [DTI2] [Tue, 10 Apr 2012 14:57:26 +0000 (16:57 +0200)]
lib: remove sockunion related unused definitions

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agolib, zebra: extend use of sockunion2ip macro
Jorge Boncompte [DTI2] [Tue, 10 Apr 2012 14:57:25 +0000 (16:57 +0200)]
lib, zebra: extend use of sockunion2ip macro

  * lib/sockunion.c,
  * zebra/zebra_rib.c: replace ->sin.sin_addr.s_addr with sockunion2ip

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[reworded commit message]
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agobgpd: Fix memory leak of some "show ip bgp neighbor" commands
Jorge Boncompte [DTI2] [Tue, 10 Apr 2012 14:57:24 +0000 (16:57 +0200)]
bgpd: Fix memory leak of some "show ip bgp neighbor" commands

sockunion_str2su() use is prone to memory leaks. Remove it's use all over
the code.

At least these commands leaked a sockunion union:
    - show ip bgp vpnv4 ... routes
    - show ip bgp ... received prefix-filter

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agolib: remove last uses of sockunion_su2str()
Jorge Boncompte [DTI2] [Tue, 10 Apr 2012 14:57:23 +0000 (16:57 +0200)]
lib: remove last uses of sockunion_su2str()

Use of this function is prone to memory leaks.

This fixes a memory accounting bug for vty denied connections.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agobgpd: Fix memory leak with 'set ip next-hop peer-address'
Jorge Boncompte [DTI2] [Tue, 10 Apr 2012 14:57:22 +0000 (16:57 +0200)]
bgpd: Fix memory leak with 'set ip next-hop peer-address'

A route-map with the mentioned statement causes a memory leak for every
prefix that matches.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agobgpd: fix for route-maps with "match peer local" statements
Jorge Boncompte [DTI2] [Fri, 13 Apr 2012 11:46:08 +0000 (13:46 +0200)]
bgpd: fix for route-maps with "match peer local" statements

A route-map with a 'match peer local' statement it's shown like
'match peer (null)' on config output...

... and it's unparsable on daemon startup.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agobgpd, zebra: Fix format for some metric outputs
Jorge Boncompte [DTI2] [Fri, 13 Apr 2012 11:46:07 +0000 (13:46 +0200)]
bgpd, zebra: Fix format for some metric outputs

Metrics are unsigned values.

  * bgpd/bgp_{debug,route,vty}.c,
  * zebra/zebra_vty.c: replace %d with %u for metrics & distances

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[reworded commit message]
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agobgpd: Fix regression in args consolidation, total should be inited from args
Paul Jakma [Mon, 13 Feb 2012 13:53:07 +0000 (13:53 +0000)]
bgpd: Fix regression in args consolidation, total should be inited from args

* bgp_attr.c: (bgp_attr_unknown) total should be initialised from the args.

12 years agobgpd: Make socket init separate, so unit tests work again.
Paul Jakma [Tue, 1 May 2012 15:24:35 +0000 (16:24 +0100)]
bgpd: Make socket init separate, so unit tests work again.

* Separate out BGP socket initialisation from bgp_get, and make it an
  explicit function. Allows unit tests to work again and probably also
  benefits dry-run.
* bgpd.c: (bgp_get) move socket init out...
  (bgp_socket_init) to here
* bgp_main.c: and call it after dry-run.
* bgpd.h: (bgp_socket_init) add prototype

12 years agotests: Fix some compile errors and warnings
Paul Jakma [Tue, 1 May 2012 15:20:33 +0000 (16:20 +0100)]
tests: Fix some compile errors and warnings

* aspath_test.c: match changes in aspath_unintern. Fix printf size_t warning.
* bgp_capability_test.c: compile warnings.
* bgp_mp_attr_test.c: update for attr parser context struct
* ecommunity_test.c: ecommunity_free/ecommunity
* test-checksum.c: some unused vars and funcs without need of prototypes.

12 years agoRevert "tests: disable broken tests/bgp_mp_attr_test.c"
Paul Jakma [Wed, 2 May 2012 10:01:01 +0000 (11:01 +0100)]
Revert "tests: disable broken tests/bgp_mp_attr_test.c"

This reverts commit d78e2b8b562f8496aaf2977f7371415b71e82433. Next 2
commits fix it.

12 years agorelease: 0.99.21
David Lamparter [Tue, 1 May 2012 19:43:53 +0000 (21:43 +0200)]
release: 0.99.21

12 years agotests: disable broken tests/bgp_mp_attr_test.c
David Lamparter [Tue, 1 May 2012 16:08:43 +0000 (18:08 +0200)]
tests: disable broken tests/bgp_mp_attr_test.c

it doesn't compile currently; it'll be fixed after the 0.99.21 release.

  * tests/bgp_mp_attr_test.c: wrap in #if 0 for now

Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agoredhat: add systemd service files
David Ward [Sun, 29 Apr 2012 20:47:08 +0000 (16:47 -0400)]
redhat: add systemd service files

 * redhat/*.service: add systemd service file for each routing daemon
 * redhat/quagga.sysconfig: add comment about watchquagga and systemd
 * redhat/Makefile.am: add systemd service files to distribution

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agoredhat: update initscripts
David Ward [Sun, 29 Apr 2012 20:47:07 +0000 (16:47 -0400)]
redhat: update initscripts

Taken from Fedora packaging with additional fixes.

 * redhat/*.init: make all initscripts LSB-compliant;
     store the daemon configuration file location in $CONF_FILE,
     and perform existence testing before starting the daemon
 * redhat/babeld.init: add initscript for Babel routing engine
 * redhat/quagga.sysconfig: add command-line options for babeld;
     remove the daemon configuration file locations from $*_OPTS;
     clarify directions for configuring watchquagga
 * redhat/Makefile.am: add babeld.init to distribution

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agoredhat: add logrotate configuration for babeld and isisd
David Ward [Sun, 29 Apr 2012 20:47:06 +0000 (16:47 -0400)]
redhat: add logrotate configuration for babeld and isisd

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agodoc: add ospfclient(8) and watchquagga(8) man pages
David Ward [Mon, 30 Apr 2012 15:36:16 +0000 (11:36 -0400)]
doc: add ospfclient(8) and watchquagga(8) man pages

Taken from Fedora packaging.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agodoc: only package man pages for daemons that are built
David Ward [Mon, 30 Apr 2012 15:36:15 +0000 (11:36 -0400)]
doc: only package man pages for daemons that are built

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agotools: use standard interpreter path in all Perl scripts
David Ward [Sun, 29 Apr 2012 20:47:03 +0000 (16:47 -0400)]
tools: use standard interpreter path in all Perl scripts

Signed-off-by: David Ward <david.ward@ll.mit.edu>
[changed /usr/bin/perl to /usr/bin/env perl]
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agobgpd: fix up multipath merge breakage
David Lamparter [Sat, 28 Apr 2012 20:37:20 +0000 (22:37 +0200)]
bgpd: fix up multipath merge breakage

the BGP multipath code was developed against a pre-f6f434b Quagga where
bgp_attr_unintern and ecommunity_free took single-star pointers.  They
now take double-star pointers.

  * bgpd/bgp_mpath.c: fix up bgp_attr_unintern & ecommunity_free calls.

Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agobabeld: merge kernel_zebra.c into kernel.c.
Juliusz Chroboczek [Mon, 12 Mar 2012 12:52:42 +0000 (13:52 +0100)]
babeld: merge kernel_zebra.c into kernel.c.

In upstream babel, we include different kernel_foo files depending on the
platform we compile for.  In Quagga, this is not needed, and it avoids
tricky autotools issues.  (All autotools issues are tricky.)

[David: without this commit, build breaks.]

From: Juliusz Chroboczek <jch@pps.jussieu.fr>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agobabeld: Include babel_main.h in noinst_HEADERS.
Denis Ovsienko [Mon, 12 Mar 2012 12:51:49 +0000 (13:51 +0100)]
babeld: Include babel_main.h in noinst_HEADERS.

babeld wouldn't build in a dist tarball without this.

From: Denis Ovsienko <infrastation@yandex.ru>
Signed-off-by: Juliusz Chroboczek <jch@pps.jussieu.fr>
[fixed up git message]
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agolib: bump ZSERV_VERSION to 2
David Lamparter [Fri, 20 Apr 2012 15:26:48 +0000 (17:26 +0200)]
lib: bump ZSERV_VERSION to 2

continually changing the zserv protocol without bumping up the version
number has made it impossible to talk to zebra without knowing the exact
version.  in reality, increasing the version number more often guards
against inadvertedly running incompatible versions of a daemon and zebra
as well as aids external development.

  * lib/zclient.h: #define ZSERV_VERSION 2

Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agoRevert "zebra: clean up client routes when client goes away"
David Lamparter [Fri, 20 Apr 2012 15:23:39 +0000 (17:23 +0200)]
Revert "zebra: clean up client routes when client goes away"

This reverts commit af56d404cd56d94ad3b2ec3f159650eb72baef0a,
which was accidentally duplicating functionality from commit
2ea1ab1 "zebra: ZEBRA_HELLO and mopping up routes (BZ#448)"

Conflicts:

zebra/zebra_rib.c

Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agobgpd: Fix crash when disabling dampening (BZ#687)
Jorge Boncompte [DTI2] [Fri, 13 Apr 2012 11:46:09 +0000 (13:46 +0200)]
bgpd: Fix crash when disabling dampening (BZ#687)

    Vladimir Podobaev reported that the following commands crashed the
daemon.

router bgp 123
 bgp dampening
 no bgp dampening 1 2 3 4
 no bgp dampening

    The problem was that bgp_damp_info_clean() tried to dereference the
already freed reuse_list array in the second call to "no bgp dampening".

    Fixed by checking in bgp_damp_disable() that the dampening it's
enabled before doing the cleanup.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>