]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
13 years agobgpd: "Intern" communities in route maps
Michael Lambert [Sat, 24 Jul 2010 16:44:07 +0000 (12:44 -0400)]
bgpd: "Intern" communities in route maps

* bgp_community.[ch]: (community_lookup) New helper function to look
  up a community list in the hash table.

* bgp_routemap.c: A new community structure was being allocated for
  every BGP update which matched a route map which set a community.
  This behavior led to rapid growth in the memory consumed by bgpd.
  Adding the communities to the hash table addresses the memory
  growth, but may introduce a problem in modifying or deleting the
  'set community' statement in the route map.

13 years agobgpd: New show commands for improved view and address family support
Michael Lambert [Fri, 23 Jul 2010 18:43:04 +0000 (14:43 -0400)]
bgpd: New show commands for improved view and address family support

Many show commands do not have support for multiple views and do not
treat different address families uniformly.  The following changes add
a number of commands with support for views and rationalized treatment
of IPv4 v IPv6 and unicast v multicast (such as in JUNOS, IOS XR and
more recent versions of IOS).

* bgp_route.c: (bgp_show_community) Inserted a new second argument (the
  name of the view) and the code to look up that name in the BGP structure.
  The NULL argument in the call to bgp_show (indicating the default view)
  was replaced by the specified view.  The existing calls to
  bgp_show_community had a NULL second argument inserted to make clear
  that they refer to the default view.

  (top level) Added new functions via the DEFUN and/or ALIAS macros (and
  the associated command table entries) to add the commands

    show bgp ipv4 (unicast|multicast)
    show bgp ipv4 (unicast|multicast) A.B.C.D
    show bgp ipv4 (unicast|multicast) A.B.C.D/M
    show bgp ipv6 (unicast|multicast)
    show bgp ipv6 (unicast|multicast) X:X::X:X
    show bgp ipv6 (unicast|multicast) X:X::X:X/M

      These show either the full BGP table or the specified route or
      prefix for the given address family.

    show bgp view WORD (ipv4|ipv6) (unicast|multicast) community
    show bgp view WORD (ipv4|ipv6) (unicast|multicast) community \
            (AA:NN|local-AS|no-advertise|no-export){1,4}

      For the specified view and address family, these show entries
      matching any community or the specified communit(y)(ies).

    show bgp view WORD (ipv4|ipv6) (unicast|multicast) neighbors \
            (A.B.C.D|X:X::X:X) (advertised-routes|received-routes)

      For the specified view and address family, show the routes
      advertised to or received from the given BGP neighbor.

    show bgp [view WORD] ipv4 (unicast|multicast) \
            rsclient (A.B.C.D|X:X::X:X)
    show bgp [view WORD] ipv4 (unicast|multicast) \
            rsclient (A.B.C.D|X:X::X:X) A.B.C.D
    show bgp [view WORD] ipv4 (unicast|multicast) \
            rsclient (A.B.C.D|X:X::X:X) A.B.C.D/M
    show bgp [view WORD] ipv6 (unicast|multicast) \
            rsclient (A.B.C.D|X:X::X:X)
    show bgp [view WORD] ipv6 (unicast|multicast) \
            rsclient (A.B.C.D|X:X::X:X) X:X::X:X
    show bgp [view WORD] ipv6 (unicast|multicast) \
            rsclient (A.B.C.D|X:X::X:X) X:X::X:X/M

      For the specifed (optional) view and address family, show either
      the full BGP table or the specified route or prefix for the given
      route server client peer.

* bgp_vty.c: (top level) Added new functions via the DEFUN and/or ALIAS
  macros (and the associated command table entries) to add the commands

    show bgp [view WORD] (ipv4|ipv6) (unicast|multicast) summary
    show bgp [view WORD] (ipv4|ipv6) (unicast|multicast) rsclient summary

      For the specified (optional) view and address family, display
      either the normal summary table for BGP peers, or the route server
      client table showing the import and export policies.

13 years agorelease: 0.99.18
Paul Jakma [Mon, 21 Mar 2011 14:56:00 +0000 (14:56 +0000)]
release: 0.99.18

* configure.ac: Bump to 0.99.18

13 years agobgpd: Remove AS Path limit/TTL functionality
Paul Jakma [Sun, 5 Dec 2010 20:28:02 +0000 (20:28 +0000)]
bgpd: Remove AS Path limit/TTL functionality

* draft-ietf-idr-as-pathlimit doesn't seem to have gone anywhere, and its
  author does not think it will make progress in IDR. Remove all support
  introduced for it, but leave stubs for the commands to avoid breaking
  any configurations.

  Basically reverts cecab5e9725792e60a5e4b473e238a14cd85815d.

13 years agobgpd/security: CVE-2010-1674 Fix crash due to extended-community parser error
Paul Jakma [Sun, 5 Dec 2010 17:17:26 +0000 (17:17 +0000)]
bgpd/security: CVE-2010-1674 Fix crash due to extended-community parser error

* bgp_attr.c: (bgp_attr_ext_communities) Certain extended-community attrs
  can leave attr->flag indicating ext-community is present, even though no
  extended-community object has been attached to the attr structure.  Thus a
  null-pointer dereference can occur later.
  (bgp_attr_community) No bug fixed here, but tidy up flow so it has same
  form as previous.

  Problem and fix thanks to anonymous reporter.

13 years agoospf6d: Extend the "[no] debug ospf6 route" vty commands
Tom Goff [Wed, 10 Nov 2010 21:02:11 +0000 (13:02 -0800)]
ospf6d: Extend the "[no] debug ospf6 route" vty commands

* ospf6_route.c ([no_]debug_ospf6_route) Include memory as a debug
  option.  This allows ospf6 route memory debugging to be enabled or
  disabled interactively or from a config file.

13 years agoospf6d: Route locking (memory) cleanup
Tom Goff [Wed, 10 Nov 2010 21:03:02 +0000 (13:03 -0800)]
ospf6d: Route locking (memory) cleanup

* ospf6_route.c: (ospf6_route_best_next) Allows unlock route, even
  when there's no next route.  This is consistent with how
  ospf6_route_next() behaves.

