]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
15 years agoospfd: Discriminate better when selecting links between vertices in SPF
Joakim Tjernlund [Mon, 27 Jul 2009 10:42:31 +0000 (12:42 +0200)]
ospfd: Discriminate better when selecting links between vertices in SPF

* ospf_spf.c: (ospf_get_next_link) One must check the vertex type, Router or
  Network, to select type link to match against.  Link type 1 has neighbour
  router ID in link_id and link type 2 has IP address of DR.  Since router
  id may have same value as an existing IP address one risks matching a
  router ID against a DR.

15 years ago[bgpd] delete erroneous extra brace..
Paul Jakma [Thu, 30 Jul 2009 14:55:24 +0000 (15:55 +0100)]
[bgpd] delete erroneous extra brace..

15 years agobgpd: Workaround for invalid MBGP next hop
Michael Lambert [Tue, 28 Jul 2009 15:26:14 +0000 (11:26 -0400)]
bgpd: Workaround for invalid MBGP next hop

* bgp_attr.c: (bgp_mp_reach_parse) There are some interoperability issues
  for MBGP (particularly IPv4 multicast NLRI) between different
  implementations.  In order to get some next hops to install correctly in
  the BGP tables, it appears to be necessary to copy the multiprotocol next
  hop into the base next hop field.  This is related to differences in RFC
  2283 and RFC 2858.

15 years ago[doc] Update HACKING
Paul Jakma [Tue, 28 Jul 2009 15:04:35 +0000 (16:04 +0100)]
[doc] Update HACKING

* HACKING: Update to reflect git stripping []'s, and to allow for more
  discretion to avoid redundancy in commit messages.

15 years agoospfd: Make ospf_if_lookup_recv_if() find the right unnumbered i/f
Joakim Tjernlund [Mon, 27 Jul 2009 10:42:30 +0000 (12:42 +0200)]
ospfd: Make ospf_if_lookup_recv_if() find the right unnumbered i/f

This function will return the interface for the first matching
remote address for PtP i/f's. That won't work for multiple
unnumbered i/f's as these may all have the same address.

Pass in the struct interface pointer, ifp, to find the
correct set of oi's to search in. This also reduces the
size of the search list, making it faster.

* ospfd/ospf_interface.c: Add struct interface * param to
  ospf_if_lookup_recv_if() to select the right list to search in.
* ospfd/ospf_interface.h: ditto.
* ospfd/ospf_packet.c: Pass new ifp argument to ospf_if_lookup_recv_if()

15 years agoospfd: export ospf_if_table_lookup() and use it in ospf_network_run_interface()
Joakim Tjernlund [Mon, 27 Jul 2009 10:42:29 +0000 (12:42 +0200)]
ospfd: export ospf_if_table_lookup() and use it in ospf_network_run_interface()

Makes it possible to run OSPF on multiple PtP interfaces
with the same remote address.

* ospfd/ospf_interface.c: Export ospf_if_table_lookup().
* ospfd/ospf_interface.h: ditto.
* ospfd/ospfd.c: (ospf_network_run_interface) Use ospf_if_table_lookup() to
  determine whether OSPF is already configured for a subnet and interface.

15 years agobgpd/trivial: Fix indentation in previous
Paul Jakma [Tue, 28 Jul 2009 17:10:55 +0000 (18:10 +0100)]
bgpd/trivial: Fix indentation in previous

15 years agobgpd: Allow inbound connections to non-default view
Steve Hill [Tue, 28 Jul 2009 16:54:35 +0000 (17:54 +0100)]
bgpd: Allow inbound connections to non-default view

* bgpd.c: (peer_lookup) Search through all BGP instances for matches, not just
  the default instance, if no specific instance is given.
  (peer_lookup_with_open) same.

15 years agobgpd: fd leak in bgpd
Steve Hill [Tue, 28 Jul 2009 16:50:00 +0000 (17:50 +0100)]
bgpd: fd leak in bgpd

* bgp_fsm.c: I have found an fd leak in bgpd that is caused by the 'new'
  Clearing state.  I've been seeing it from hold timer failures, but it can
  also be triggered by other things.

  When Hold_Timer_expired fires in Established state, a notify is sent and
  BGP_Stop event queued.  The fsm then transitions into Clearing state.
  That is the problem; When the BGP_Stop event is serviced, the state table
  says to ignore it while in Clearing.  Thus bgp_stop is not called and the
  fd leaks.  Previously the peer would be in Idle state, which correctly
  handles the BGP_Stop event.

  Fix by making bgp_stop safe to call from Clearing state, without losing
  ClearingCompleted events, and then ensuring it is called prior to
  transition from Clearing->Idle.

15 years ago[zebra] Fix crash in test_zebra
Paul Jakma [Sat, 19 Apr 2008 23:31:57 +0000 (00:31 +0100)]
[zebra] Fix crash in test_zebra

