Commit Graph

695 Commits

Author SHA1 Message Date
David Lamparter
4209a88759 build: fix dist tarball
automake file lists haven't quite kept up with recent changes, time to
fix them up so the dist tarball actually works...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-12-13 11:04:37 +01:00
David Lamparter
0be793e674 build: include git info
If enabled with --with-pkg-gitversion on ./configure, this will append
git version strings and branch information at the following places:
 - overall version number: 0.99.21-g0123456
 - login motd and show version: tag information + git id + branches

Sample output:
  Hello, this is Quagga (version 0.99.21-g14b49ad-dirty).
  Copyright 1996-2005 Kunihiro Ishiguro, et al.

  This is a git build of quagga_0_99_21_release-106-g14b49ad-dirty
  Associated branch(es):
	local:master

[v2]: fix build without gitinfo (add "else" branch)
[v2]: fix for repos without any tags (different git describe output)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-12-12 15:34:37 +01:00
Avneesh Sachdev
04f7dd64df lib: bring in sys/queue.h from FreeBSD tree
Bring in sys/queue.h from the FreeBSD tree as lib/queue.h.

This header implements lists of various flavors using inline
linkages. The imported file corresponds to SVN revision 221843 (url
below) and is available under the terms of the New BSD license
(3-clause).

  http://svnweb.freebsd.org/base/head/sys/sys/queue.h?revision=221843

Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-11-30 21:41:17 +01:00
Avneesh Sachdev
0915bb0ce2 zebra: add iterator for walking all tables in RIB
* lib/zebra.h

    Add macro ZEBRA_NUM_OF, which returns the number of elements in a
    static array.

  * zebra/rib.h

    Add the rib_tables_iter_t structure and associated functions,
    which allow one to walk all tables in the rib.

  * zebra/zebra_rib.c

    - Add vrf_id_get_next() to retrieve the first VRF id (if any) that
      is greater than a given VRF id.

    - Add rib_tables_iter_next().

Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-11-30 21:41:16 +01:00
Avneesh Sachdev
1b5ed1b054 zebra: add way to determine VRF/AFI/SAFI of table
Add some code that allows us to determine which VRF and AFI/SAFI a
given RIB table corresponds to.

  * zebra/rib.h

    Add rib_table_info_t structure, which contains information about
    the VRF, AFI and SAFI that a table is for.

  * zebra/zebra_rib.c

    - Add the vrf_table_create() function, which creates a table and
      sets its 'info' pointer to a newly created rib_table_info_t.
      The 'info' pointer allows us to go from a route_node or a table
      to the associated vrf.

    - vrf_alloc(): Use vrf_create_table() to create tables.

  * lib/memtypes.c

    Add memory type for rib_table_info_t.

Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-11-30 21:41:16 +01:00
Avneesh Sachdev
9fd92e3c4b zebra: add structure to hold per-prefix state in RIB
Add the rib_dest_t structure to hold per-prefix state in the routing
information base. This gives us an appropriate place to maintain the
queueing state of a route_node. Queuing state was previously being
stored on the first rib in the list of ribs hanging off the
route_node.

  * zebra/rib.h

    - Add new structure rib_dest_t.

    - Remove the rn_status field from 'struct rib', it is no longer
      required.

    - Add macros (RNODE_FOREACH_RIB, RNODE_FOREACH_RIB_SAFE) for
      walking all 'struct ribs' corresponding to a route_node. These
      hide the fact that there is an intermediate rib_dest_t
      structure.

    - Add a few utility inlines to go between a rib_dest_t and
      associated structures.

  * zebra/zebra_rib.c

    - rib_link()/rib_unlink()

      Tweak for new behavior, where the 'info' pointer of a route_node
      points to a rib_dest_t. The list of ribs for a prefix now hangs
      off of the dest.

      Change the way we ref count route_nodes. We now hold a single
      ref count on a route_node if there is a corresponding
      rib_dest_t.

    - Maintain the queuing state of a route_node on the flags field of
      the rib_dest_t.

    - Add the rib_gc_dest() function, which deletes a rib_dest_t if it
      is no longer required. A rib_dest_t can be deleted iff there are
      no struct ribs hanging off of it.

    - Call rib_gc_dest() any time we unlink a rib from the
      rib_dest_t. Currently we only need to call it once, just before
      we return from rib_process().

  * zebra/{redistribute,zebra_rib,zebra_snmp,zebra_vty}.c

    Use new macros to walk over route_node ribs.

  * lib/memtypes.c

    Add memory type for rib_dest_t.

Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-11-30 21:41:16 +01:00
Hasso Tepper
3b96b78136 lib: Implement monotonically increasing clock for Darwin.
There is no Posix CLOCK_MONOTONIC in Darwin, but monotonically
increasing clock can be implemented using mach_absolute_time().

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-11-05 15:16:53 -05:00
Doug VanLeuven
3f0bfc9e82 lib: treat OSX as BSD for IP_HDRINCL (BZ#739)
Mac OS X needs HAVE_IP_HDRINCL_BSD_ORDER defined like BSD. If it's not
defined, it'll fail like this:

  *** sendmsg in ospf_write failed to 224.0.0.5, id 0, off 0, len 64,
  interface en0, mtu 1500: Invalid argument

Which is caused by reordering iph->ip_len in
sockopt_iphdrincl_swab_htosys.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-11-01 22:58:36 -07:00
Balaji.G
837d16ccbe *: use array_size() helper macro
Use the array_size() helper macro.  Replaces several instances of local
macros with the same definition.

Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-10-25 10:15:59 -07:00
David Lamparter
80a21dc60f lib: add array_size() helper
implement array_size as sizeof(array) / sizeof(array element)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-10-25 10:15:59 -07:00
Avneesh Sachdev
4effc29fb1 lib: improve sanity checks in stream_set_endp()
* lib/stream.c: (stream_set_endp) Add checks to make sure that the
    supplied 'endp' is within the 'size' of the stream, and that the
    current read pointer 'getp' is not beyond the specified 'endp'.
2012-10-25 10:15:58 -07:00
JR Rivers
d8a4e42b7d lib: improve fletcher checksum validation
OVERVIEW

The checksum used in OSPF (rfc2328) is specified in rc905 annex B.  There is an
sample implementation in rfc1008 which forms the basis of the quagga
implementation.  This algorithm works perfectly when generating a checksum;
however, validation is a bit problematic.

The following LSA (generated by a non-quagga implementation) is received by
quagga and marked with an invalid checksum; however, it passes both the rfc905
and rfc1008 validation checks.

static uint8_t lsa_10_121_233_29[] = {
   0x0e, 0x10, 0x02, 0x03,
   0x09, 0x00, 0x35, 0x40,
   0x0a, 0x79, 0xe9, 0x1d,
   0x80, 0x00, 0x00, 0x03,
   0x00, 0x8a, 0x00, 0x1c,
   0xff, 0xff, 0xff, 0xe0,
   0x00, 0x00, 0x36, 0xb0
};

LS Type: Summary-LSA (IP network)
   LS Age: 3600 seconds
   Do Not Age: False
   Options: 0x02 (E)
   Link-State Advertisement Type: Summary-LSA (IP network) (3)
   Link State ID: 9.0.53.64
   Advertising Router: 10.121.233.29 (10.121.233.29)
   LS Sequence Number: 0x80000003
   LS Checksum: 0x008a
   Length: 28
   Netmask: 255.255.255.224
   Metric: 14000

You'll note that one byte of the checksum is 0x00; quagga would calculate the
checksum as 0xff8a.

It can be argued that the sourcing implementation generates an incorrect
checksum; however, rfc905 indicates that, for 1's complement arithmetic, the
value 255 shall be regarded as 0, thus either values are valid.

EXPLANATION

The quagga ospfd and ospf6d implementations operate by copying the PDU's
existing checksum in a holding variable, calculating the checksum, and comparing
the resulting checksum to the original.  As a note, this implementation has the
side effect of modifying the contents of the PDU.

Evaluation of both rfc905 and rfc1008 shows that checksum validation should
involve calculating the sum over the PDU and checking that both resulting C0 and
C1 values are zero.  This behavior is enacted in the rfc1008 implementation by
calling encodecc with k = 0 (checksum offset); however, this functionality had
been omitted from the quagga implementation.

PATCH

This patch adds the ability to call the quagga's fletcher_checksum() with a
checksum offset value of 0xffff (aka FLETCHER_CHECKSUM_VALIDATE) which returns
the sum over the buffer (a value of 0 indicates a valid checksum).  This is
similar to the mechanism in rfc1008 when called with k = 0.  The patch also
introduces ospf_lsa_checksum_valid().

ospf6d had it's own implementation of the fletcher checksum in
ospf6_lsa_checksum(); it's the same algorithm as in fletcher_checksum().  This
patch removes the local implementation in favor of the library's as well as creates
and uses ospf6_lsa_checksum_valid().

quagga's ISIS implementation suffers from the same problem; however, I do not
have the facilities to validate a fix to ISIS, thus this change has been left to
the ISIS maintainers.  The function iso_csum_verify() should be reduced to
running the fletcher checksum over the buffer using an offset of 0.

Signed-off-by: JR Rivers <jrrivers@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com>
Reviewed-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-10-25 10:15:58 -07:00
Avneesh Sachdev
28971c8cb1 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>
2012-09-26 21:50:48 +02:00
Avneesh Sachdev
f9c1b7bb9b 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>
2012-09-26 21:48:49 +02:00
Avneesh Sachdev
3eb8ef37bc 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>
2012-09-26 21:48:48 +02:00
David Lamparter
aa5cf24b9d 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>
2012-07-19 16:15:50 +02:00
Vincent Bernat
8046ba6ec4 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.
2012-06-25 19:03:23 +02:00
Vincent Bernat
b7c0d0651c 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.
2012-06-25 19:03:23 +02:00
Vincent Bernat
b8cf46b715 smux: drop findVar element from trap object struct
This element was not unused.
2012-06-25 19:03:23 +02:00
Vincent Bernat
4b89e45d92 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.
2012-06-25 19:03:23 +02:00
Vincent Bernat
d6be5fb9bc 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.
2012-06-25 19:03:23 +02:00
Vincent Bernat
3a4c96885e 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.
2012-06-25 19:03:23 +02:00
Vincent Bernat
08d7f6533e 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.
2012-06-25 19:03:23 +02:00
Vincent Bernat
6b1e37f853 build: only define HAVE_SNMP
NetSNMP is the only SNMP implementation for Quagga. We don't need two
different symbols.
2012-06-25 19:03:23 +02:00
Vincent Bernat
9e7a548ce4 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
2012-06-25 19:03:23 +02:00
Paul Jakma
2fb2a45526 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.
2012-06-14 10:37:40 +01:00
Jorge Boncompte [DTI2]
22714f99c4 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>
2012-05-22 20:50:14 +02:00
Jorge Boncompte [DTI2]
64018324d5 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>
2012-05-22 20:35:51 +02:00
Jorge Boncompte [DTI2]
41af338ecd 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>
2012-05-22 20:35:51 +02:00
Jorge Boncompte [DTI2]
47d3b6078a 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>
2012-05-22 20:35:51 +02:00
Jorge Boncompte [DTI2]
10f9bf3f20 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>
2012-05-22 20:25:07 +02:00
Jorge Boncompte [DTI2]
1b79fcb646 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>
2012-05-21 15:41:21 +02:00
Roman Hoog Antink
7c9c6aebe8 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>
2012-05-21 15:41:14 +02:00
Jorge Boncompte [DTI2]
37beff6feb lib: remove sockunion related unused definitions
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
2012-05-02 17:03:34 +02:00
Jorge Boncompte [DTI2]
128293286a 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>
2012-05-02 17:03:28 +02:00
Jorge Boncompte [DTI2]
c63b83fe8d 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>
2012-05-02 17:03:27 +02:00
Jorge Boncompte [DTI2]
d227617a97 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>
2012-05-02 17:03:27 +02:00
Jorge Boncompte [DTI2]
0c5ed3ed00 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>
2012-05-02 17:03:27 +02:00
David Lamparter
8d79efddb9 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>
2012-04-20 17:29:44 +02:00
David Lamparter
d75318cc8d isisd: merge osr/google-is-is
this is essentially half of a rewrite of isisd. please note that a lot
of things are still broken and isisd is not ready for production use.
2012-04-16 18:24:43 +02:00
Avneesh Sachdev
14d2bbaa3f Merge quagga mainline into the google ISIS code.
The steps were:

  $ git checkout google-is-is
  $ git merge quagga
  $ git checkout google-is-is -- isisd

  # Resolve conflicts in the following:
  lib/md5.h
  zebra/rt_netlink.c
  zebra/zebra_rib.c
  zebra/zserv.c

Note that the content in the isisd directory is left unchanged in the
merge. As a result, changes made to isisd as part of the following
commits on the quagga mainline are dropped.

  # 8ced4e82 is the merge base, e96b3121 is the current quagga master
  $ git log --oneline --reverse 8ced4e82..e96b3121 -- isisd
  5574999 isisd: fix crash on "no router isis" (BZ#536)
  8998075 isisd: raise hello rate for DIS (BZ#539)
  306ca83 isisd: include hash.h, not hash.c
  b82cdeb delete CVS keywords
  2f65867 isisd: indent longopts array
  b511468 quagga: option "-z" ("--socket <path>") added
  05e54ee build: delete .cvsignore files
  b4e45f6 fix zebra protocol after MP-BGP changes
  7fd6cd8 isisd: fix circuit state machine
  907fd95 isisd: send proper LSP after DIS election
  d034aa0 isisd: fix wrong next-hops from SPF
  c25eaff isisd: unexpected kernel routing table (BZ#544)
  e6b03b7 isisd: implement MD5 circuit authentication
2012-04-11 23:51:08 -07:00
Avneesh Sachdev
3cf6c2b4e4 Merge branch 'quagga' into google-bgp-multipath
Conflicts:
	bgpd/bgp_route.c
2012-04-09 00:25:15 -07:00
Josh Bailey
51d4ef832c zebra: include hardware addr in if up/down messages
Change interface up/down notification messages to also include the
hardware address of the interface. The format of these messages is now
identical to the interface add message -- move the serialization code
to common functions.

  * lib/zclient.c: Modify zebra_interface_if_set_value() to also parse
    the hardware address. Invoke it from zebra_interface_add_read()
    and and zebra_interface_state_read().

  * zebra/zserv.c: Add zserv_encode_interface(). Invoke it from
    zserv_interface_add(), zserv_interface_delete() and
    zserv_interface_update().
2012-04-08 01:19:41 -07:00
Josh Bailey
2dd04c5dc8 lib: Tweak to if_delete_retain()
* lib/if.c: Change if_delete_retain() to delete all connected
    addresses, but to not free the list that holds them. Free the list
    just before the interface structure itself is freed, in
    if_delete().
2012-04-08 01:18:41 -07:00
Josh Bailey
3f045a0881 isisd: add Google's changes to IS-IS 2012-04-07 13:54:37 -07:00
Subbaiah Venkata
d531050b7b lib: add stream_set_endp()
* lib/stream.[ch]:

    - Add stream_set_endp(). This can be used to trim data (for
      example, padding) at the end of a stream.

    - Fix swapped 'getp' and 'endp' parameters in STREAM_WARN_OFFSETS.

From: Subbaiah Venkata <svenkata@google.com>
Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@diac24.net>
2012-04-07 13:53:40 -07:00
Josh Bailey
bed930fd70 lib: add support for keyed-hashing with MD5
* lib/md5.[ch] Add implementation of HMAC-MD5 from RFC 2104.

From: Josh Bailey <joshb@google.com>
Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@diac24.net>
2012-04-07 13:53:22 -07:00
Josh Bailey
54dd612273 lib: Tweaks to linked list macros
* lib/linklist.h

    - Change the listnextnode, listhead and listtail macros so that
      they allow the list pointer to be NULL.

    - Modify the ALL_LIST_ELEMENTS* macros such that they clear the
      data pointer at the beginning and end of the loop.

From: Josh Bailey <joshb@google.com>
Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@diac24.net>
2012-04-07 13:52:23 -07:00
David Lamparter
e96b312150 lib: pretty ip_masklen and masklen2ip
nonwithstanding any desire for optimisation, these versions are shorter
and more concise.  reading the comments, they might even be easier to
understand.

I've tested them on i686 and x86_64, and checked that correct assembler
code is emitted for ARM, MIPS and PowerPC.

IPv6 is left as an exercise for another day, none of the ideas I had led
to a "yes, this is the one to go with" solution.

Signed-off-by: David Lamparter <equinox@diac24.net>
2012-04-04 00:25:51 +02:00
David Lamparter
a3537862f3 Revert "lib: optimize ip_masklen()" (BZ#720)
This reverts commit d171bf58ef.

There are multiple reasons for this revert, including bug #720, but also
quite simply the unreadability of having 2000 lines of an autogenerated
table in the middle of a source file.

Signed-off-by: David Lamparter <equinox@diac24.net>
Reported-by: Martin Winter <mwinter@opensourcerouting.org>
2012-04-04 00:25:31 +02:00
Matthieu Boutier
2236df0389 memory: install babel memory informations. 2012-03-25 17:06:52 +01:00
Denis Ovsienko
f8a246d6df lib: update proto_redistnum() for Babel 2012-03-25 17:06:52 +01:00
Paul Jakma
5734509c05 babeld: Initial import, for Babel routing protocol.
* Initial import of the Babel routing protocol, ported to Quagga.
* LICENCE: Update the original LICENCE file to include all known potentially
  applicable copyright claims.  Ask that any future contributors to babeld/
  grant MIT/X11 licence to their work.
* *.{c,h}: Add GPL headers, in according with the SFLC guidance on
  dealing with potentially mixed GPL/other licensed work, at:

  https://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
2012-03-25 17:06:51 +01:00
Renato Westphal
fe67e66888 lib: fix endianness bug in prefix.c
While defining two "maskbytes" arrays for the respective endiannesses,
the code was unconditionally using one that only worked on little endian
systems.

Use preprocessor macros to avoid the somewhat expensive
htonl/ntohl macros.

From: Renato Westphal <renatowestphal@gmail.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
2012-03-23 20:51:28 +01:00
Paul Jakma
b5043aabb0 lib: fix incorrect thread list processing loops
* thread.c: (thread_timer_process,thread_process) thread_list_delete nulls
  thread->next. Loops need to save next first, or will only process the head.
  Problem noted by Lou Berger <lberger@labn.net>.
2012-02-28 18:35:45 +00:00
Denis Ovsienko
4c78376f96 lib: fix logging of ZEBRA_HELLO message 2012-02-21 21:34:21 +04:00
Everton Marques
e854095932 lib: add THREAD_TIMER_MSEC_ON()
* lib/thread.h: new timer macro, millisecond precision

(this was cherrypicked from pimd to isolate all non-contained changes)

From: Everton Marques <everton.marques@gmail.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
2012-02-16 06:17:11 +01:00
Fritz Reichmann
e6b03b7776 isisd: implement MD5 circuit authentication
* Replace command "isis passwd" with "isis passwd {clear|md5}"
* Verify HMAC MD5 on ISIS Hello PDUs
* Add HMAC MD5 authentication to md5.h/md5.c from RFC2104
2012-02-14 03:06:36 +04:00
G.Balaji
c7ec179a95 bgpd: IPv6 MP-BGP Routes addition and deletion
This patch contains the following:
1. Addition of IPv6 SAFI_MULTICAST BGP routes into the BGP Multicast RIB.
2. Deletion of IPv6 SAFI_MULTICAST BGP routes from the BGP Multicast RIB.
2012-01-23 14:30:50 +04:00
G.Balaji
5a616c08ce bgpd: IPv4 MP-BGP Routes addition and deletion
This patch contains the following:
1. Addition of IPv4 SAFI_MULTICAST BGP routes into the BGP Multicast RIB.
2. Deletion of IPv4 SAFI_MULTICAST BGP routes from the BGP Multicast RIB.
2012-01-23 14:30:33 +04:00
Denis Ovsienko
9ed79b53eb lib: use prefix bit length macros 2012-01-08 13:42:23 +00:00
Paul Jakma
23be94ea00 lib/if: trivial, fix rarely used if debug function to print everything
* if.c: (if_dump) loop that doesn't do anything, wants to be
  before the zlog of what it's meant to print out so all the connected
  addresses get printed out. Trival: just a debug function
2012-01-06 16:19:36 +00:00
Paul Jakma
f63f06da2e general: remove inline qualifiers and move in-header functions to objects
* (general) Move functions in headers into files, to be compiled into
  shared object files. Remove inline qualifier from functions. Let the
  compiler do the work.
2012-01-06 16:18:18 +00:00
Ulrich Weber
664711c1f4 lib: fix some strtoul() use cases
...otherwise 4294967295 is not a valid value on 32bit systems
2012-01-02 19:13:28 +04:00
Denis Ovsienko
fe40bfa2e1 lib: address type-punned pointers in prefix_same()
IPV4_ADDR_SAME() wasn't passed the right union member, this could cause
a bug due to strict-aliasing. IPV6_ADDR_SAME() case got its fix before
the error could be created by macro upgrade.
2012-01-02 18:37:54 +04:00
Denis Ovsienko
733cd9e579 bgpd: justify checks for IPv4 class D/E
* lib/prefix.h
  * IPV4_CLASS_DE(): make consistent with counterpart macros
* bgp_packet.c
  * bgp_open_receive(): test using macro instead of ">="
* bgp_route.c
  * bgp_update_rsclient(): idem
  * bgp_update_main(): idem
2012-01-02 18:37:42 +04:00
Vyacheslav Trushkin
2ea1ab1c30 zebra: ZEBRA_HELLO and mopping up routes (BZ#448)
ZEBRA_HELLO message is used by routing daemons to inform zebra
what type of routes daemon will be announcing to zebra. Also
zebra uses route_type_oaths array to track which daemon announces
which protocol. Zebra mops up routes if daemon didn't for some
reason.
2012-01-02 18:37:24 +04:00
Denis Ovsienko
2654e43ca2 lib: fix type-punning in ip_masklen()
ip_masklen() was likely to return incorrect results after being compiled
with -fstrict-aliasing (-O2, -O3, -Os)
2012-01-02 18:36:58 +04:00
Denis Ovsienko
d171bf58ef lib: optimize ip_masklen()
The new implementation makes use of a 64KB mapping table, which makes it
possible to compute masklen faster and with constant execution time. The
map also allows for additional version of the function, which can detect
errors in input argument.

The previous implementation had a variable cost of execution, which
depended on masklen in a non-linear manner, and at its worst (/31) was
4 times slower, than the new implementation. The only case of old
function just slightly outperforming the new one is /0, which is of
little practical interest.
2012-01-02 18:23:24 +04:00
Denis Ovsienko
8c7f49d277 Revert "lib: optimize apply_mask_ipv6()"
Experience with IPv4 counterpart of this function suggests, that
this way of type-punning is likely to cause errors.
2012-01-01 16:37:45 +04:00
Stephen Hemminger
9206f9ecd5 fix set never used warnings
(This patch was modified to leave calls to stream_getl() in place, they
are necessary for the stream's internal pointer to advance to the
correct position. -- Denis)

Signed-off-by: Denis Ovsienko <infrastation@yandex.ru>

Fix gcc warnings about varables that are set but never used.

* bgpd/bgp_attr.c
  * cluster_unintern(): ret
  * transit_unintern(): ret
  * bgp_attr_default_intern(): attre
  * bgp_mp_reach_parse(): rd_high, rd_low
* bgpd/bgp_route.c
  * bgp_announce_check_rsclient(): bgp
* bgpd/bgp_zebra.c
  * zebra_read_ipv4(): ifindex
  * zebra_read_ipv6(): ifindex
* bgpd/bgpd.c
  * bgp_config_write_peer(): filter
* lib/distribute.c
  * distribute_list_all(): dist
  * distribute_list(): dist
  * distribute_list_prefix_all(): dist
  * distribute_list_prefix(): dist
* lib/if_rmap.c
  * if_rmap(): if_rmap
* lib/vty.c
  * vty_accept(): vty
* lib/zclient.c
  * zclient_read(): ret
* zebra/irdp_interface.c
  * if_group(): zi
* zebra/rt_netlink.c
  * kernel_read(): ret, sock
2011-12-18 20:21:21 +04:00
Denis Ovsienko
32ca973920 lib: optimize apply_mask_ipv6() 2011-12-13 19:30:49 +04:00
Denis Ovsienko
caff7905e2 lib: optimize apply_mask_ipv4() 2011-12-13 19:30:45 +04:00
Denis Ovsienko
21f569e37d lib: make masklen2ip6() safer and faster 2011-12-13 19:30:39 +04:00
Denis Ovsienko
051954f574 lib: fix endianness of masklen2ip() 2011-12-13 19:30:29 +04:00
Denis Ovsienko
9663386f16 lib: make masklen2ip() safer and faster 2011-12-13 19:30:17 +04:00
Denis Ovsienko
0ead5c183c lib: spelling 2011-12-13 19:25:06 +04:00
David Lamparter
ca05126921 lib: add sockopt helper for setting IPV6_V6ONLY and use it
getaddrinfo returns a list of socket parameters for listening. it
will contain both IPv4 and IPv6 listening sockets. unless we use
IPV6_V6ONLY on the IPv6 ones, only the socket listed first will
work. if the IPv4 one came first, the IPv6 one would get an
"Address in use" error.

this functionality was already present for bgpd and its listening
sockets. as it is needed for vtys as well, make it a common helper.

Conflicts:

	lib/sockunion.c
2011-12-13 19:23:38 +04:00
David Lamparter
e0ca5fde7b lib: put route_types.txt to real use
this replaces most occurences of routing protocol lists by preprocessor
defines from route_types.h. the latter is autogenerated from
route_types.txt by a perl script (previously awk). adding a routing
protocol now is mostly a matter of changing route_types.txt and log.c.

Conflicts:

	lib/route_types.awk
2011-12-13 19:13:17 +04:00
Denis Ovsienko
05e54ee3df build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
Vyacheslav Trushkin
3414d03545 lib: clearing zclient.c for some cases of building
lib/zclient.c: using of HAVE_TCP_ZEBRA in zclient_socket_*
definitions extended by else clause.
2011-12-13 14:26:45 +04:00
Vyacheslav Trushkin
b51146856e quagga: option "-z" ("--socket <path>") added
All daemons modified to support custom path to zserv
socket.

lib: generalize a zclient connection

zclient_socket_connect added. zclient_socket and
zclient_socket_un were hidden under static expression.
"zclient_serv_path_set" modified.
2011-12-13 14:26:28 +04:00
Stephen Hemminger
004b1238a2 lib: fix SMUX compiler warnings
Make progname a string, and cast when calling asn1.
Remove variable set but never used.
2011-12-07 01:31:16 +04:00
Stephen Hemminger
3c14ebb081 lib: fix compile warnings from set-never-used
The if_dump code had empty loop, that caused set-never-used warning.
2011-12-07 01:29:49 +04:00
Stephen Hemminger
46901400a3 vty_serv_sock_family unused
If the vty_serv_sock_addrinfo is being used, then vty_serv_sock_family
is unsed. Fix by adjusting ifdef/else/endif
2011-12-07 01:23:48 +04:00
Stephen Hemminger
b24b19f719 lib: fix memory leak on connect() failure
Change sockunion_log() to not use strdup(). This fixes a small memory
leak that occurs on every failed connect(), and is simpler/cleaner.
2011-12-06 15:02:44 +04:00
Stephen Hemminger
6a2e0f36b1 lib: call filter delete hook before freeing access list
The delete_hook was being run after calling access list delete function.
This would cause ospf to dereference a NULL, in ospf_filter_update
because 'access->name' was already freed.

See also:
    https://bugzilla.vyatta.com/show_bug.cgi?id=7654
2011-12-06 15:02:34 +04:00
David Lamparter
17e52061ba lib: prefix2sockunion, prefix_common_bits helper functions
prefix2sockunion converts a struct prefix* to a union sockunion *;
prefix_common_bits counts the number of common bits in the prefix's
address part.
2011-11-21 19:41:51 +04:00
Denis Ovsienko
ad61af67b5 lib: compile even without IPV6_TCLASS 2011-10-17 18:59:26 +04:00
Stephen Hemminger
6d0732c8ab IPv6 transport class suppport
IPv6 supports the same concept of differentiated service for routing
protocols as IPv4, but like too many things, the standards committee
decided that having two names for the same thing wasn't good enough and
introduced a third more generic term transport class.

The socket option to set transport class works the same as IPv4, but the
arguments are different.

* lib/sockopt.[ch]
  * setsockopt_ipv6_tclass(): new function
* bgpd/bgp_network.c
  * bgp_connect(): set socket option
  * bgp_listener(): set socket option
* ospf6d/ospf6_network.c
  * ospf6_set_transport_class(): new function
  * ospf6_serv_sock(): set socket option
* ripngd/ripngd.c
  * ripng_make_socket(): set socket option
2011-10-17 18:59:19 +04:00
Denis Ovsienko
bc3443ebf0 bgpd: improve NEXT_HOP attribute checks (BZ#680)
* lib/prefix.h
  * IPV4_CLASS_DE(): new helper macro
* bgp_attr.c
  * bgp_attr_nexthop(): add check for "partial" bit, refresh flag error
    reporting, explain meaning of RFC4271 section 6.3 and implement it

Conflicts:

	bgpd/bgp_attr.c
2011-09-30 01:24:35 +04:00
Denis Ovsienko
0a28130d35 bgpd: rename SAFI 3 according to RFC4760
- SAFI value 3 is reserved.  It was assigned by RFC 2858 for a use
  that was never fully implemented, so it is deprecated by this
  document.

* zebra.h: rename macro
* bgp_fsm.c: (bgp_graceful_restart_timer_expire,
  bgp_graceful_stale_timer_expire, bgp_stop, bgp_establish): update
* bgpd.c: (peer_nsf_stop): update
* bgp_open.c: (bgp_capability_vty_out): SAFI 3 isn't a recognized case
  any more
2011-09-29 22:19:08 +04:00
Dmitrij Tejblum
51abba509a lib: provide more information in case of failed LOOKUP.
* log.[ch]
  * mes_lookup: add a parameter with the name of the message list, print
    the name in case of failure.
  * LOOKUP macro: pass the name of the message list.
2011-09-27 21:45:53 +04:00
Dmitrij Tejblum
10d04cdb41 lib: use "protocol-independed API" from RFC3678, if that is available
(This commit is based on the patch from BZ#420, and should fix that bug.)

* configure.ac: detect availability of that API
* sockopt.c (setsockopt_ipv4_multicast): use it for join/leave IPv4
  multicast groups
2011-09-27 21:39:12 +04:00
Dmitrij Tejblum
ee7e75d38b lib: futher simplification of setsockopt_ipv4_multicast()
* sockopt.c (setsockopt_ipv4_multicast): check for wrong optname with
  assert(), rather than return an error.
2011-09-27 21:38:16 +04:00
Dmitrij Tejblum
e0afa6f44a lib: fix omission in the previous commit to lib/sockopt.c
* sockopt.c (setsockopt_ipv4_multicast_if): fix missed line in
  the previous commit.
2011-09-27 21:37:46 +04:00
Dmitrij Tejblum
69bf3a3993 lib: simplify interface of setsockopt_multicast_ipv4().
* sockopt.[ch] (setsockopt_ipv4_multicast): ifindex is now mandatory (all
  non-ancient OSes can use it anyway), and if_addr parameter (the address
  of the interface) is now gone. (setsockopt_ipv4_multicast_if):
  IP_MULTICAST_IF processing moved to this new function

* ospf_network.c (ospf_if_add_allspfrouters, ospf_if_drop_allspfrouters,
  ospf_if_add_alldrouters, ospf_if_drop_alldrouters, ospf_if_ipmulticast),
  rip_interface.c (ipv4_multicast_join, ipv4_multicast_leave,
  rip_interface_new): adapt to the new interface
2011-09-27 21:37:35 +04:00
Denis Ovsienko
3a8c3dd7d0 lib: remove unused variable
* sockopt.c (getsockopt_ifindex): "ifindex" was never used
2011-09-27 21:34:48 +04:00
Denis Ovsienko
b82cdeb18f delete CVS keywords 2011-09-27 21:34:26 +04:00
Stephen Hemminger
b69442d456 configure: dismiss libutil.h
Recent versions of libc on Linux (Debian Testing) create lots of
compile warnings about direct usage of libutil.h
2011-09-27 20:47:18 +04:00
Josh Bailey
de8d5dff15 bgpd: Adds support to mark up the BGP rib table entry with multipath
information based on the multipath list (mp_list) generated during
the best path calculation. Display "multipath" for paths that are
multipath and also on bestpath if the route is multipath. Flag a
best path with the BGP_INFO_MULTIPATH_CHG if the multipath
set has changed since the last update. This can be used to trigger
updates to zebra and peers.

The multipath markup is a lazily allocated bgp_info_mpath structure
that is added to the best path and any multipaths. The mpath structures
are linked together with the best path element at the head and the
other elements ordered by nexthop and then by peer address. This
markup scheme is updated by calling bgp_info_mpath_update() and passing
in a new mp_list the the current multipath set. There are additional
API's for walking the multipath set, querying the count of multipaths,
and for cleaning up the multipath markup information when freeing path
information.

* bgpd/bgp_mpath.c
  * bgp_info_mpath_new(): Allocation of new mpath element
  * bgp_info_mpath_free(): Release memory for mpath element
  * bgp_info_mpath_get(): Access mpath element of path. Allocate memory
    on-demand
  * bgp_info_mpath_enqueue(): Enqueue a path onto the multipath list
  * bgp_info_mpath_dequeue(): Remove a path from the multipath list
  * bgp_info_mpath_first(): Return first path on the multipath list
  * bgp_info_mpath_next(): Return next path on the multipath list
  * bgp_info_mpath_count(): Return the number of paths on the multipath list
  * bgp_info_mpath_count_set(): Set the number of paths on the multipath list
  * bgp_info_mpath_update(): Update multipath markup on bgp route table entry
    and flag any changes. Emit 'debug bgp event' output on any multipath
    change.
* bgpd/bgp_mpath.h
  * struct bgp_info_mpath: Information added to a bgp_info path to record
    multipath information
  * External declarations for new functions in bgp_mpath.c
* bgpd/bgp_route.c
  * bgp_info_free(): Free mpath memory when freeing path information
  * bgp_info_reap(): Dequeue path from multipath queue before deleting it
  * bgp_best_selection(): Calls bgp_info_mpath_update() with latest
    mp_list to mark-up rib table entry
  * bgp_vty_out_detail(): Add display of multipath flag for a path. Also
    display 'multipath' for bestpath if it is a multipath route
* bgpd/bgp_route.h
  * struct bgp_info: Add pointer to bgp_info_mpath information
  * Add flags to mark a path as multipath (BGP_INFO_MULTIPATH) and
    to mark bestpath if multipath information has changed
    (BGP_INFO_MULTIPATH_CHG)
* lib/memtypes.c
  * Add MTYPE_BGP_MPATH_INFO for allocating memory for bgp_info_mpath
* tests/bgp_mpath_test.c
  * Add test case for bgp_info_mpath_update() and supporting functions
2011-07-20 20:46:01 -07:00
Stephen Hemminger
d876bdf4a8 lib: Add support for IPv6 ttl security
* sockunion.c: (sockopt_minttl) Add IPv6 support for min hop count.
  The kernel support is Linux kernel 2.6.35 or later.
2011-03-24 11:18:41 +00:00
Stephen Hemminger
89b6d1f8e2 bgpd: Cleanups & fixes for minttl / GTSM
* bgp_vty.c: (peer_ebgp_multihop_{un,}set_vty) tail-call cleanup.
  ({no_,}neighbor_ttl_security) ditto.
* bgpd.c: (peer_ttl_security_hops_set) Peer group checks and TTL set only
  need to be done on transition.
* sockunion.c: (sockopt_minttl) remove always-on debug and improve readability.
2011-03-24 10:51:59 +00:00
Nick Hilliard
fa411a212b bgpd: RFC 5082 Generalized TTL Security Mechanism support
* bgpd: Add support for RFC 5082 GTSM, which allows the TTL field to be used
  to verify that incoming packets have been sent from neighbours no more
  than X IP hops away. In other words, this allows packets that were sent from
  further away (i.e. not by the neighbour with known distance, and so possibly
  a miscreant) to be filtered out.
* lib/sockunion.{c,h}: (sockopt_minttl) new function, to set a minimum TTL
  using the IP_MINTTL socket opt.
* bgpd.h: (BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK) define for command
  error for minttl.
  (struct peer) add a config variable, to store the configured minttl.
  (peer_ttl_security_hops_{set,unset}) configuration handlers
* bgpd.c: (peer_group_get) init gtsm_hops
  (peer_ebgp_multihop_{un,}set) check for conflicts with GTSM. Multihop and
  GTSM can't both be active for a peer at the same time.
  (peer_ttl_security_hops_set) set minttl, taking care to avoid conflicts with
  ebgp_multihop.
  (bgp_config_write_peer) write out minttl as "neighbor .. ttl-security hops X".
* bgp_vty.c: (bgp_vty_return) message for
  BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK
  (peer_ebgp_multihop_{un,}set_vty)
* bgp_network.c: (bgp_accept) set minttl on accepted sockets if appropriate.
  (bgp_connect) ditto for outbound.
2011-03-23 15:33:17 +00:00
Christian Hammers
fc95186c30 lib: fix more format warnings (#637)
The following patch was also neccessary to compile.

* command.c: (config_logmsg_cmd) use "%s" format spec
* if.c: (connected_log) ditto
2011-03-23 13:07:55 +03:00
Stephen Hemminger
58192df774 lib: add TCP_CORK wrapper
* sockunion.{c,h}: (sockopt_cork) wrapper for TCP_CORK socket option for
  those platforms that provide it.  For other platforms, it is just a nop.
2011-03-21 17:30:52 +00:00
Tom Goff
7e69d99367 lib: zlog should clean up its memory
* log.c: (closezlog) Also free the dynamically allocated filename when
    a log is closed.
2011-03-21 13:30:54 +00:00
Tom Goff
4bd045d5dd lib: Add a function to delete all interfaces
if.c: (if_terminate) This adds a cleanup function that can be called
    when a daemon exits, similar to vty_terminate().
2011-03-21 13:30:54 +00:00
Stephen Hemminger
6392aa83c4 lib: Better hashing of string values using Bernstein hash
* hash.{h,c}: (string_hash_make) Hash optimised for strings, current
  implementation using Bernstein hash, which offers a good compromise
  between distribution and performance.
* distribute.c: (distribute_hash_make) use previous instead of additive
  string hash.
* if_rmap.c: (if_rmap_hash_make) ditto
2011-03-21 13:30:54 +00:00
Chris Caputo
6c88b44dcb bgpd: fix bgp_node locking issues
* bgpd: Connected table locks were being locked but not unlocked, such that
  eventually a lock would exceed 2^31 and become negative, thus triggering
  an assert later on.
* bgp_main.c: (bgp_exit) delete connected elements along with ifp's.
* bgp_nexthop.c: (bgp_nexthop_lookup{,_ipv6}) add missing unlocks
  (bgp_multiaccess_check_v4) ditto
  (bgp_connected_{add,delete}) Use a distinct memtype for bgp_connected_ref.
  (bgp_scan_finish) reset the nexthop cache to clean it up when bgpd exits
* bgp_route.c: fix missing bgp_node unlocks
* lib/memtype.c: (memory_list_bgp) add MTYPE_BGP_CONN
* testing: has been tested for almost 2 months now.
2011-03-21 13:15:32 +00:00
Chris Hall
cca85d27a5 lib: Fix accounting of memory
* lib/memory.c: (zrealloc) If is called with NULL pointer then it should
  increment allocations because it behaves the same as zmalloc.

  (zfree) is called with NULL pointer, it does nothing therefore allocation
  count should not change.
2011-03-21 11:09:13 +00:00
Paul Jakma
f8416810aa lib: Fix bug in prefix trie lookup
* lib/table.c: (route_node_match) fix overshoot that was causing this
  function to go 1 bit too far and thus reading past end of prefix.
  (route_node_lookup) be defensive - don't assume others will clean up
  leaves when removing info.
2010-12-08 17:06:12 +00:00
Paul Jakma
d358344759 lib: prefix.c nano-optimisation
* lib/prefix.c: (prefix_match) nano-optimisation, let it return early
  without copying pointers.
2010-12-08 17:05:11 +00:00
Paul Jakma
3322055b39 lib: Make workqueue more conservative about ramping up
* workqueue.c: (work_queue_run) Err more on the side of keeping granularity
  down, by being more conservative about increasing it.
  Also, fix mispelling.
2010-12-08 16:53:09 +00:00
Paul Jakma
e276eb8282 lib: Add a command to clear the thread CPU history data
* (general) this can be useful when investigating thread latency problems,
  when you don't want to have to restart a daemon between tests.
* thread.c: (cpu_record_(hash_)clear) wipe the stored thread cpu history
  data, according to the filter, similar to the vty print code.
  (clear_thread_cpu_cmd) new command to clear data.
* thread.h: export new command
* command.c: install it
2010-12-08 16:53:09 +00:00
Paul Jakma
2613abe64f lib: Thread scheduler should be fair and not let events starve I/O and timers
* thread.c: (thread_fetch) the current scheduler will service events
  indefinitely, ignoring I/O and timers, so long as there are events.
  In other words, events can crowd out I/O and timers.  In theory this
  shouldn't be a huge problem as events are generated only by timers
  and I/O, however in practice it means normal-load behaviour is not as
  useful a predictor of high-load behaviour as it should be.

  Fix this by considering all the kinds of threads, in every run of the
  scheduler.  For any given run, we prioritise events, however across
  runs the scheduler should be fair.

  This has been observed to give more stable inter-packet times in
  testing of ospfd (i.e.  lower std-dev).

 (thread_process) new heler to queue all the given threads onto the ready
 list
2010-12-08 16:53:09 +00:00
Paul Jakma
8526100eeb lib: thread history funcname shouldn't be constant, it's freed
* thread.h: (struct cpu_thread_history.funcname) malloc gets called on this
  so it should not be const
* thread.c: (cpu_record_print) cast the (const char *) to (char *), this
  function knows what it's doing (free wont be called on it).
2010-12-08 16:53:09 +00:00
Dmitry Tejblum
08a7a91646 zclient: fix router-id calculation for IPv6 (#595)
If router-id is not specified in ospf6d.conf, ospf6d will get it from
the zebra daemon. But ospf6d originates Link LSAs before the router-id
is returned by zebra, thus this router's Link LSAs will be flooded
with AdvRouter set to 0.

* zclient.c: zclient_start(): send ZEBRA_INTERFACE_ADD message after
  ZEBRA_ROUTER_ID_ADD, not before
2010-10-18 19:05:39 +04:00
Michael Lambert
4c9641ba4d bgpd, lib: adopt afi_t and safi_t in several places
* bgpd/bgp_attr.c, bgpd/bgp_open.h, bgpd/bgp_route.c, lib/prefix.c,
  lib/prefix.h: Various integer types were being used where, if we
  had strict type checking, afi_t and safi_t would be required.

Signed-off-by: G.Balaji <balajig81@gmail.com>
(cherry picked from commit c8af35ffa2dc79ff7d7ff00b1b61f1f50a100ab6)
2010-10-06 12:33:05 -04:00
Nico Golde
b830c89a45 lib/vty.c: add missing format string when printing out motd message
Signed-off-by: G.Balaji <balajig81@gmail.com>
2010-09-17 13:36:44 -04:00
Greg Troxel
b167938707 Document rules for zalloc and friends.
lib/memory.c:z{a,c,re}alloc, zfree, zdup: add requires/effects
comments.
2010-09-17 12:19:13 -04:00
Stephen Hemminger
dca6c883ea lib: undo the last PIE commit
Stephen:
A recent change breaks build Quagga on Debian Lenny with amd64 (but not
i386). Not sure whether this is cause by ld, gcc, or libtool; but
whatever it just won't work for a large number of users.

Mathias:
I would guess it's a problem of libtool because it adds "-fPIC -DPIC" to
the compiler flags but doesn't remove -fPIE. That wouldn't be a problem
if the compiler would ignore the -fPIE in favor to the latter -fPIC, but
obviously it does not. [...] Those objects were actually compiled with
-fPIC but also -fPIE which seems to confuse gcc.
2010-01-27 12:38:16 +03:00
Mathias Krause
3f3dc2bd5f lib: fix PIE build flags
Because the final executables are built as position independent
executables (PIE) -- when configure has detected compiler supported for
PIE -- the objects in the library archive must be built in that way,
too. Otherwise the runtime linker has to do unneccesary relocation for
each start of the program. Even worse, the programs won't even be able
to start on a (hardened) kernel that doesn't allow those relocations to
happen by preventing making the .text segment writable (PaX's MPROTECT
feature comes to mind). The attached patch fixes this issue by adding
the appropriate flags to the Makefile.am.
2010-01-20 17:39:13 +03:00
David Ward
0917f7e7c5 lib: fix memory logging
* lib/memory.h
  * mtype_zcalloc(): correct function prototype
  * XFREE(): make both definitions consistent in setting
    the pointer to NULL after freeing the memory

These changes will only have an effect if MEMORY_LOG is defined
(it is not by default).
2010-01-13 20:10:56 +03:00
Stephen Hemminger
2d362d1099 lib: make some structures constant
* isisd/isis_pdu.c
  * maskbit: this pre-initialized array is not modified
* lib/prefix.c
  * maskbit: idem
* lib/command.c
  * facility_map: idem
  * itoa64: idem
  * default_motd: make local var static
  * facility_name(): update local var accordingly
  * facility_match(): idem
2009-12-21 13:03:51 +03:00
Stephen Hemminger
813f6a0064 ospf6d: fix warnings from recent prefix bit commit
* lib/prefix.h
  * prefix6_bit(): add IPv6 wrapper for prefix_bit()
* ospf6d/ospf6_lsdb.c
  * ospf6_lsdb_type_router_head(): employ prefix6_bit()
  * ospf6_lsdb_type_head(): idem
2009-12-10 16:13:09 +03:00
Stephen Hemminger
1352ef32d7 lib: move check_bit into prefix common code
Make one version of check prefix bit, and put it inline
with proper prototype. This gets rid of some macro's and also some
assert() that can never happen on a non-broken compiler.

* bgpd/bgp_table.c
  * CHECK_BIT(): sayonara
  * check_bit(): sayonara
  * SET_LINK(): sayonara
  * set_link(): make use of prefix_bit() instead of check_bit()
  * bgp_node_match(): idem
  * bgp_node_lookup(): idem
  * bgp_node_get(): idem
* lib/prefix.h
  * prefix_bit(): new inline version of check_bit()
* lib/table.c
  * CHECK_BIT(): sayonara
  * check_bit(): sayonara
  * SET_LINK(): sayonara
  * set_link(): make use of prefix_bit() instead of check_bit()
  * route_node_match(): idem
  * route_node_lookup(): idem
  * route_node_get(): idem
* ospf6d/ospf6_lsdb.c
  * CHECK_BIT(): sayonara
  * ospf6_lsdb_lookup_next(): make use of prefix_bit() instead of
    CHECK_BIT()
  * ospf6_lsdb_type_router_head(): idem
  * ospf6_lsdb_type_head(): idem
* ospf6d/ospf6_route.c
  * CHECK_BIT(): sayonara
  * ospf6_route_match_head() make use of prefix_bit() instead of
  * CHECK_BIT()
2009-12-09 14:43:17 +03:00
Stephen Hemminger
3949a60c35 lib: fix warning on little endian
* md5.c
  * md5_calc(): If building on little endian then X
    will be 'const uint32_t' which causes compiler
    warning in code that never gets used. Just move
    the endif to make sure code is not checked.
2009-12-09 14:13:27 +03:00
Stephen Hemminger
38cc00cd82 lib: make match functions take const args
* table.c: general type safety and compiler help:
  * maskbit[]: become const
  * route_node_match(): take const args
  * route_node_match_ipv4(): idem
  * route_node_match_ipv6(): idem
  * check_bit(): idem, plus adjust local vars typing
2009-12-08 12:00:50 +03:00
Denis Ovsienko
0d6388abc7 lib: remove unused function: route_dump_node() 2009-12-07 19:19:13 +03:00
heasley
78e6cd98dd lib: log source of vty connections (bug #566)
heasley: I've used this for a while to track usage.
2009-12-07 16:41:14 +03:00
Paul Jakma
c4cf095e95 lib/trivial: str2prefix checks return of inet_pton in fragile way
* prefix.c: (str2prefix_ipv6) inet_pton succesful return is presumed to be
  1, rather than the "not zero" the man page describes - seemed fragile.
2009-08-28 14:51:49 +01:00
Paul Jakma
3e4ee9591a lib: if_lookup_by_name should be more robust to null argument
* if.c: (if_lookup_by_name) shouldn't crash just cause we got a NULL name
2009-08-28 14:51:18 +01:00
Stephen Hemminger
d023aec49f bgpd: start listener on first instance
Start BGP listener only after first instance is started.  This helps the
security if BGP is not used but daemon is started.  It also addresses some
issues like MD5 not working on listener unless IPV6 configured (because
listener was not in list); as well as compiler warnings.

* bgp_network.c: (bgp_listener) listen socket creation consolidated here
  (bgp_socket) Use bgp_listener
* bgpd.c: (bgp_get) call bgp_socket on creation of first struct bgp.
  (bgp_init) remove bgp_socket call.
* memtypes.c: Add MTYPE_BGP_LISTENER
2009-07-28 10:04:38 +01:00
Chris Caputo
228da42898 [bgpd] Stability fixes including bugs 397, 492
I've spent the last several weeks working on stability fixes to bgpd.
These patches fix all of the numerous crashes, assertion failures, memory
leaks and memory stomping I could find.  Valgrind was used extensively.

Added new function bgp_exit() to help catch problems.  If "debug bgp" is
configured and bgpd exits with status of 0, statistics on remaining
lib/memory.c allocations are printed to stderr.  It is my hope that other
developers will use this to stay on top of memory issues.

Example questionable exit:

  bgpd: memstats: Current memory utilization in module LIB:
  bgpd: memstats:  Link List                     :          6
  bgpd: memstats:  Link Node                     :          5
  bgpd: memstats:  Hash                          :          8
  bgpd: memstats:  Hash Bucket                   :          2
  bgpd: memstats:  Hash Index                    :          8
  bgpd: memstats:  Work queue                    :          3
  bgpd: memstats:  Work queue item               :          2
  bgpd: memstats:  Work queue name string        :          3
  bgpd: memstats: Current memory utilization in module BGP:
  bgpd: memstats:  BGP instance                  :          1
  bgpd: memstats:  BGP peer                      :          1
  bgpd: memstats:  BGP peer hostname             :          1
  bgpd: memstats:  BGP attribute                 :          1
  bgpd: memstats:  BGP extra attributes          :          1
  bgpd: memstats:  BGP aspath                    :          1
  bgpd: memstats:  BGP aspath str                :          1
  bgpd: memstats:  BGP table                     :         24
  bgpd: memstats:  BGP node                      :          1
  bgpd: memstats:  BGP route                     :          1
  bgpd: memstats:  BGP synchronise               :          8
  bgpd: memstats:  BGP Process queue             :          1
  bgpd: memstats:  BGP node clear queue          :          1
  bgpd: memstats: NOTE: If configuration exists, utilization may be expected.

Example clean exit:

  bgpd: memstats: No remaining tracked memory utilization.

This patch fixes bug #397: "Invalid free in bgp_announce_check()".

This patch fixes bug #492: "SIGBUS in bgpd/bgp_route.c:
bgp_clear_route_node()".

My apologies for not separating out these changes into individual patches.
The complexity of doing so boggled what is left of my brain.  I hope this
is all still useful to the community.

This code has been production tested, in non-route-server-client mode, on
a linux 32-bit box and a 64-bit box.

Release/reset functions, used by bgp_exit(), added to:

  bgpd/bgp_attr.c,h
  bgpd/bgp_community.c,h
  bgpd/bgp_dump.c,h
  bgpd/bgp_ecommunity.c,h
  bgpd/bgp_filter.c,h
  bgpd/bgp_nexthop.c,h
  bgpd/bgp_route.c,h
  lib/routemap.c,h

File by file analysis:

* bgpd/bgp_aspath.c: Prevent re-use of ashash after it is released.

* bgpd/bgp_attr.c: #if removed uncalled cluster_dup().

* bgpd/bgp_clist.c,h: Allow community_list_terminate() to be called from
  bgp_exit().

* bgpd/bgp_filter.c: Fix aslist->name use without allocation check, and
  also fix memory leak.

* bgpd/bgp_main.c: Created bgp_exit() exit routine.  This function frees
  allocations made as part of bgpd initialization and, to some extent,
  configuration.  If "debug bgp" is configured, memory stats are printed
  as described above.

* bgpd/bgp_nexthop.c: zclient_new() already allocates stream for
  ibuf/obuf, so bgp_scan_init() shouldn't do it too.  Also, made it so
  zlookup is global so bgp_exit() can use it.

* bgpd/bgp_packet.c: bgp_capability_msg_parse() call to bgp_clear_route()
  adjusted to use new BGP_CLEAR_ROUTE_NORMAL flag.

* bgpd/bgp_route.h: Correct reference counter "lock" to be signed.
  bgp_clear_route() now accepts a bgp_clear_route_type of either
  BGP_CLEAR_ROUTE_NORMAL or BGP_CLEAR_ROUTE_MY_RSCLIENT.

* bgpd/bgp_route.c:
  - bgp_process_rsclient(): attr was being zero'ed and then
    bgp_attr_extra_free() was being called with it, even though it was
    never filled with valid data.

  - bgp_process_rsclient(): Make sure rsclient->group is not NULL before
    use.

  - bgp_processq_del(): Add call to bgp_table_unlock().

  - bgp_process(): Add call to bgp_table_lock().

  - bgp_update_rsclient(): memset clearing of new_attr not needed since
    declarationw with "= { 0 }" does it.  memset was already commented
    out.

  - bgp_update_rsclient(): Fix screwed up misleading indentation.

  - bgp_withdraw_rsclient(): Fix screwed up misleading indentation.

  - bgp_clear_route_node(): Support BGP_CLEAR_ROUTE_MY_RSCLIENT.

  - bgp_clear_node_queue_del(): Add call to bgp_table_unlock() and also
    free struct bgp_clear_node_queue used for work item.

  - bgp_clear_node_complete(): Do peer_unlock() after BGP_EVENT_ADD() in
    case peer is released by peer_unlock() call.

  - bgp_clear_route_table(): Support BGP_CLEAR_ROUTE_MY_RSCLIENT.  Use
    struct bgp_clear_node_queue to supply data to worker.  Add call to
    bgp_table_lock().

  - bgp_clear_route(): Add support for BGP_CLEAR_ROUTE_NORMAL or
    BGP_CLEAR_ROUTE_MY_RSCLIENT.

  - bgp_clear_route_all(): Use BGP_CLEAR_ROUTE_NORMAL.

  Bug 397 fixes:

    - bgp_default_originate()
    - bgp_announce_table()

* bgpd/bgp_table.h:
  - struct bgp_table: Added reference count.  Changed type of owner to be
    "struct peer *" rather than "void *".

  - struct bgp_node: Correct reference counter "lock" to be signed.

* bgpd/bgp_table.c:
  - Added bgp_table reference counting.

  - bgp_table_free(): Fixed cleanup code.  Call peer_unlock() on owner if
    set.

  - bgp_unlock_node(): Added assertion.

  - bgp_node_get(): Added call to bgp_lock_node() to code path that it was
    missing from.

* bgpd/bgp_vty.c:
  - peer_rsclient_set_vty(): Call peer_lock() as part of peer assignment
    to owner.  Handle failure gracefully.

  - peer_rsclient_unset_vty(): Add call to bgp_clear_route() with
    BGP_CLEAR_ROUTE_MY_RSCLIENT purpose.

* bgpd/bgp_zebra.c: Made it so zclient is global so bgp_exit() can use it.

* bgpd/bgpd.c:
  - peer_lock(): Allow to be called when status is "Deleted".

  - peer_deactivate(): Supply BGP_CLEAR_ROUTE_NORMAL purpose to
    bgp_clear_route() call.

  - peer_delete(): Common variable listnode pn.  Fix bug in which rsclient
    was only dealt with if not part of a peer group.  Call
    bgp_clear_route() for rsclient, if appropriate, and do so with
    BGP_CLEAR_ROUTE_MY_RSCLIENT purpose.

  - peer_group_get(): Use XSTRDUP() instead of strdup() for conf->host.

  - peer_group_bind(): Call bgp_clear_route() for rsclient, and do so with
    BGP_CLEAR_ROUTE_MY_RSCLIENT purpose.

  - bgp_create(): Use XSTRDUP() instead of strdup() for peer_self->host.

  - bgp_delete(): Delete peers before groups, rather than after.  And then
    rather than deleting rsclients, verify that there are none at this
    point.

  - bgp_unlock(): Add assertion.

  - bgp_free(): Call bgp_table_finish() rather than doing XFREE() itself.

* lib/command.c,h: Compiler warning fixes.  Add cmd_terminate().  Fixed
  massive leak in install_element() in which cmd_make_descvec() was being
  called more than once for the same cmd->strvec/string/doc.

* lib/log.c: Make closezlog() check fp before calling fclose().

* lib/memory.c: Catch when alloc count goes negative by using signed
  counts.  Correct #endif comment.  Add log_memstats_stderr().

* lib/memory.h: Add log_memstats_stderr().

* lib/thread.c: thread->funcname was being accessed in thread_call() after
  it had been freed.  Rearranged things so that thread_call() frees
  funcname.  Also made it so thread_master_free() cleans up cpu_record.

* lib/vty.c,h: Use global command_cr.  Add vty_terminate().

* lib/zclient.c,h: Re-enable zclient_free().
2009-07-19 18:28:08 +01:00
Stephen Hemminger
3fa3f957e7 [lib] Fix IPv6 normalisation
* lib/sockunion.c: (sockunion_normalise_mapped) The code to normalize
  address was not copying port value - probably reason why IPV4 in IPV6
  never worked right.
2009-07-16 18:13:00 +01:00
Paul Jakma
41b2373cec [lib/cleanup] Use a typedef for the thread type
* lib/thread.{c,h}: As per subject. This will avoid head-scratching for next
  person who adds a thread-type and gets strange breakage.
2009-06-30 16:12:49 +01:00
Chris Caputo
2b35ae41c2 Fixes to RFC2385/MD5 BGP
* bgpd/bgp_network.c: Fix MD5 listen in IPv4 version of bgp_socket() by
  adding listen socket to listen_sockets list so that MD5 passwords can
  get set.
* lib/sockopt.c: (sockopt_tcp_signature) Fix bogus "% Error while applying
  TCP-Sig to session(s)" / "can't set TCP_MD5SIG option" startup error
  messages by not returning error when there isn't one.
2009-06-23 14:21:40 +01:00
Paul Jakma
6511cab267 [configure] Refine CLOCK_MONOTONIC test
* configure.ac: Check for the actual CLOCK_MONOTONIC symbol, as clock_gettime
  need not imply that clock type is supported
* lib/zebra.h: use the method given in autoconf docs for sys/time.h
  inclusion
2009-06-18 20:18:31 +01:00
Stephen Hemminger
8e4c09307d [cleanup] Allow message tables to be constant
Avoid bugs, and improve cache locality by allowing message lists
to be read/only.
2009-06-18 20:18:29 +01:00
Stephen Hemminger
65d3fbb483 [cleanup] Use const in smux interface
smux_trap and oid_copy should allow read-only source.
2009-06-18 20:18:29 +01:00
Stephen Hemminger
94fc1dd41c [lib] Put symbolic backtrace on system log
When BGP crashes, sometimes all we get to see is syslog.
2009-06-18 20:18:27 +01:00
Stephen Hemminger
e5862a2df2 [lib] sockopt_tcp_signature: sin6 requires HAVE_IPV6
An external user was building on system without IPv6 and
it wouldn't work.
2009-06-18 20:18:27 +01:00
Stephen Hemminger
80c375e72d [gcc] Add gcc printf format checks 2009-06-18 20:18:24 +01:00
Stephen Hemminger
7fc626de5f [cleanup] Make command nodes static
The cmd_nodes used to configure vty, can mostly be static so
(basic data hiding 101).
2009-06-12 17:10:29 +01:00
Stephen Hemminger
66e5cd8719 [cleanup] functions taking no args should be declared with void args
Use Ansi-C prototypes rather than old K&R method of declaring
function without arguments
2009-06-12 17:09:03 +01:00
Stephen Hemminger
cedd7f2fa6 [cleanup] add const attribute to lib/if.c::if_dump 2009-06-12 17:08:26 +01:00
Stephen Hemminger
393deb9bd6 [cleanup] Convert XMALLOC/memset to XCALLOC
Simple conversion of XMALLOC/memset to XCALLOC
2009-06-12 17:07:49 +01:00
Paul Jakma
3453a7122c [bgpd] Add support for the old Linux 2.4, TCP_MD5_AUTH RFC2385 patch
* configure.ac: Add a --enable-linux24-tcp-md5 argument, to compile in
  support for the old TCP-MD5 patch for Linux 2.4 systems.  This overrides
  auto-detection of TCP-MD5 supported by the target system.
* lib/sockopt.c: (sockopt_tcp_signature) add in a variant for the old
  Linux 2.4, TCP_MD5_AUTH variant of TCP-MD5 support, conditional
  on the previous configure arg.
2009-06-12 14:21:02 +01:00
Chris Caputo
0be8dfb2a9 [snmp] Compiler warning fixes for when "--enable-snmp" is configured.
Compiled on 32-bit and 64-bit linux gcc 4.1.2 platforms.
No run-time testing on 32-bit and limited run-time testing on 64-bit.
2009-06-02 18:45:10 +01:00