* ospf6_intra.c: (ospf6_intra_prefix_lsa_remove) Make sure the last
  route considered is always unlocked.  This is needed when the for
  loop terminates because ospf6_route_is_prefix() returns zero.

13 years agoospf6d: Have ospf6d cleanup when it terminates normally
Tom Goff [Wed, 10 Nov 2010 21:01:41 +0000 (13:01 -0800)]
ospf6d: Have ospf6d cleanup when it terminates normally

A clean exit makes it easier to use memory debuggers.

* ospf6_asbr.c: (ospf6_asbr_terminate) Add a function to do route map
  cleanup.
* ospf6_lsa.c: (ospf6_lsa_terminate) Add a function to cleanup the lsa
  handler vector.
* ospf6_main.c: (ospf6_exit) Add an function that causes ospf6d to
  gracefully exit.
* ospf6_message.c: (ospf6_message_terminate) Add a function that frees
  the send and receive buffers.
* ospf6_top.c: (ospf6_delete) Enable the ospf6_delete() function.
  Disable ospf6 before freeing everything.

13 years agoospf6d: Remove obsolete code
Tom Goff [Wed, 10 Nov 2010 21:03:23 +0000 (13:03 -0800)]
ospf6d: Remove obsolete code

* ospf6_area.c: (ospf6_area_delete) Get rid of unused code that refers
    to a nonexistent function and structure member.

13 years agoospf6d: Fix memory allocation issues in SPF
Tom Goff [Wed, 10 Nov 2010 21:02:38 +0000 (13:02 -0800)]
ospf6d: Fix memory allocation issues in SPF

* ospf6_area.c: Call ospf6_spf_table_finish() before deleting the spf
    table.  This ensures that the associated ospf6_vertex structures
    are also freed.
* ospf6_spf.c: Only allocate a priority queue when a spf calculation
    is actually performed.  Also defer calling ospf6_spf_table_finish().

13 years agolib: zlog should clean up its memory
Tom Goff [Wed, 10 Nov 2010 21:01:17 +0000 (13:01 -0800)]
lib: zlog should clean up its memory

* log.c: (closezlog) Also free the dynamically allocated filename when
    a log is closed.

13 years agolib: Add a function to delete all interfaces
Tom Goff [Wed, 10 Nov 2010 21:00:54 +0000 (13:00 -0800)]
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().

13 years agobgpd: use Jenkins hash for BGP transit, cluster and attr hashes
Stephen Hemminger [Fri, 27 Aug 2010 21:12:54 +0000 (14:12 -0700)]
bgpd: use Jenkins hash for BGP transit, cluster and attr hashes

* bgp_attr.c: I observed while doing some debugging that even for simple
  tests there was a lot of hash collisions for BGP attributes.  Switch to
  using Jhash rather than additive hashing.  Probably overkill, but the
  function is fast and available.

  ({attrhash,cluster,transit}_hask_key_make) convert to Jenkins hash,
  instead of additive hash.

13 years agolib: Better hashing of string values using Bernstein hash
Stephen Hemminger [Fri, 27 Aug 2010 21:11:14 +0000 (14:11 -0700)]
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

13 years agobgpd: Remove extra lock on interior table node
Barry Friedman [Thu, 3 Feb 2011 22:02:53 +0000 (14:02 -0800)]
bgpd: Remove extra lock on interior table node

If the radix tree creates an extra interior node in bgp_node_get(),
it locks the interior node even though this node is not returned to
the caller, so it may never be unlocked. The lock prevents this node
from being deleted.

* bgpd/bgp_table.c: (bgp_node_get) Remove lock on interior node which
  prevents proper node deletion

13 years agobgpd: Fix display of unsigned attributes
Wataru Tanitsu [Fri, 10 Sep 2010 16:47:56 +0000 (09:47 -0700)]
bgpd: Fix display of unsigned attributes

* bgp_route.c: (route_vty_out*) The local prefix, metric and weight values
  are all stored as uint32_t.  Change the format to %u so that large values
  are not displayed as negative integers.

13 years agobgpd: fix use of free memory by update_rsclient
Stephen Hemminger [Thu, 5 Aug 2010 17:26:31 +0000 (10:26 -0700)]
bgpd: fix use of free memory by update_rsclient

* bgp_route.c: (bgp_static_update_rsclient) BGP sometimes crashes when
  removing route server client because of use after free.

  The code to update rsclient created a local static copy of bgp attributes
  but neglected to handle the extra information pointer.  The extra
  information was getting freed by bgp_attr_unintern() and reused later when
  the copy was passed to bgp_attr_intern().

  The fix is to use the attr_dup function to create a copy of the extra
  information, then clean it up.

13 years agobgpd: unlock node on aggregate error
Robert Bays [Thu, 5 Aug 2010 17:26:29 +0000 (10:26 -0700)]
bgpd: unlock node on aggregate error

* bgp_route.c: (bgp_aggregate_set) make sure to unlock BGP node if failure

13 years agobgpd: fix errors in aggregate address command
Robert Bays [Thu, 5 Aug 2010 17:26:28 +0000 (10:26 -0700)]
bgpd: fix errors in aggregate address command

* bgpd: (bgp_aggregate_{set,unset,delete}) This fixes locking and other
  issues with aggregate set/unset command

13 years agobgpd: use XCALLOC to allocate bgpd damp array
Stephen Hemminger [Thu, 5 Aug 2010 17:26:30 +0000 (10:26 -0700)]
bgpd: use XCALLOC to allocate bgpd damp array

* bgpd: (bgp_damp_parameter_set) The BGP reuse_index is not initialized
  properly.  This would cause sporadic crash when disabling dampening.  Use
  XCALLOC correctly and the right size array is initialized and no memset is
  needed.

13 years agobgpd: fix bgp_node locking issues
Chris Caputo [Tue, 27 Jul 2010 16:28:55 +0000 (16:28 +0000)]
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.

13 years agolib: Fix accounting of memory
Chris Hall [Fri, 23 Jul 2010 18:27:11 +0000 (11:27 -0700)]
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.