* kernel_null.c: we're pretending to add an address, so
  set IFC_REAL. If this isn't done, calling into the 'got address
  from kernel' half of zebra will implicitly-withdraw the ifc, which
  could cause a crash in test_zebra.c.

15 years agoMerge remote branch 'origin/master'
Paul Jakma [Tue, 28 Jul 2009 15:06:45 +0000 (16:06 +0100)]
Merge remote branch 'origin/master'

15 years agobgpd: Delete AS_CONFED_SEQUENCE when prepending an AS_SEQUENCE type segment
Vasilis Tsiligiannis [Sun, 19 Jul 2009 22:59:10 +0000 (01:59 +0300)]
bgpd: Delete AS_CONFED_SEQUENCE when prepending an AS_SEQUENCE type segment

AS_CONFED_SEQUENCE segment should always be deleted when prepending
(e.g. with a route-map) an AS_SEQUENCE segment to an AS path. Otherwise,
AS_CONFED_SEQUENCE will not be deleted later when updating EBGP peers (since
it is not the leftmost segment) and will leak outside the confederation.

15 years agobgpd: Implement BGP confederation error handling (RFC5065, Par. 5)
Vasilis Tsiligiannis [Sun, 19 Jul 2009 22:28:35 +0000 (01:28 +0300)]
bgpd: Implement BGP confederation error handling (RFC5065, Par. 5)

This patch implements BGP confederation error handling in Quagga as described
in RFC5065, paragraph 5.

* bgp_aspath.c: (aspath_confed_check, aspath_left_confed_check) new functions
* bgp_attr.c: (bgp_attr_aspath_check) apply previous and NOTIFY if there's
  a problem.

15 years ago[global] interface flags format warnings
Stephen Hemminger [Tue, 28 Jul 2009 10:58:51 +0000 (11:58 +0100)]
[global] interface flags format warnings

