]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
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 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)

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

14 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>
14 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.

14 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.

14 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.

14 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.

14 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

14 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.

14 years agozebra: fix more warnings in rtadv
Stephen Hemminger [Tue, 8 Dec 2009 10:26:14 +0000 (13:26 +0300)]
zebra: fix more warnings in rtadv

* zebra/rtadv.c
  * rtadv_free(): remove unused function
  * rtadv_recv_packet(): break up cast/dereference to avoid
    compiler type pun warning
  * rtadv_read(): initialize ifindex, because compiler can't
    figure out that it is okay

14 years agoMerge branch 'master' of ssh://code.quagga.net/var/lib/git/quagga
Denis Ovsienko [Tue, 8 Dec 2009 10:15:12 +0000 (13:15 +0300)]
Merge branch 'master' of ssh://code.quagga.net/var/lib/git/quagga

14 years agozebra: fix more compiler warnings
Stephen Hemminger [Tue, 8 Dec 2009 10:14:27 +0000 (13:14 +0300)]
zebra: fix more compiler warnings

* zebra/zebra_rib.c
  * nexthop_active_update(): make local int vars unsigned
  * nexthop_active_check(): return unsigned for consistency
  * rib_dump(): cast time in printf format
  * vrf_free(): remove unused function
  * vrf_lookup_by_name(): idem
  * rib_if_up(): idem
  * rib_if_down(): idem

14 years agozebra: remove unused function to fix warning
Stephen Hemminger [Tue, 8 Dec 2009 09:27:02 +0000 (12:27 +0300)]
zebra: remove unused function to fix warning

* zebra/interface.c
  * if_supported_family(): sayonara

14 years agolib: make match functions take const args
Stephen Hemminger [Tue, 8 Dec 2009 09:00:50 +0000 (12:00 +0300)]
lib: make match functions take const args

* table.c: general type safety and compiler help:
  * maskbit[]: become const
  * route_node_match(): take const args
  * route_node_match_ipv4(): idem
  * route_node_match_ipv6(): idem
  * check_bit(): idem, plus adjust local vars typing

14 years agolib: remove unused function: route_dump_node()
Denis Ovsienko [Mon, 7 Dec 2009 16:19:13 +0000 (19:19 +0300)]
lib: remove unused function: route_dump_node()