13 years agoMerge paul/ospfd/201012-review ospfd and lib/ fixes and performance improvements
Paul Jakma [Sun, 20 Mar 2011 22:08:02 +0000 (22:08 +0000)]
Merge paul/ospfd/201012-review ospfd and lib/ fixes and performance improvements

13 years agodoc: fix "ipv6 address" interface command syntax (#608)
Denis Ovsienko [Fri, 18 Mar 2011 17:20:53 +0000 (20:20 +0300)]
doc: fix "ipv6 address" interface command syntax (#608)

13 years agobgpd: improve "monotonic" uptime correction
John Kemp [Fri, 18 Mar 2011 14:52:18 +0000 (17:52 +0300)]
bgpd: improve "monotonic" uptime correction

Older versions of Quagga/Zebra would output a value in MRT table
dump files for "uptime" aka "ORIGINATED" that was a WALL clock
value.  Given that uptime is now internally a bgp_clock MONOTONIC
value, the output in the MRT files is showing up as monotonic.

Note: time of MRT dump is still recorded correctly as a
time() based value, so we haven't lost that value.

Proposal is to correct the uptime output on the vty and in the
MRT files to again display something more akin to WALL time.

* bgp_dump.c: (bgp_dump_routes_func) add conditional correction
* bgp_route.c: (route_vty_out_detail) make correction conditional, move
  variable declaration to beginning of the function

13 years agoripngd: copy debug statements fix from ripd
Stephen Hemminger [Sat, 12 Mar 2011 22:14:08 +0000 (01:14 +0300)]
ripngd: copy debug statements fix from ripd

Doesn't ripng needs same fix as ripd.

13 years agoripd: resolve debug statements issue (bug 442)
Andrew J. Schorr [Thu, 24 Feb 2011 10:52:14 +0000 (13:52 +0300)]
ripd: resolve debug statements issue (bug 442)

...A nasty bug, if you forgot to disable debugging, stored the config
and reboot your machine - if you really depend on ripd, then the machine
will not fully come back on the network, because ripd fails.

13 years agobgpd: VTY string fixes for debug commands
David Ward [Mon, 17 Jan 2011 07:58:52 +0000 (10:58 +0300)]
bgpd: VTY string fixes for debug commands

* bgpd/bgp_debug.c: fix VTY strings for BGP debug commands to match
  correct syntax

13 years agobgpd: fix handling of "Unsupported Capability"
Dmitrij Tejblum [Fri, 14 Jan 2011 15:27:05 +0000 (18:27 +0300)]
bgpd: fix handling of "Unsupported Capability"

* bgp_packet.c: (bgp_notify_receive) justify the difference between
BGP_NOTIFY_OPEN_UNSUP_PARAM and BGP_NOTIFY_OPEN_UNSUP_CAPBL cases, as
it is explained in RFC5492, page 3, paragraph 1.

"Unsupported Capability" error does not mean, that the peer doesn't
support capabilities advertisement -- quite the opposite (if the peer
would not support capabilities advertisement, the code would be
"Unsupported Optional Parameter"). Thus there is no reason to mark
the peer as one non-supporting capabilities advertisement.

Example: suppose the peer is in fact IPv6-only, but we didn't configure
anything address-family specific for it. Then, the peer would refuse
the session with "Unsupported Capability" code. If we internally set
the peer as non-supporting capabilities advertisement after that, we
will not be able to establish the session with it ever, even with a
fixed configuration -- IPv6-only BGP session cannot be established
without capabilities.

In practice an edge case would be seen as the same IPv6 peer working
with its "neighbor" block read from bgpd.conf, but not working, when
slowly input in "conf t" mode.

13 years agoospf6d: fix crash in SPF calculation
Dmitrij Tejblum [Thu, 13 Jan 2011 15:25:40 +0000 (18:25 +0300)]
ospf6d: fix crash in SPF calculation

* ospf6_spf.c: Don't replace a node with another node with a lower
  number of hops, instead get them from the queue in the correct
  order. (Actually, the replacement crashed the ospf6d daemon
  rather than worked.)

13 years agoospfd: Remove oi field from LSA, have network_lsa_refresh look up when needed
Paul Jakma [Thu, 15 Apr 2010 07:11:51 +0000 (08:11 +0100)]
ospfd: Remove oi field from LSA, have network_lsa_refresh look up when needed

* ospf_lsa.h: (struct ospf_lsa) remove oi pointer
* ospf_lsa.c: (ospf_network_lsa_refresh) instead of keeping a pointer, just
  lookup the oi when it's needed. This decouples network LSA from oi lifetime
  and avoids having to invalidate pointers in LSAs when an oi changes,
  simplifying the code.

13 years agoospfd: potential fix for router-id change assert on refresh cleanup patch
Paul Jakma [Wed, 14 Apr 2010 09:32:12 +0000 (10:32 +0100)]
ospfd: potential fix for router-id change assert on refresh cleanup patch

* ospf_lsa.c: (various) unregister LSAs from refresher before flushing.

13 years agoospfd: Fix maxage/flush to not try flood twice, remember maxages for longer
Paul Jakma [Sun, 24 Jan 2010 23:36:20 +0000 (23:36 +0000)]
ospfd: Fix maxage/flush to not try flood twice, remember maxages for longer

2006-05-30 Paul Jakma <paul.jakma@sun.com>

* (general) Fix confusion around MaxAge-ing and problem with
  high-latency networks. Analysis and suggested fixes by
  Phillip Spagnolo, in [quagga-dev 4132], on which this commit
  expands slightly.
* ospf_flood.{c,h}: (ospf_lsa_flush) new function.
  Scope-general form of existing flush functions, essentially
  the dormant ospf_maxage_flood() but without the ambiguity of
  whether it is responsible for flooding.
* ospf_lsa.c: (ospf_lsa_maxage) Role minimised to simply setup
  LSA on the Maxage list and schedule removal - no more.
  ospf_lsa_flush* being the primary way to kick-off flushes
  of LSAs.
  Don't hardcode the remover-timer value, which was too
  short for very high-latency networks.
  (ospf_maxage_lsa_remover) Just do what needs to be done to
  remove maxage LSAs from the maxage list, remove the call
  to ospf_flood_through().
  Don't hardcode remove-timer value.
  (ospf_lsa_{install,flush_schedule}) ospf_lsa_flush is the correct
  entrypoint to flushing maxaged LSAs.
  (lsa_header_set) Use a define for the initial age, useful for
  testing.
* ospf_opaque.c: (ospf_opaque_lsa_refresh) ditto.
  (ospf_opaque_lsa_flush_schedule) ditto.
* ospfd.h: ({struct ospf,ospf_new}) Add maxage_delay parameter,
  interval to wait before running the maxage_remover. Supply a
  suitable default.
  Add a define for OSPF_LSA_INITIAL_AGE, see lsa_header_set().

13 years agoospfd: Unify router and network LSA refresh logic with general refresher
Paul Jakma [Sun, 24 Jan 2010 22:42:13 +0000 (22:42 +0000)]
ospfd: Unify router and network LSA refresh logic with general refresher

* (general) Get rid of the router and network LSA specific refresh timers
  and make the general refresher do this instead. Get rid of the twiddling
  of timers for router/network LSA that was spread across the code.

  This lays the foundations for future, general LSA refresh improvements,
  such as making sequence rollover work, and having generic LSA delays.

* ospfd.h: (struct ospf) Bye bye to the router-lsa update timer thread
  pointer.
  (struct ospf_area) and to the router-lsa refresh timer.
* ospf_interface.h: Remove the network_lsa_self timer thread pointer
* ospf_lsa.h: (struct ospf_lsa) oi field should always be there, for benefit
  of type-2/network LSA processing.
  (ospf_{router,network}_lsa_{update_timer,timer_add}) no timers for these
  more
  (ospf_{router,network}_lsa_update) more generic functions to indicate that some
  router/network LSAs need updating
  (ospf_router_lsa_update_area) update router lsa in a particular area alone.
  (ospf_{summary,summary_asbr,network}_lsa_refresh) replaced by the general
  ospf_lsa_refresh function.
  (ospf_lsa_refresh) general LSA refresh function

13 years agoospfd: Remember network LSA sequence numbers across up/downs of an interface
Paul Jakma [Tue, 13 Oct 2009 15:13:13 +0000 (16:13 +0100)]
ospfd: Remember network LSA sequence numbers across up/downs of an interface

* ospf_interface.h: (struct ospf_if_params) add field for saved network LSA
  seqnum
* ospf_interfa.c: (ospf_new_if_params) init network_lsa_seqnum field to
  initial seqnum - doesnt matter though.
* ospf_lsa.c: (ospf_network_lsa_new) check for any saved sequence number,
  and use if it exists.  Save the result back. This should help avoid needless
  round of LSUpdate/LSRequests when a neighbour has to tell the originator
  "uhm, i have something newer than that already".
* ospf_vty.c: (show_ip_ospf_interface_sub) Show the saved network LSA seqnum

13 years agoospfd: Prioritise hellos for sending by queueing to head of output buffer
Paul Jakma [Fri, 8 Jan 2010 17:11:15 +0000 (17:11 +0000)]
ospfd: Prioritise hellos for sending by queueing to head of output buffer

* It's possible for the packet output buffer to be filled up with a long
  series of non-Hello packets in between Hellos packets, such that the
  router's neighbours don't receive the Hello packet in time, even though
  the hello-timer ran at about the right time. Fix this by prioritising
  Hello packets, letting them skip the queue and go ahead of any packets
  already on the queue.

  This problem can occur when there are lots of LSAs and slow links.

* ospf_packet.h: (ospf_hello_send_sub) not used outside of ospf_packet.c
* ospf_packet.c: (ospf_fifo_push_head) add packet to head of fifo (so its
  no longer really a fifo, but hey)
  (ospf_packet_add_top) add packet to top of the packet output queue.
  (ospf_hello_send_sub) Put Hello's at the top of the packet output queue.
  make it take in_addr_t parameter, so that this
  ospf_hello_send can re-use this code too.
  (ospf_hello_send) consolidate code by using ospf_hello_send_sub
  (ospf_poll_send,ospf_hello_reply_timer) adjust for ospf_hello_send_sub.

13 years agoospfd: Reset neighbour inactivity timer for any packet arrival
Paul Jakma [Thu, 7 Jan 2010 06:12:53 +0000 (06:12 +0000)]
ospfd: Reset neighbour inactivity timer for any packet arrival

* The hello protocol monitors connectivity in 2 different ways:

  a) local -> remote
  b) remote -> local

  Connectivity is required in both directions (2-way) for adjacencies to
  form.

  The first requires a round-trip to detect, and is done by advertising
  which other hosts a router knows about in its hello messages.  This allows
  a host to detect which other routers are and are not receiving its
  message.  If a remote neighbour delists the local router, then the local
  router raises a "1-Way Received" event.

  The latter is straight-forward, and is detected by setting a timer for the
  neighbour. If another Hello packet is not received within this time then
  the neighbour is dead, and a separate "Inactive" event is raised.

  These are 2 different and relatively independent measures.

  Knowing that we can optimise the 2nd, remote->local measure and reset
  the timer when /any/ packet arrives from that neighbour. For any packet
  is as good as a Hello packet. This can help in marginal situations, where
  the number of protocol messages that must be sent sometimes can exceed
  the capacity of the network to transmit the messages within the configured
  dead-time. I.e. an OSPF network with lots of LSAs, slow links and/or
  slow hosts (e.g. O(10k) LSAs, O(100kbit) links, embedded CPUs, and O(10s)
  dead-times).

  This optimisation allows an OSPF network to run closer to this margin,
  and/or allows networks to perhaps better cope with rare periods of
  exceptional load, where otherwise they would not.

  It's fully compatible with plain OSPF implementations and doesn't
  prejudice dead-neighbour detection.