*/*: ifp->flags is 64 bit unsigned which can not be handled by %l on 32
     bit architectures - requires %ll and the appropriate cast.

15 years agobgpd: start listener on first instance
Stephen Hemminger [Tue, 21 Jul 2009 23:27:21 +0000 (16:27 -0700)]
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

15 years agobgpd: peer action table static/const
Stephen Hemminger [Tue, 21 Jul 2009 23:27:20 +0000 (16:27 -0700)]
bgpd: peer action table static/const

bgpd.c: (various tables) only used in one place and are immutable.

15 years agoripd: set IP TOS for control socket
Stephen Hemminger [Tue, 21 Jul 2009 23:27:26 +0000 (16:27 -0700)]
ripd: set IP TOS for control socket

* ripd.c: (rip_create_socket) RIP packets should go out with Type Of Service
  (DSCP) set to Internet control (like OSPF and BGP).

15 years ago[bgpd] Restore ability of 'neighbor ... update-source' to take interface name
Paul Jakma [Mon, 27 Jul 2009 11:27:55 +0000 (12:27 +0100)]
[bgpd] Restore ability of 'neighbor ... update-source' to take interface name

* bgp_vty.c: (BGP_UPDATE_SOURCE_STR) Restore ability to accept arbitrary
  interface names for the 'neighbor ... update-source' command - shouldn't
  have been deleted.
  (BGP_UPDATE_SOURCE_STR) Add help for same.

15 years ago[zebra] do not touch socket before pidfile locking
Denis Ovsienko [Fri, 24 Jul 2009 16:45:31 +0000 (20:45 +0400)]
[zebra] do not touch socket before pidfile locking

Move zserv socket creation code into zebra_zserv_socket_init() and
call it only after pidfile lock has been acquired exclusively. This
keeps subsequent zebra daemons from deleting the working socket of
an already running process (bug #403).

15 years ago[doc] zebra.8 via Christian Hammers (#531)
Thijs Kinkhorst [Tue, 21 Jul 2009 15:24:29 +0000 (19:24 +0400)]
[doc] zebra.8 via Christian Hammers (#531)

The man page for zebra(8) mentions as port number to connect to 2602,
but it's acutally 2601 (as shown in /etc/services). 2602 belongs to ripd.
Attached patch fixes this typo.

15 years ago[build] Bump release to 0.99.14
Paul Jakma [Tue, 21 Jul 2009 14:21:20 +0000 (15:21 +0100)]
[build] Bump release to 0.99.14

15 years ago[bgp] Fix nexthop reachability check on confederations
Vasilis Tsiligiannis [Sun, 19 Jul 2009 22:25:16 +0000 (01:25 +0300)]
[bgp] Fix nexthop reachability check on confederations

* bgp_route.c: (bgp_update_main) Nexthop reachability should be checked for
  confederations too in case a prefix is received from more than one
  confederation peers.

15 years ago[bgpd] fix typo made by paul in previous commit
Paul Jakma [Tue, 21 Jul 2009 13:02:04 +0000 (14:02 +0100)]
[bgpd] fix typo made by paul in previous commit

15 years ago[bgpd] Avoid zombie accepted peer entries
Timo Teräs [Tue, 17 Feb 2009 10:14:23 +0000 (12:14 +0200)]
[bgpd] Avoid zombie accepted peer entries

Currently, when accepting the connection, it can be left as zombie, when the
peer just initiates a connection, but never sends data (and the TCP
connection end packets are lost).  This happens because for accepted
connections a temporary new peer entry is created until OPEN message is
exchanged, and this temporary peer entry does not get the hold time
parameter set at all.

* bgp_network.c: (bgp_accept) Set hold time and keepalive values for ACCEPT
  peers.

15 years ago[bgpd] Small buffer overrun in bgp_clear_node_queue_init
Nick Hilliard [Tue, 17 Mar 2009 22:14:25 +0000 (22:14 +0000)]
[bgpd] Small buffer overrun in bgp_clear_node_queue_init

* bgp_route.c: (bgp_clear_node_queue_init) fix buffer
  overrun.

15 years ago[zebra] Silence noisy process_subq
Chris Caputo [Sat, 18 Jul 2009 04:02:26 +0000 (04:02 +0000)]
[zebra] Silence noisy process_subq

zebra_rib.c: process_subq(): #ifdef out debug code.

15 years ago[bgpd] Stability fixes including bugs 397, 492
Chris Caputo [Sat, 18 Jul 2009 05:44:03 +0000 (05:44 +0000)]
[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().

15 years ago[bgpd] Fix compiler warnings related to MD5
Chris Caputo [Sat, 18 Jul 2009 05:42:34 +0000 (05:42 +0000)]
[bgpd] Fix compiler warnings related to MD5

This patch fixes:

bgp_network.c: In function 'bgp_md5_set':
bgp_network.c:107: warning: cast from pointer to integer of different size
bgp_network.c: In function 'bgp_socket':
bgp_network.c:447: warning: cast to pointer from integer of different size

15 years ago[build] fix default CFLAGS and squish warning
Paul Jakma [Sun, 19 Jul 2009 16:33:21 +0000 (17:33 +0100)]
[build] fix default CFLAGS and squish warning

* configure.ac: Move down the AC_SYS_LARGEFILE test - it was setting CFLAGS
  and so disabling the default CFLAGS setting section.
  Squish warning by adding AC_CONFIG_MACRO_DIR on the reccommendation of
  autoreconf.

15 years ago[bgpd] Bug #533: Fix crash with copy/pasted commands, inc 'no bgp ...'
Paul Jakma [Thu, 16 Jul 2009 18:27:32 +0000 (19:27 +0100)]
[bgpd] Bug #533: Fix crash with copy/pasted commands, inc 'no bgp ...'

* bgpd.c: Removal of (struct bgp *) from the master list was being left to
  bgp_free time.  This meant there was a window of time between bgp_delete
  and refcounts hitting 0 (e.g.  routes to be processed) where bgp_lookup's
  could return a deleted (struct bgp *).

  (bgp_delete) This is the logical place where a (struct bgp *) should lose
  its visibility, so move the deletion from the bgp-master list to here,
  from bgp_free.

  Many thanks to Fritz Reichmann for his thorough debugging of the problem
  and testing of fixes and Chris Caputo for his further analysis.

15 years ago[lib] Fix IPv6 normalisation
Stephen Hemminger [Sun, 12 Jul 2009 04:27:51 +0000 (21:27 -0700)]
[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.

15 years ago[ospf6d] Fix regression in monotonic time patch - LSA max-aging broke
Tom Henderson [Thu, 16 Jul 2009 16:20:37 +0000 (17:20 +0100)]
[ospf6d] Fix regression in monotonic time patch - LSA max-aging broke

* ospf6_lsa.c: (ospf6_lsa_premature_aging) set age to MAX_AGE - don't
  rely on 0 magically meaning same.
  (ospf6_lsa_age_current) handle MAXAGE.

15 years ago[lib/cleanup] Use a typedef for the thread type
Paul Jakma [Tue, 30 Jun 2009 15:12:49 +0000 (16:12 +0100)]
[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.

15 years ago[ospfd] Do not use stale Network/Router LSAs
Joakim Tjernlund [Mon, 5 Jan 2009 16:44:46 +0000 (17:44 +0100)]
[ospfd] Do not use stale Network/Router LSAs

Should a self originated Network/Router LSA with higher
LS seq. nr. be received we should flood and install it in
the LSDB but we cannot use it for our internal calculations
as it is stale.
Reorginate an new LSA to replace the stale one as soon
as possible.

15 years ago[bgpd] Log a debug/update warning if filters are configured but don't exist
Paul Jakma [Thu, 25 Jun 2009 17:06:31 +0000 (18:06 +0100)]
[bgpd] Log a debug/update warning if filters are configured but don't exist

* bgp_route.c: (bgp_{input,output}_filter) Log a debug warning if a route is
  received or sent and a filter name is configured for a prefix, as or
  distribute list but none is found - guaranteed configuration mistake.

15 years agoAdd test for Internet checksum.
Joakim Tjernlund [Mon, 1 Dec 2008 15:25:06 +0000 (16:25 +0100)]
Add test for Internet checksum.

Add 2 impl. of the Internet Checksum. One new optimized nad
one form RFC 1071. Turns out that the current Quagga in_cksum()
is buggy. On Big Endian routers it miscalculates odd sized buffers.

15 years ago[ospfd] compare ifIndex too when matching paths
Joakim Tjernlund [Sun, 1 Feb 2009 10:12:11 +0000 (11:12 +0100)]
[ospfd] compare ifIndex too when matching paths

ospf_path_lookup(), ospf_route_match_same() and
ospf_ase_route_match_same() needs to
compare if the interface matches too.

15 years ago[doc] Add "--disable-doc" to configure
Joakim Tjernlund [Mon, 16 Feb 2009 08:40:39 +0000 (09:40 +0100)]
[doc] Add "--disable-doc" to configure

Configure option "--disable-doc" will prevent building
the documents under doc. Saves build time and the need to
have document building tools installed. Useful when your build
machine is different from your development machine.

15 years ago[ospfd] external LSA route_unlock_node() fixes
Joakim Tjernlund [Wed, 4 Feb 2009 14:05:19 +0000 (15:05 +0100)]
[ospfd] external LSA route_unlock_node() fixes

A few route_unlock_node() calls was missing.

15 years ago[ospfd] Fix a few LSA performance "bugs"
Joakim Tjernlund [Tue, 4 Nov 2008 13:37:29 +0000 (13:37 +0000)]
[ospfd] Fix a few LSA performance "bugs"

ospf_lsa_install() will calculate LSA checksum so no
need to do it before calling ospf_lsa_install().

Set the OSPF_LSA_SELF_CHECKED flag on own LSA's to
save ospf_lsa_is_self_originated() some work.

Do not memset() memory that is about to overwritten
with memcpy().

15 years agoMerge remote branch 'origin/master'
Paul Jakma [Wed, 24 Jun 2009 21:52:43 +0000 (22:52 +0100)]
Merge remote branch 'origin/master'

15 years agozebra: Static route does not reach kernel.
Joakim Tjernlund [Wed, 24 Jun 2009 17:15:36 +0000 (19:15 +0200)]
zebra: Static route does not reach kernel.

A static route like below: ip route 172.16.1.0/30 192.168.101.162 11
does not move properly to a new interface when the
interface used goes down. Zebra reports that it have
moved but kernel isn't informed so the route is lost.

* zebra_rib.c: (nexthop_active_update) if ifindex has changed, then the
  route should be considered to have changed.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
15 years ago[vtysh] Save vtysh history to a file
Tomasz Pala [Wed, 24 Jun 2009 21:23:11 +0000 (22:23 +0100)]
[vtysh] Save vtysh history to a file

vtsh_main.c: save 1000 last lines of history to $HOME/.history_quagga (the
file must be created by hand first, this is intended behaviour)

15 years ago[configure] Allow for large-file support, e.g. for log files >2GB
Tomasz Pala [Wed, 24 Jun 2009 21:09:46 +0000 (22:09 +0100)]
[configure] Allow for large-file support, e.g. for log files >2GB

15 years ago[cleanup] Add log.h includes
Tomasz Pala [Wed, 24 Jun 2009 20:48:22 +0000 (21:48 +0100)]
[cleanup] Add log.h includes

15 years ago[bgpd] Add 'show ip bgp view WORD neighbors IP (advertised|received)-routes'
Tomasz Pala [Wed, 24 Jun 2009 20:36:50 +0000 (21:36 +0100)]
[bgpd] Add 'show ip bgp view WORD neighbors IP (advertised|received)-routes'

* bgp_route.c: Was missing these commands.

15 years ago[ospfd] discount IP header size from a new LSA pkt
Dmitry Tejblum [Wed, 24 Jun 2009 16:14:30 +0000 (20:14 +0400)]
[ospfd] discount IP header size from a new LSA pkt

15 years ago[bgpd] review 32-bit AS-path hotfix for 0.99.12
Denis Ovsienko [Tue, 23 Jun 2009 17:10:45 +0000 (21:10 +0400)]
[bgpd] review 32-bit AS-path hotfix for 0.99.12

The patch by Chris Caputo, which was used to prepare 0.99.12
release, consists of three parts:

1. memory allocation fix itself
2. fix for warnings about constant variables
3. fix for printf format specs (%d was used instead of %u)

It was confirmed later, that:
a. a much simpler bugfix was available for memory allocation
b. committed version of the bugfix wasn't optimal CPU-wise

At this point I consider reasonable to revert the allocation
portion of that patch and to replace it with the shorter
version, which is:

-#define ASN_STR_LEN (5 + 1)
+#define ASN_STR_LEN (10 + 1)

Other two parts of Mr. Caputo's patch remain intact.

15 years ago[zebra] linux policy routing support with ipv6
Mathieu Goessens [Tue, 23 Jun 2009 14:59:45 +0000 (15:59 +0100)]
[zebra] linux policy routing support with ipv6

Quagga support linux policy routing (ip route ... table $X) with zebra.conf
table $X option.  It works fine on ipv4.  On ipv6 the parameter is ignored
(table 0 is used).

* zebra/...: Pass appropriate table arg to rib_{add,delete}_ipv6

15 years agoMerge remote branch 'origin/master'
Paul Jakma [Tue, 23 Jun 2009 13:30:52 +0000 (14:30 +0100)]
Merge remote branch 'origin/master'

15 years ago[trivia] work around ksh93 builtin name (#451)
Jingjing Duan [Tue, 23 Jun 2009 13:28:23 +0000 (17:28 +0400)]
[trivia] work around ksh93 builtin name (#451)

ksh93 script cannot have 'stop' functions w/o cancelling
existing definition first. Fixed.

15 years agoFix "show ip bgp dampened-paths" garbage output.
Chris Caputo [Tue, 23 Jun 2009 06:06:49 +0000 (06:06 +0000)]
Fix "show ip bgp dampened-paths" garbage output.

* bgpd/bgp_damp.c: Make bgp_damp_reuse_time_vty() accept a buffer and
  length, rather than returning a local var buffer whose contents can get
  trounced.  Remove duplicate BGP_UPTIME_LEN define.
* bgpd/bgp_damp.h: bgp_damp_reuse_time_vty() prototype change.
* bgpd/bgp_route.c: Provide bgp_damp_reuse_time_vty() with a buffer and
  length.  Remove duplicate BGP_UPTIME_LEN define.

This problem was noticed in 2005...

  http://hibernia.jakma.org/~paul/patches/quagga-test.diff

...but the fix didn't make it into the code.

Signed-off-by: Chris Caputo <ccaputo@alt.net>
15 years agoFix vtysh based "write term" output.
Chris Caputo [Tue, 23 Jun 2009 05:55:57 +0000 (05:55 +0000)]
Fix vtysh based "write term" output.

* vtysh/vtysh.c: "end" should be printed at the bottom, not the top.
* vtysh/vtysh_config.c: PROTOCOL_NODE was not being handled, and thus was
  being displayed at the top of a config, rather than in its rightful
  place near the bottom.

Signed-off-by: Chris Caputo <ccaputo@alt.net>
15 years agoFixes to RFC2385/MD5 BGP
Chris Caputo [Tue, 23 Jun 2009 05:34:29 +0000 (05:34 +0000)]
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.

15 years ago[ospfd] cancel OSPF timer hack in nsm_change_state
Dmitry Tejblum [Tue, 23 Jun 2009 13:16:32 +0000 (17:16 +0400)]
[ospfd] cancel OSPF timer hack in nsm_change_state

This piece of code causes all Quagga routers on a broadcast link to
send a HELLO packet simultaneously if they see a new neighbor. It also
resets the HELLO timer, so all the quagga routers will continue to
send HELLO packets simultaneously in the future. This is not good
(especially on networks with a lot of Quagga routers connected), and
is explicitly discouraged by the OSPF standard, RFC 2328 (chapter
4.4.Timers).

I suggest to remove the code snippet, it does not provide much benefit
anyway.

15 years agoRFC 4191 Default Router Preference support for router advertisements
Chris Caputo [Sun, 3 May 2009 04:40:57 +0000 (04:40 +0000)]
RFC 4191 Default Router Preference support for router advertisements

Adds "ipv6 nd router-preference (high|medium|low)" and
"no ipv6 nd router-preference" interface commands.

Files modified:

   doc/ipv6.texi
   zebra/interface.c
   zebra/interface.h
   zebra/rtadv.c
   zebra/rtadv.h

Signed-off-by: Chris Caputo <ccaputo@alt.net>
15 years ago[doc] remove -dither arg to imagemagick, in building PDFs
Paul Jakma [Mon, 22 Jun 2009 15:11:06 +0000 (16:11 +0100)]
[doc] remove -dither arg to imagemagick, in building PDFs

* doc/Makefile.am: arguments for the 'convert' programme seem to have
  changed incompatibly at some stage - just remove the problematic -dither.

15 years agoConvert ospf6d over to quagga_gettime() wrappers.
Takashi Sogabe [Mon, 22 Jun 2009 04:07:02 +0000 (13:07 +0900)]
Convert ospf6d over to quagga_gettime() wrappers.

15 years ago[bgpd] Fix 'update-source' command: It doesn't accept interface names
Paul Jakma [Mon, 22 Jun 2009 10:30:47 +0000 (11:30 +0100)]
[bgpd] Fix 'update-source' command: It doesn't accept interface names

* bgp_vty.c: BGP_UPDATE_SOURCE_STR define should only specify IP addresses,
  the underlying mechanisms won't do anything useful with interface names.
  Fix bug #527.

15 years ago[ospfd/BSD] add missing UINT16_MAX - picked up from FreeBSD ports patch
Jeremy Jackson [Fri, 23 Jan 2009 20:48:10 +0000 (15:48 -0500)]
[ospfd/BSD] add missing UINT16_MAX - picked up from FreeBSD ports patch

Should probably have AC_TYPE_UINT16_T in configure.ac to make it really
clean...  and a fresh import of gnulib, the existing copy of gnulib seems to
be manually put some stuff in zebra.h.  I'm leaving that alone for now,
since a fresh import will probably clean up a lot of cruft and it would be a
duplicated effort to fix some things now.

The FreeBSD port 0.99.11_1 files/patch-ospfd-ospfd.h can probably go away
after this is applied.

15 years ago[configure] fix check for GNU awk/gawk to abort ./configure if missing
Jeremy Jackson [Thu, 22 Jan 2009 03:10:40 +0000 (22:10 -0500)]
[configure] fix check for GNU awk/gawk to abort ./configure if missing

It also prints what were comments explaining why gawk is necessary, and
not-in-PATH to help user figure out why it's not found.

Build was mysteriously failing with the old version of this check when gawk
wasn't installed.

15 years ago[cleanup] convert bzero() deprecated by POSIX to memset()
Jeremy Jackson [Thu, 22 Jan 2009 01:51:57 +0000 (20:51 -0500)]
[cleanup] convert bzero() deprecated by POSIX to memset()

autoscan 2.62 complains about bzero(), so a good fix
nowadays is to just replace it.

15 years ago[configure] remove unused/broken autoconf cache variable ac_statedir
Jeremy Jackson [Thu, 22 Jan 2009 01:29:39 +0000 (20:29 -0500)]
[configure] remove unused/broken autoconf cache variable ac_statedir

It wasn't used, and the code wasn't printing progress or the result in some
cases.  the test uses minimal resources, so it's probably better to not
cache so as to avoid inconsistencies if --with-prefix or directory variables
are changed between ./configure runs.

15 years ago[configure/cleanup] fix broken autoconf cache variables
Jeremy Jackson [Wed, 21 Jan 2009 23:27:37 +0000 (18:27 -0500)]
[configure/cleanup] fix broken autoconf cache variables

Fix zebra_rtread and zebra_ipforward_path.

It looks like someone tried to make this cached, but it was being ignored at
least on autoconf 2.6.1.  2.6.2 now gives a warning about the situation,
hence this fix.

Although they are just warnings, it's dangerous to leave them as-is, because
someone not diligent in reading the autoconf manual might just stick _cv_ in
the name, with the effect that running a ./configure --config-cache would
fail horribly, since variables are being set inside the AC_CACHE_CHECK()
block that would not be seen when the variable's value was read from cache.

Also added m4 quotes [] to macro arguments as autoconf manual
suggests.

15 years ago[configure] remote support for AIX, it conflicts on newer autoconf
Jeremy Jackson [Wed, 21 Jan 2009 21:35:51 +0000 (16:35 -0500)]
[configure] remote support for AIX, it conflicts on newer autoconf

AC_AIX and AC_GNU_SOURCE conflict > autoconf 2.53 or so,
but the replacement AC_USE_SYSTEM_EXTENSIONS isn't available
until later versions.  So either we narrow the supported
autconf version range, or disable AIX (if it has any effect),
or determin that AC_AIX doesn't do anything useful anyhow.

15 years ago[build] cleanup low-hanging autoreconf warnings
Jeremy Jackson [Wed, 21 Jan 2009 19:15:44 +0000 (14:15 -0500)]
[build] cleanup low-hanging autoreconf warnings

Some uses of GNU make extensions were not necessary.  There are still some,
but they might exist as workarounds for older versions of autoconf that have
since been solved.

Lesson learned: implicit target rules have opposite order to pattern target
rules.

15 years ago[configure] add configure support for PCRE Posix library
Jeremy Jackson [Mon, 12 Jan 2009 21:06:12 +0000 (16:06 -0500)]
[configure] add configure support for PCRE Posix library

Debian tried unsuccessfully to build with libpcreposix.  This adds proper
support to autoconf/configure.ac for it.

Based on the patch by C.J.  Adams-Collier in bug #483.

bgpd/bgp_{regex,routemap}.h: Pull in PCRE POSIX header if available.

15 years ago[daemons/cleanup] Remove disabled log_mode argument support.
Jeremy Jackson [Sun, 28 Dec 2008 17:57:42 +0000 (12:57 -0500)]
[daemons/cleanup] Remove disabled log_mode argument support.

* */*main.c: Seems that the actual code was removed previously, but the
  argument processing code remained.