14 years agolib: log source of vty connections (bug #566)
heasley [Mon, 7 Dec 2009 13:41:14 +0000 (16:41 +0300)]
lib: log source of vty connections (bug #566)

heasley: I've used this for a while to track usage.

14 years agoospf6d: review LSA sequence number comparison
Ondrej Zajicek [Mon, 7 Dec 2009 09:33:20 +0000 (12:33 +0300)]
ospf6d: review LSA sequence number comparison

It seems that there is a bug in ospf6d in ospf6_lsa_compare(): If LSA A
has sequence number smaller than 0x80000000 and LSA B has sequence
number larger than 0x80000000, ospf6_lsa_compare() returns that B is
more recent than A, although RFC says that sequence numbers should be
compared as signed numbers (0x8000001 smallest and 0x7FFFFFFF largest).

In ospfd, the function ospf_lsa_more_recent() has it right.

The problem appears when Quagga is used together with OSPFv3 in
development version of BIRD daemon ( http://bird.network.cz/ ),
which creates LSAs with maximum sequence number (0x7FFFFFFF)
as a part of flushing/premature aging LSA from OSPF area.

Because both daemons has different idea of which LSA instance
is more recent, it would lead to LSA storm.

14 years agobgpd: work around warning in assegments_parse()
Denis Ovsienko [Fri, 4 Dec 2009 14:32:54 +0000 (17:32 +0300)]
bgpd: work around warning in assegments_parse()

14 years agozebra: handle RTF_CLONING removal from FreeBSD 8.0
David Ward [Thu, 3 Dec 2009 18:43:11 +0000 (21:43 +0300)]
zebra: handle RTF_CLONING removal from FreeBSD 8.0

The RTF_CLONING flag has been removed in FreeBSD 8.0 with arp-v2 (see
http://svn.freebsd.org/viewvc/base/stable/8/UPDATING?view=markup),
since it no longer has any meaning. This patch checks if RTF_CLONING
exists before using it.

14 years agoisisd: fix --enable-isis-topology for 64-bit Linux
David Ward [Thu, 3 Dec 2009 18:24:36 +0000 (21:24 +0300)]
isisd: fix --enable-isis-topology for 64-bit Linux

14 years agozebra: fix argument reference in strncpy() call for BSD
heasley [Thu, 3 Dec 2009 18:14:16 +0000 (21:14 +0300)]
zebra: fix argument reference in strncpy() call for BSD

14 years agoisisd: fix BPF ioctl() calls, treat "true" and "false" as reserved
David Ward [Thu, 3 Dec 2009 17:44:35 +0000 (20:44 +0300)]
isisd: fix BPF ioctl() calls, treat "true" and "false" as reserved

Avoid a potential conflict with the C99 defines 'true' and 'false'
found in <stdbool.h> by choosing better variable names.

Also fix the calls to these ioctls, as described in <net/bpf.h>
in FreeBSD, NetBSD, and OpenBSD:

* BIOCGBLEN, BIOCIMMEDIATE, BIOCSSEESENT (the parameter should be
of type 'u_int')

* BIOCPROMISC (there should be no parameters)

14 years agoconfigure: fix spelling
David Ward [Thu, 3 Dec 2009 17:22:47 +0000 (20:22 +0300)]
configure: fix spelling

14 years agoospfd: VTY strings cleanup
Stephen Hemminger [Thu, 3 Dec 2009 16:25:04 +0000 (19:25 +0300)]
ospfd: VTY strings cleanup

Several bits of text can be local or are unused.

14 years agoospfd: comment out unused function
Stephen Hemminger [Thu, 3 Dec 2009 16:18:26 +0000 (19:18 +0300)]
ospfd: comment out unused function

14 years agoospfd: make local functions static
Stephen Hemminger [Thu, 3 Dec 2009 16:07:00 +0000 (19:07 +0300)]
ospfd: make local functions static

This code is only used one place and can be made local.
Gcc is smart enough to inline local functions if it wants to.

The function also  has a big chunk of compatiablity code that
is no longer used; since quagga is now in a version control system
the source does not need to be used as a historical reference.

14 years agozebra: fix RIB debug message for IPv6
David Ward [Thu, 3 Dec 2009 12:34:39 +0000 (15:34 +0300)]
zebra: fix RIB debug message for IPv6

Apply changes from commit f304cb48f0d7d0ff8f36e7aca8293141a9fa9e60
to rib_queue_add.

Also includes spelling fixes.

14 years agozebra: make declaration const in rtm_flag_dump()
Tom Goff [Thu, 3 Dec 2009 11:53:15 +0000 (14:53 +0300)]
zebra: make declaration const in rtm_flag_dump()

* kernel_socket.c: (rtm_flag_dump) Use a const message pointer to be
in sync with commit ce0db9cb11c0bc2e7f89a7d042e50afa495556b4.

14 years agoospf6d: fix LSA locking in ospf6_new_ls_id()
Tom Goff [Tue, 1 Dec 2009 18:12:38 +0000 (21:12 +0300)]
ospf6d: fix LSA locking in ospf6_new_ls_id()

* ospf6_lsdb.c: (ospf6_new_ls_id) Unlock the current LSA when breaking
out of the ospf6_lsdb_*_head() / ospf6_lsdb_*_next() loop early. No
explicit unlocking is needed when all LSAs are looped through
because ospf6_lsdb_*_next() manages everything in that case.

14 years agoconfigure: fix HAVE_CLOCK_MONOTONIC spelling
Dmitry Tejblum [Thu, 5 Nov 2009 13:50:36 +0000 (16:50 +0300)]
configure: fix HAVE_CLOCK_MONOTONIC spelling

15 years ago[ospfd] enable more OSPF cost command aliases
Denis Ovsienko [Mon, 28 Sep 2009 15:34:59 +0000 (19:34 +0400)]
[ospfd] enable more OSPF cost command aliases

The following syntax forms were not historically supported
by Quagga, although IOS accepted them w/o a problem:

no ip ospf cost <1-65535>
no ospf cost <1-65535>
no ip ospf cost <1-65535> A.B.C.D
no ospf cost <1-65535> A.B.C.D

From now on Quagga also supports these variants.

15 years agozebra: Fix router advertisements for non-Ethernet link layer addresses
David Ward [Mon, 31 Aug 2009 14:42:06 +0000 (10:42 -0400)]
zebra: Fix router advertisements for non-Ethernet link layer addresses

* rtadv.c: round up when calculating the link-layer address option length;
  add padding to the option if needed to end on an octet boundary

15 years agorelease: 0.99.15
Paul Jakma [Fri, 28 Aug 2009 18:16:31 +0000 (19:16 +0100)]
release: 0.99.15

* configure.ac: Bump to 0.99.15

15 years agoospf6d: bug #529, fix endianness problem in earlier commit
Tom Henderson [Fri, 28 Aug 2009 14:10:00 +0000 (15:10 +0100)]
ospf6d: bug #529, fix endianness problem in earlier commit

* ospf6_lsa.c: (ospf6_lsa_age_current) arithmetical compares make no sense
  in non-host order..

15 years agobgpd: fix md5 set on listen sockets
Stephen Hemminger [Tue, 25 Aug 2009 17:18:15 +0000 (10:18 -0700)]
bgpd: fix md5 set on listen sockets

* bgp_network.c: (bgp_md5_set) Missing piece from earlier listener change
  did not get ported from Vyatta code into upstream.  The list
  listener_sockets changed from (int *) to (struct bgp_listener *).

15 years agolib/trivial: str2prefix checks return of inet_pton in fragile way
Paul Jakma [Sat, 8 Aug 2009 19:41:39 +0000 (20:41 +0100)]
lib/trivial: str2prefix checks return of inet_pton in fragile way

* prefix.c: (str2prefix_ipv6) inet_pton succesful return is presumed to be
  1, rather than the "not zero" the man page describes - seemed fragile.

15 years agozebra: Add an example config file for testzebra
Paul Jakma [Thu, 6 Aug 2009 11:12:12 +0000 (12:12 +0100)]
zebra: Add an example config file for testzebra

* testrib.conf: Example config file for testzebra

15 years agozebra: test_main.c should be a bit more helpful about its usage
Paul Jakma [Thu, 6 Aug 2009 10:48:48 +0000 (11:48 +0100)]
zebra: test_main.c should be a bit more helpful about its usage

* test_main.c: If required arguments are missing, say that.

15 years agolib: if_lookup_by_name should be more robust to null argument
Paul Jakma [Thu, 6 Aug 2009 11:08:50 +0000 (12:08 +0100)]
lib: if_lookup_by_name should be more robust to null argument

* if.c: (if_lookup_by_name) shouldn't crash just cause we got a NULL name

15 years agoospfd: Make sure priority is respected.
Joakim Tjernlund [Sat, 22 Aug 2009 12:57:54 +0000 (14:57 +0200)]
ospfd: Make sure priority is respected.

* ospf_ism.c (ospf_dr_eligible_routers) should test for priority > 0 instead
  of != 0 as ospf_nbr_new () initially sets prio to -1

15 years agoospfd: Tighten up the connected check for redistribution
Joakim Tjernlund [Fri, 7 Aug 2009 11:48:15 +0000 (13:48 +0200)]
ospfd: Tighten up the connected check for redistribution

* ospf_zebra.c: (ospf_distribute_check_connected) check to make filter out
  routes matching connected routes was matching against OSPF networks, which
  can be far more general than the actual connected interfaces. Fix.

15 years agoall: check return value from daemon() call
Stephen Hemminger [Fri, 7 Aug 2009 18:13:49 +0000 (11:13 -0700)]
all: check return value from daemon() call

* */*main.c: (main) Current versions of Gcc warn if the return value for
  daemon() is not checked.  So add a simple test and exit on failure.

15 years agobgp: missing pieces from listener patch
Stephen Hemminger [Fri, 7 Aug 2009 04:05:47 +0000 (21:05 -0700)]
bgp: missing pieces from listener patch

* bgp_network.c: (bgp_accept) The code in current git will crash as part of
  the revised listener code is missing.  The new listener thread code passes
  a pointer to a bgp_listener structure, not the bgp pointer.  The old code
  always got a NULL for bgp pointer, so that is now hard coded.

15 years agobgp: compiler warning fix
Stephen Hemminger [Fri, 7 Aug 2009 04:07:23 +0000 (21:07 -0700)]
bgp: compiler warning fix

* bgp_filter.h: Gcc complains the function prototype is not correct because
  the function argument is using old K&R style.

15 years agoospfd: fix performance problem with redistribute delete
Stephen Hemminger [Thu, 6 Aug 2009 19:58:05 +0000 (12:58 -0700)]
ospfd: fix performance problem with redistribute delete

Doing redistribute delete with full BGP table was taking
30 minutes, this drops it down to less than a second.

* ospf_lsa.c: (ospf_lsa_maxage) When flushing lots of entries the
  performance is terrible because it looks up each LSA entry through
  ospf_lsa_maxage_exist before deleting causing O(N^2) performance.  Use a
  new OSPF_LSA_MAXAGE flag instead of scan - and maintain it.
  (ospf_lsa_maxage_exist) removed
  (ospf_lsa_maxage_delete) maintain OSPF_LSA_MAXAGE flag

15 years agoospfd: Make sure route table is recalculated.
Joakim Tjernlund [Mon, 27 Jul 2009 10:42:35 +0000 (12:42 +0200)]
ospfd: Make sure route table is recalculated.

In some cases ospfd does not recalc the route table. This
happens when ospfd receives an old LSA which will trigger
recalc but the this recalc will fail because all interfaces
isn't up yet. Next LSA that is originated matches the old one
so no recalc will be performed. This problem has been observed
when there are only 2 ppp I/Fs in an area, both go down at the
same time, then they come up again with a few seconds apart.

* ospf_lsa.c: (ospf_{router,network}_lsa_install) avoid a needless scheduling
  of SPF.
  (ospf_lsa_different) fix bug in LSA comparison that would lead to the
  described failure to schedule SPF.

15 years agoospfd: Make "Packet ... received on wrong link" conditional on debug
Paul Jakma [Tue, 11 Aug 2009 11:25:42 +0000 (12:25 +0100)]
ospfd: Make "Packet ... received on wrong link" conditional on debug

* ospf_packet.c: make this message conditional on 'debug ospf event', as it
  be easily triggered with, e.g., multiple subnets sharing same physical
  network. E.g, see bug #532.

15 years agobgpd: Fix mistakes in applying 'allow inbound connections to non-default view'
Paul Jakma [Wed, 5 Aug 2009 15:25:16 +0000 (16:25 +0100)]
bgpd: Fix mistakes in applying 'allow inbound connections to non-default view'

* bgpd.c: (peer_lookup_with_open) Bodged application of previous patch
  meant the second loop around bgp->peer wasn't included in the loop
  around bm->bgp as it was supposed to be. Fix..

15 years agoospfd: neuter some compiler warnings
Paul Jakma [Mon, 3 Aug 2009 15:34:16 +0000 (16:34 +0100)]
ospfd: neuter some compiler warnings

* ospf_lsa.c: (link_info_set) Use %zd for size_t - C99 is old enough now.
  Lots of similar warnings all over the code.
  (ospf_lsa_translated_nssa_compare) Unused func - delete.

15 years agoospfd: update some comments
Paul Jakma [Mon, 3 Aug 2009 14:16:41 +0000 (15:16 +0100)]
ospfd: update some comments

* ospf_{spf,lsa}.c: remove out of date comment; add comment on some
  non-obvious code; Make note of a possible scaling problem.

15 years agoospfd: Change struct ospf_path *oi to ifindex.
Joakim Tjernlund [Mon, 27 Jul 2009 10:42:34 +0000 (12:42 +0200)]
ospfd: Change struct ospf_path *oi to ifindex.

* global: In struct ospf_path, change struct ospf_interface *oi to int
  ifindex.  It is unsafe to reference *oi as an ospf interface can be
  deleted under your feet. Use a weak reference instead.

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