* ospf_nsm.h: Rename HelloReceived event to PacketReceived.
* ospf_nsm.c: (nsm_hello_received) -> nsm_packet_received
* ospf_packet.c: Schedule PacketReceived whenever a valid message is
  received.

13 years agoospfd: the maxage_lsa_remover should check whether it needs to yield the cpu
Paul Jakma [Sat, 9 Jan 2010 14:11:02 +0000 (14:11 +0000)]
ospfd: the maxage_lsa_remover should check whether it needs to yield the cpu

13 years agoospfd: Fix various route_unlock discrepencies
Paul Jakma [Tue, 13 Apr 2010 21:43:34 +0000 (22:43 +0100)]
ospfd: Fix various route_unlock discrepencies

* ospf_ase.c: (ospf_ase_calculate_route) Fix compiler warning about eval
  needing brackets.
  (various) add defensive asserts.
* ospf_lsdb.c: (ospf_lsdb_add) add missing node unlock if same lsa already
  was indexed.
  (ospf_lsdb_delete) check it's actually the same as specified lsa before
  deleting
  (ospf_lsdb_lookup_by_id_next) fix another corner case - no result =>
  don't go on.

13 years agoospfd: fix lsa_refresh_walker unlock before use bug
Paul Jakma [Tue, 13 Apr 2010 21:33:54 +0000 (22:33 +0100)]
ospfd: fix lsa_refresh_walker unlock before use bug