15 years ago[doc] Removes documentation of nonexistant option.
Jeremy Jackson [Sun, 28 Dec 2008 17:40:06 +0000 (12:40 -0500)]
[doc] Removes documentation of nonexistant option.

Expansion of Ubuntu quagga-0.99.11-1 30_doc__ospfd.8__nolog.dpatch

15 years ago[configure] Refine CLOCK_MONOTONIC test
Paul Jakma [Thu, 18 Jun 2009 16:38:01 +0000 (17:38 +0100)]
[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

15 years ago[configure] Detect support for monotonic clock
Stephen Hemminger [Thu, 28 May 2009 22:29:10 +0000 (15:29 -0700)]
[configure] Detect support for monotonic clock

Quagga has code to support monotonic clock to avoid issues where
time of day changes. The support was incomplete since it was not being
detected by autoconf.

15 years ago[BGP/cleanup] make message list in bgp_open const
Stephen Hemminger [Fri, 15 May 2009 17:16:34 +0000 (10:16 -0700)]
[BGP/cleanup] make message list in bgp_open const

15 years ago[BGP/cleanup] make community hash table static
Stephen Hemminger [Fri, 15 May 2009 17:17:09 +0000 (10:17 -0700)]
[BGP/cleanup] make community hash table static

15 years ago[BGP/cleanup] make some damp function static
Stephen Hemminger [Fri, 15 May 2009 17:19:31 +0000 (10:19 -0700)]
[BGP/cleanup] make some damp function static

15 years ago[BGP/cleanup] make ecommunity variables/functions local
Stephen Hemminger [Fri, 15 May 2009 17:28:11 +0000 (10:28 -0700)]
[BGP/cleanup] make ecommunity variables/functions local

15 years ago[BGP/cleanup] main program cleanup
Stephen Hemminger [Fri, 15 May 2009 17:29:41 +0000 (10:29 -0700)]
[BGP/cleanup] main program cleanup

Check result of daemon() call to fix warning
Make local variables static

15 years ago[zebra/cleanup] make message table read only
Stephen Hemminger [Fri, 15 May 2009 17:47:04 +0000 (10:47 -0700)]
[zebra/cleanup] make message table read only

15 years ago[OSPF/cleanup] make message lists read only
Stephen Hemminger [Fri, 15 May 2009 17:47:45 +0000 (10:47 -0700)]
[OSPF/cleanup] make message lists read only

15 years ago[bgpd/cleanup] make message lists read only
Stephen Hemminger [Fri, 15 May 2009 17:48:03 +0000 (10:48 -0700)]
[bgpd/cleanup] make message lists read only

15 years ago[bgpd] add comment that bgp_capability_receive is exported for unit-tests
Paul Jakma [Thu, 18 Jun 2009 11:34:43 +0000 (12:34 +0100)]
[bgpd] add comment that bgp_capability_receive is exported for unit-tests

15 years ago[cleanup] Allow message tables to be constant
Stephen Hemminger [Fri, 15 May 2009 16:47:34 +0000 (09:47 -0700)]
[cleanup] Allow message tables to be constant

Avoid bugs, and improve cache locality by allowing message lists
to be read/only.

15 years ago[cleanup] Fix compile warnings
Stephen Hemminger [Fri, 15 May 2009 16:48:55 +0000 (09:48 -0700)]
[cleanup] Fix compile warnings

Fix printf format warning and make capability table 'const static'

15 years ago[cleanup] Use const in smux interface
Stephen Hemminger [Fri, 15 May 2009 16:59:03 +0000 (09:59 -0700)]
[cleanup] Use const in smux interface

smux_trap and oid_copy should allow read-only source.

15 years ago[bgpd/cleanup] BGP make attribute variables local
Stephen Hemminger [Fri, 15 May 2009 16:59:51 +0000 (09:59 -0700)]
[bgpd/cleanup] BGP make attribute variables local

Message lists can be read-only, and hash tables are local to this
code.

15 years ago[bgpd/cleanup] Make BGP FSM table read-only static
Stephen Hemminger [Fri, 15 May 2009 17:02:27 +0000 (10:02 -0700)]
[bgpd/cleanup] Make BGP FSM table read-only static

The finite state machine table is immutable.

15 years ago[bgpd] reference count the BGP instance
Stephen Hemminger [Thu, 21 May 2009 15:51:03 +0000 (08:51 -0700)]
[bgpd] reference count the BGP instance

When a BGP instance is deleted with lots of routes and neighbors
it is possible for the peer rsclient queue to run after
bgp_delete has been called. This would lead to bgpd crashing,
see https://bugzilla.vyatta.com/show_bug.cgi?id=3436

The fix is to add reference counting to the BGP instance and defer
actual freeing until all references are gone.

This patch also fixes a memory leak where the self-reference
peer instance was being created but never freed.

The check in bgp_clear_route is no longer valid because it is possible
for it to be called when peer is in Deleted state during cleanup.

15 years ago[bgpd] Make declarations match
Stephen Hemminger [Fri, 8 May 2009 22:19:07 +0000 (15:19 -0700)]
[bgpd] Make declarations match

These variables are const.

15 years ago[zebra] Remove unused structure element
Stephen Hemminger [Thu, 30 Apr 2009 04:55:48 +0000 (21:55 -0700)]
[zebra] Remove unused structure element

15 years ago[zebra] Force rib_update when connected route deleted
Stephen Hemminger [Thu, 30 Apr 2009 04:54:59 +0000 (21:54 -0700)]
[zebra] Force rib_update when connected route deleted

15 years ago[cleanup] Use correct buffer size for inet_ntop()
Stephen Hemminger [Tue, 28 Apr 2009 21:28:00 +0000 (14:28 -0700)]
[cleanup] Use correct buffer size for inet_ntop()

Don't need big buffer 1024 to hold IPV4 (INET_ADDRSTRLEN)
or IPv6 (INET6_ADDRSTRLEN) message.

15 years ago[ripd] Ignore non-running interfaces in rip status
Stephen Hemminger [Tue, 7 Apr 2009 22:00:46 +0000 (15:00 -0700)]
[ripd] Ignore non-running interfaces in rip status

Vyatta Bug 3999

15 years ago[lib] Put symbolic backtrace on system log
Stephen Hemminger [Mon, 9 Mar 2009 23:09:50 +0000 (16:09 -0700)]
[lib] Put symbolic backtrace on system log

When BGP crashes, sometimes all we get to see is syslog.

15 years ago[lib] sockopt_tcp_signature: sin6 requires HAVE_IPV6
Stephen Hemminger [Fri, 20 Feb 2009 07:01:41 +0000 (23:01 -0800)]
[lib] sockopt_tcp_signature: sin6 requires HAVE_IPV6

An external user was building on system without IPv6 and
it wouldn't work.

15 years ago[ospf6d] Remove 'no router' from OSPF6_NODE
Stephen Hemminger [Thu, 12 Feb 2009 07:55:32 +0000 (23:55 -0800)]
[ospf6d] Remove 'no router' from OSPF6_NODE

Don't need command twice.

15 years ago[ospf6d] Fix ospf6d crash if removing interface with no area
Jon [Thu, 12 Feb 2009 01:30:44 +0000 (17:30 -0800)]
[ospf6d] Fix ospf6d crash if removing interface with no area

ospf6d will crash if attempting to remove interface when no areas have been
defined Check if any areas have been defined.  Should prevent use of empty
pointer.

15 years ago[ospf6d] Fix ospf6d crash in show border routers
Jon [Thu, 12 Feb 2009 01:27:06 +0000 (17:27 -0800)]
[ospf6d] Fix ospf6d crash in show border routers

ospf6d will crash if this command is executed on a non-border-router.
Included test to verify that any routes are defined, preventing empty
pointer from being used.

15 years ago[ospf6] Add no router ospf6
Jon [Thu, 12 Feb 2009 01:19:07 +0000 (17:19 -0800)]
[ospf6] Add no router ospf6

Suggestion: Makes no sense to me that the statement to remove ospf6
configuration is located in OSPF6D_NODE.
Moved to CONFIG_NODE next to matching define command.

15 years ago[ospf6d] Fix ospf6d crash if range defined twice
Jon [Thu, 12 Feb 2009 01:22:03 +0000 (17:22 -0800)]
[ospf6d] Fix ospf6d crash if range defined twice

ospf6d will crash if the same range is defined twice.
There was no check if the same range had previously been defined,
thereby causing a later assert to fail.

15 years ago[ospfd] Fix OSPF route refcount leak
Stephen Hemminger [Wed, 3 Jun 2009 23:44:21 +0000 (16:44 -0700)]
[ospfd] Fix OSPF route refcount leak

This may fix vyatta BUG 3096. The reference count for OSPF route table was
never completely freed on deleting all neighbors.

15 years ago[zebra] Only announce connected routes if link is detected
Stephen Hemminger [Sat, 5 Jul 2008 23:32:37 +0000 (16:32 -0700)]
[zebra] Only announce connected routes if link is detected

Need to check both IFF_UP and IFF_RUNNING if link-detect is enabled,
before announcing routes.