* ospf_lsa.c: (ospf_lsa_refresh_walker) fix an "unlock before use" bug
  (various) add asserts for lsa refcounting.

13 years agoospfd: interface code should leave network_lsa_self alone
Paul Jakma [Sun, 24 Jan 2010 21:34:54 +0000 (21:34 +0000)]
ospfd: interface code should leave  network_lsa_self alone

* ospf_interface.c: (ospf_if_{new,cleanup}) don't touch the network_lsa_self,
  ISM and NSM take care of cleaning it up if needs be + we want to keep
  network_lsa_self around when possible for the the seqnum.

  This shouldn't really make much difference though, particularly as we have
  a separate sequence number memory mechanism.

13 years agoospfd: OSPF_MIN_LS_ARRIVAL compare should be >= to match ospf_flood
Paul Jakma [Mon, 11 Jan 2010 16:22:12 +0000 (16:22 +0000)]
ospfd: OSPF_MIN_LS_ARRIVAL compare should be >= to match ospf_flood

* ospf_packet.c: (ospf_ls_upd) the corresponding test on the arrival side
  in (ospf_flood) is <, so this should be >=, not >, purely for consistency.

  There is no practical effect here though.

13 years agoospfd: ospf_if_free can leave dangling references on ISM events - cancel them
Paul Jakma [Thu, 15 Apr 2010 10:39:05 +0000 (11:39 +0100)]
ospfd: ospf_if_free can leave dangling references on ISM events - cancel them

* ospf_interface.c: (ospf_if_free) events with dangling pointers left
  scheduled can be seriously bad for ospfd's health. Cancel the event.

13 years agoospfd: Lower level of some common messages from info to debug
Paul Jakma [Mon, 6 Dec 2010 12:21:52 +0000 (12:21 +0000)]
ospfd: Lower level of some common messages from info to debug

* ospf_{ism,network}.c: Certain oft-repeated but trivial messages should be
  debug log level, not info, to avoid spamming 'terminal monitor'

13 years agolib: Fix bug in prefix trie lookup
Paul Jakma [Tue, 13 Apr 2010 21:42:33 +0000 (22:42 +0100)]
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.

13 years agolib: prefix.c nano-optimisation
Paul Jakma [Sun, 24 Jan 2010 21:41:02 +0000 (21:41 +0000)]
lib: prefix.c nano-optimisation

* lib/prefix.c: (prefix_match) nano-optimisation, let it return early
  without copying pointers.

13 years agolib: Make workqueue more conservative about ramping up
Paul Jakma [Mon, 11 Jan 2010 13:55:01 +0000 (13:55 +0000)]
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.

13 years agolib: Add a command to clear the thread CPU history data
Paul Jakma [Sat, 9 Jan 2010 16:15:00 +0000 (16:15 +0000)]
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

13 years agolib: Thread scheduler should be fair and not let events starve I/O and timers
Paul Jakma [Mon, 11 Jan 2010 16:33:07 +0000 (16:33 +0000)]
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

13 years agolib: thread history funcname shouldn't be constant, it's freed
Paul Jakma [Mon, 11 Jan 2010 16:30:45 +0000 (16:30 +0000)]
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).

13 years agobgpd: Simplify process queue init
Paul Jakma [Fri, 8 Jan 2010 14:05:32 +0000 (14:05 +0000)]
bgpd: Simplify process queue init

* bgp_route.c: (bgp_process_queue_init) rsclient wasn't getting all the
  same things initialised as the main queue. Simplify to make it more robust.

13 years agobgpd: fix community-list error message spelling
Denis Ovsienko [Wed, 8 Dec 2010 15:51:37 +0000 (18:51 +0300)]
bgpd: fix community-list error message spelling

* bgp_vty.c: (community_list_perror, show_ip_community_list_arg,
  show_ip_extcommunity_list_arg) fix spelling

13 years agoinfrastructure: Express preference for published git repos
Greg Troxel [Wed, 3 Nov 2010 11:37:23 +0000 (07:37 -0400)]
infrastructure: Express preference for published git repos

* HACKING: Express notion that a published git repository is
  preferred.  Fold request for commit message into patch section.
  Express desire for comments in code explaining correctness of
  post-commit state, and for commit message to explain correctness of
  the change.

13 years agoinfrastructure: Whitespace cleanup.
Greg Troxel [Wed, 3 Nov 2010 11:22:00 +0000 (07:22 -0400)]
infrastructure: Whitespace cleanup.

HACKING: Whitespace changes only.

13 years agoinfrastructure: Clarify commit message format.
Greg Troxel [Wed, 3 Nov 2010 11:20:38 +0000 (07:20 -0400)]
infrastructure: Clarify commit message format.

Note 54/72 line length rules, and that this is intended to play nice
with "git log --oneline".

13 years agoAdjust description of tomhenderson repo.
Greg Troxel [Wed, 3 Nov 2010 11:16:32 +0000 (07:16 -0400)]
Adjust description of tomhenderson repo.

Tom's repo is now a clone of the official repo and has an mttr branch
off of 0.99.17.

13 years agobgpd: fix printed value of last-update timestamp
Vladimir L Ivanov [Thu, 21 Oct 2010 10:59:54 +0000 (14:59 +0400)]
bgpd: fix printed value of last-update timestamp

* bgp_route.c: (route_vty_out_detail) calculate time value
    in a way, which works regardless of monotonic clock
    being used or not

13 years agozclient: fix router-id calculation for IPv6 (#595)
Dmitry Tejblum [Mon, 18 Oct 2010 15:05:39 +0000 (19:05 +0400)]
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

13 years agobgpd, lib: adopt afi_t and safi_t in several places
Michael Lambert [Thu, 22 Jul 2010 17:20:55 +0000 (13:20 -0400)]
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)

13 years agoAdd MTR repository.
Greg Troxel [Fri, 24 Sep 2010 13:22:37 +0000 (09:22 -0400)]
Add MTR repository.

13 years agolib/vty.c: add missing format string when printing out motd message
Nico Golde [Sun, 1 Aug 2010 13:24:35 +0000 (15:24 +0200)]
lib/vty.c: add missing format string when printing out motd message

Signed-off-by: G.Balaji <balajig81@gmail.com>
13 years agoDocument rules for zalloc and friends.
Greg Troxel [Fri, 17 Sep 2010 16:19:13 +0000 (12:19 -0400)]
Document rules for zalloc and friends.

lib/memory.c:z{a,c,re}alloc, zfree, zdup: add requires/effects
comments.

13 years agoAdd pointer to Balaji G. git.
Greg Troxel [Fri, 17 Sep 2010 15:02:45 +0000 (11:02 -0400)]
Add pointer to Balaji G. git.

Balaji has been accumulating patches from the mailing list and
pre-screening them and spiffing up commit messages.

13 years agoSet from even if binfo->extra is NULL.
Greg Troxel [Fri, 17 Sep 2010 14:47:49 +0000 (10:47 -0400)]
Set from even if binfo->extra is NULL.

bgpd/bgp_packet.c:bgp_update_packet(): When extracting the peer, don't
  fail to extract it because "binfo->extra" is NULL.  While one should
  certainly avoid dereferencing binfo->extra, that's not a good reason
  not to use binfo->peer.

Fixes https://bugzilla.quagga.net/show_bug.cgi?id=497.
Patch by Eric Sobocinksi.

13 years agoZebra zserv: bogus conditional
Stephen Hemminger [Wed, 18 Aug 2010 22:56:46 +0000 (15:56 -0700)]
Zebra zserv: bogus conditional

This looks like a bug in original code from misunderstanding
of C rules of evaluation.

13 years agorelease: 0.99.17
Denis Ovsienko [Thu, 19 Aug 2010 09:36:43 +0000 (13:36 +0400)]
release: 0.99.17

* configure.ac: bump up version number

13 years agobgpd: fix handling of AS path data
Chris Hall [Mon, 9 Aug 2010 18:31:37 +0000 (22:31 +0400)]
bgpd: fix handling of AS path data

* bgpd/bgp_aspath.c
  * assegments_parse(): add handling of AS4_PATH input, update bounds
    checks, add check for AS segment type
  * aspath_parse(): add handling of AS4_PATH input, expect
    assegments_parse() to do length checking
  * aspath_empty(): update for the new function prototype
* bgpd/bgp_aspath.h: ditto
* tests/aspath_test.c: ditto
* bgpd/bgp_attr.c
  * bgp_attr_aspath(): add handling of AS4_PATH input, update flags
    checks, change returned type
  * bgp_attr_as4_path(): discard, superseded by bgp_attr_aspath()
  * bgp_attr_parse(): update respectively

14 years agobgpd: tighten bounds checking in RR ORF msg reader
Chris Hall [Fri, 14 May 2010 12:38:39 +0000 (16:38 +0400)]
bgpd: tighten bounds checking in RR ORF msg reader

* bgp_packet.c: (bgp_route_refresh_receive) add validation of
  "Length" (RFC5292) field value, check input stream bounds
  each time bytes are pulled from it

14 years agozebra: fix infinite loop when deleting an interface
Roman Hoog Antink [Wed, 5 May 2010 14:00:50 +0000 (16:00 +0200)]
zebra: fix infinite loop when deleting an interface

When deleting a VLAN interface after flushing its
addresses, zebra uses 100% CPU time and freezes.

 * interface.c: The while loop in line 407 that
   should clean up connected routes never hits one
   of the 2 lines "last = node;" and thus loops
   forever.

Signed-off-by: Roman Hoog Antink <rha@open.ch>
14 years agoUpdate for git and emphasize asking for good reports.
Greg Troxel [Wed, 5 May 2010 11:51:26 +0000 (07:51 -0400)]
Update for git and emphasize asking for good reports.

14 years agobuild: ignore mkinstalldirs and texinfo.tex
David Lamparter [Wed, 16 Sep 2009 00:20:00 +0000 (02:20 +0200)]
build: ignore mkinstalldirs and texinfo.tex

these are autogenerated by autoreconf, drop them from git.

14 years agoisisd: change ISIS_METHOD to use C preprocessor
David Lamparter [Tue, 2 Feb 2010 20:49:35 +0000 (21:49 +0100)]
isisd: change ISIS_METHOD to use C preprocessor

this fixes warnings from vtysh extract.pl by making sure the isis method
files always 'work'. (previously, extract.pl would grab unselected isis
method sources and then complain about missing headers)

14 years agoospf6d: Fix crash when '[no] ipv6 ospf6 advertise prefix-list' is in startup-config
David Ward [Tue, 5 Jan 2010 02:45:39 +0000 (02:45 +0000)]
ospf6d: Fix crash when '[no] ipv6 ospf6 advertise prefix-list' is in startup-config

* ospf6_interface.c: When '[no] ipv6 ospf6 advertise prefix-list'
  appears in the startup configuration for ospf6d, a crash occurs,
  because ospf6d attempts to schedule LSAs when the 'oi->area'
  structure has not yet been initialized.

  Now, when the command above is issued (either in the startup
  configuration or at runtime), ospf6d will only schedule LSAs if
  the 'oi->area' structure has been initalized. A similar test is
  already used when handling the commands 'ipv6 ospf6 priority'
  and 'ipv6 ospf6 cost'.

14 years agobuild/extra: Enhance README.NetBSD make/gmake decision.
Greg Troxel [Tue, 20 Apr 2010 16:44:21 +0000 (12:44 -0400)]
build/extra: Enhance README.NetBSD make/gmake decision.

14 years agoospfd: Only refresh external default route once.
Joakim Tjernlund [Wed, 14 Apr 2010 14:01:25 +0000 (16:01 +0200)]
ospfd: Only refresh external default route once.

* ospf_zebra.c: (ospf_distribute_list_update_timer) forces a
  refresh of default route each time it finds a default prefix.
  This is suboptimal, just record that it needs to be done and
  do it once.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
14 years agoospfd: Make sure ospf_distribute_list_update_timer() eventually runs.
Joakim Tjernlund [Wed, 14 Apr 2010 09:05:28 +0000 (11:05 +0200)]
ospfd: Make sure ospf_distribute_list_update_timer() eventually runs.

* ospf_zebra.c: (ospf_distribute_list_update_timer)
   If there are updates to the distribute list every 5 second or less,
   ospf_distribute_list_update_timer() will never run as the timer gets
   rearmed for each update. This fixes it by never rearming an active
   distribute list timer.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
14 years agoospfd: Make sure all external routes are updated.
Joakim Tjernlund [Wed, 14 Apr 2010 09:05:27 +0000 (11:05 +0200)]
ospfd: Make sure all external routes are updated.

Roman Hoog Antink <rha@open.ch> reports:

When adding a connected route (using vtysh, without restart) to the
redistribution access list of ospfd, while static routes already exist,
the update timer ospf_distribute_list_update_timer() is being run for
static routes only. That way, the connected route never appears in the
OSPF database, until quagga is completely restarted.

The update timer for connected routes is cancelled in
ospfd/ospfd_zebra.c:ospf_distribute_list_update():976, were a new timer
is scheduled for static routes, caused by the loop in ospf_filter_update().

 * ospf_zebra.c: (ospf_distribute_list_update_timer) make it
   refresh all external routes. This fixes the problem
   reported by Roman.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
14 years agogit: add pointers to out-of-tree work
Greg Troxel [Sun, 18 Apr 2010 16:50:21 +0000 (12:50 -0400)]
git: add pointers to out-of-tree work

* (HACKING.pending): List known places where work on quagga that is
  not (yet) integrated into the main tree can be found.

14 years agogit: add (generated) m4 files to .gitignore
Greg Troxel [Wed, 14 Apr 2010 19:24:52 +0000 (15:24 -0400)]
git: add (generated) m4 files to .gitignore

14 years agodoc: fixed spelling in bgpd.texi
Ivan Moskalyov [Thu, 11 Mar 2010 14:14:35 +0000 (17:14 +0300)]
doc: fixed spelling in bgpd.texi

14 years agobuild: Add QuaggaId to README.NetBSD
Greg Troxel [Wed, 10 Mar 2010 19:03:54 +0000 (14:03 -0500)]
build: Add QuaggaId to README.NetBSD

14 years agorelease: 0.99.16
Denis Ovsienko [Tue, 9 Mar 2010 10:53:20 +0000 (13:53 +0300)]
release: 0.99.16

* configure.ac: bump up version number

14 years agolib: undo the last PIE commit
Stephen Hemminger [Wed, 27 Jan 2010 09:38:16 +0000 (12:38 +0300)]
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.

14 years agolib: fix PIE build flags
Mathias Krause [Wed, 20 Jan 2010 14:39:13 +0000 (17:39 +0300)]
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.

14 years agobgp: use monotonic clock for time of day
Stephen Hemminger [Fri, 15 Jan 2010 13:22:10 +0000 (16:22 +0300)]
bgp: use monotonic clock for time of day

BGP uses time() to get system time of day; but that value
fluctuates with time adjustments from NTP. This can cause premature
flapping of peer sessions and other failures.

Use the system monotonic clock supported by Quagga thread library
to avoid issue.

See: http://bugzilla.vyatta.com/show_bug.cgi?id=4467

* bgpd/bgp_fsm.c
  * bgp_uptime_reset(): dismiss function
* bgpd/bgpd.c
  * bgp_clock(): new function
* bgpd/bgp_damp.c
  * bgp_reuse_timer(): employ bgp_clock() instead of time(NULL)
  * bgp_damp_withdraw(): idem
  * bgp_damp_update(): idem
  * bgp_damp_scan(): idem
  * bgp_damp_info_vty(): idem
  * bgp_damp_reuse_time_vty(): idem
* bgpd/bgp_fsm.c
  * bgp_routeadv_timer(): idem
  * bgp_stop(): idem
  * bgp_establish(): idem
* bgpd/bgp_packet.c
  * bgp_update_receive(): idem
* bgpd/bgp_route.c
  * bgp_update_rsclient(): idem
  * bgp_update_main(): idem
  * bgp_static_update_rsclient(): idem
  * bgp_static_update_main(): idem
  * bgp_static_update_vpnv4(): idem
  * bgp_aggregate_route(): idem
  * bgp_aggregate_add(): idem
  * bgp_redistribute_add(): idem
* bgpd/bgp_snmp.c
  * bgpPeerTable(): idem
  * bgpTrapEstablished(): idem
  * bgpTrapBackwardTransition(): idem
* bgpd/bgpd.c
  * peer_create(): idem
  * peer_uptime(): idem
  * bgp_master_init(): idem

14 years agoospfd: Fix debug messages that were masked by DISCARD_LSA
Paul Jakma [Thu, 14 Jan 2010 13:26:12 +0000 (16:26 +0300)]
ospfd: Fix debug messages that were masked by DISCARD_LSA

* ospf_packet.c: (ospf_ls_upd) DISCARD_LSA continues, and so should be
after debug messages, not before them.

14 years agoospfd: remove unneeded memset from a very hot function
Paul Jakma [Thu, 14 Jan 2010 13:19:40 +0000 (16:19 +0300)]
ospfd: remove unneeded memset from a very hot function

* ospf_lsdb.c: (lsdb_prefix_set) memset is unneeded, as all fields are
initialised explicitly, and this function can be in the top-3 of a
profile when there are a lot of LSAs.

14 years agolib: fix memory logging
David Ward [Wed, 13 Jan 2010 17:10:56 +0000 (20:10 +0300)]
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).

14 years agozebra: change router-id selection algo
Stephen Hemminger [Mon, 21 Dec 2009 15:50:43 +0000 (18:50 +0300)]
zebra: change router-id selection algo

The router-id table looks like is supposed to be sorted in current
quagga code, but the nodes are not added with the sorting
function.

The sorting function is host byte order dependent.
The values need to converted before comparison.

Fixing this causes Zebra to choose the largest IP address
as router-id, rather than the last address. This probably will
surprise some users. The other option would be to just remove the
comparison function and keep the existing LIFO behavior.

Lastly, simple subtraction works well for comparing.

* zebra/router-id.c
  * router_id_add_address(): employ listnode_add_sort()
  * router_id_cmp(): employ ntohl(), then compare integers

14 years agolib: make some structures constant
Stephen Hemminger [Mon, 21 Dec 2009 09:54:58 +0000 (12:54 +0300)]
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

14 years agobgpd: code cleanup
Stephen Hemminger [Thu, 17 Dec 2009 10:14:28 +0000 (13:14 +0300)]
bgpd: code cleanup

* bgpd/bgp_aspath.c
  * ashash: only used in one file, make static
  * aspath_count_numas(): dead code, sayonara
* bgpd/bgpd.c
  * peer_nsf_stop(): only used in one file, make static
* bgpd/bgp_packet.h
  * bgp_capability_receive(): add missing prototype for a
    global function

14 years agoripd: fix compiler warnings
Stephen Hemminger [Thu, 10 Dec 2009 16:16:05 +0000 (19:16 +0300)]
ripd: fix compiler warnings

* ripd/rip_interface.c
  * rip_request_neighbor(): comment out, unused
  * rip_request_neighbor_all(): idem
  * rip_interface_up(): Cast flags otherwise compiler complains
    about %lld not matching uint64_t on 64 bit x86. Print in hex
    since flags are bit field.
  * rip_interface_add(): idem
  * rip_interface_delete(): idem
* ripd/rip_zebra.c
  * rip_redistribute_set(): comment out, unused
* ripd/ripd.h
  * rip_redistribute_check(): move prototype here so compiler
    can check function against prototype
* ripd/ripd.c
  * rip_update_default_metric(): comment out, unused

14 years agoospf6d: remove dead code
Stephen Hemminger [Thu, 10 Dec 2009 13:18:41 +0000 (16:18 +0300)]
ospf6d: remove dead code

* ospf6d/ospf6_interface.c
  * loopind(): sayonara
* ospf6d/ospf6_top.c
  * ospf6_delete(): comment out, it might be useful if real shutdown is
    added

14 years agoospf6d: fix warnings from recent prefix bit commit
Stephen Hemminger [Thu, 10 Dec 2009 13:13:09 +0000 (16:13 +0300)]
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

14 years agoripngd: compiler warnings cleanup
Stephen Hemminger [Thu, 10 Dec 2009 12:52:33 +0000 (15:52 +0300)]
ripngd: compiler warnings cleanup

* ripngd/ripng_interface.c
  * ripng_check_max_mtu(): unused, sayonara
  * ripng_interface_down(): cast flag arguments to logging function
  * ripng_interface_add(): idem
  * ripng_interface_delete(): idem
* ripngd/ripngd.c
  * ripng_recv_packet(): avoid aliasing warning dereferencing pointer

14 years agozebra: deal with irdp compile warnings
Stephen Hemminger [Thu, 10 Dec 2009 11:22:44 +0000 (14:22 +0300)]
zebra: deal with irdp compile warnings

* zebra/irdp.h
  * irdp_send_thread(): move prototype to common header file
  * irdp_advert_off(): idem
  * process_solicit(): idem
  * irdp_read_raw(): idem
  * send_packet(): idem
* zebra/irdp_interface.c
  * inet_2a(): move function to where it is used
  * in_cksum(): lib/checksum.h already provides prototype
  * irdp_send_thread(): prototype moved away
  * inet_2a(): idem
  * irdp_advert_off(): idem
  * b1, b2, b3, b4: get rid of global buffers for inet_2a()
  * if_group(): add local buffer for inet_2a()
  * if_add_group(): idem
  * if_drop_group(): idem
  * irdp_config_write(): idem
  * Adv_new(): make static
* zebra/irdp_main.c
  * irdp_read_raw(): prototype moved away
  * send_packet(): idem
  * in_cksum(): lib/checksum.h already provides prototype
  * inet_2a(): function moved to irdp_interface.c
* zebra/irdp_packet.c
  * b1, b2, b3, b4: get rid of global buffers for inet_2a()
  * in_cksum(): lib/checksum.h already provides prototype
  * process_solicit(): prototype moved away
  * irdp_read_raw(): fix uninitialized variable

14 years agobgpd: compile warnings cleanup
Stephen Hemminger [Thu, 10 Dec 2009 08:57:05 +0000 (11:57 +0300)]
bgpd: compile warnings cleanup

* bgpd/bgp_fsm.c
  * bgp_clearing_completed(): only used in one file, can be static
* bgpd/bgp_packet.c
  * afi2str(): sayonara
  * safi2str(): sayonara
* bgpd/bgp_route.c
  * bgp_distance_reset(): sayonara
* bgpd/bgp_zebra.c
  * bgp_ifindex_by_nexthop(): sayonara

14 years agozebra: cleanup RIB meta queue code
Stephen Hemminger [Wed, 9 Dec 2009 14:54:49 +0000 (17:54 +0300)]
zebra: cleanup RIB meta queue code

* zebra/zebra_rib.c
  * rib_queue_add(): indent comments and simplify debug code
  * rib_queue_init(): remove unneeded assert() calls and
    extra return statements

14 years agolib: move check_bit into prefix common code
Stephen Hemminger [Wed, 9 Dec 2009 11:43:17 +0000 (14:43 +0300)]
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()

14 years agolib: fix warning on little endian
Stephen Hemminger [Wed, 9 Dec 2009 11:13:27 +0000 (14:13 +0300)]
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.