Age | Commit message (Collapse) | Author |
|
2006-06-15 Paul Jakma <paul.jakma@sun.com>
* command.c: (cmd_describe_command_real) Fix leak, CID #38.
|
|
2006-05-28 Paul Jakma <paul.jakma@sun.com>
* configure.ac:
Check for Sun libc printstack(), add a general HAVE_STACK_TRACE
define for lib/log.c, if any supported stack symbol dumping
function is found (glibc backtrace/sun libc printstack).
* log.c: (general) Add support for Sun libc printstack().
(hex_append) make the cpp conditional on general HAVE_STACK_TRACE
define.
(zlog_backtrace_sigsafe) Ditto. Add printstack() version of the
the DUMP macro in this function.
|
|
2006-05-28 Paul Jakma <paul.jakma@sun.com>
* vty.c: (vty_log/vty_log_fixed) dont crash if called when vty
hasn't been initiliased.
|
|
2006-05-28 Paul Jakma <paul.jakma@sun.com>
* memory.c: malloc.h is deprecated in favour of stdlib.h, however
we still need it on GNU Libc for mallinfo().
|
|
2006-05-28 Paul Jakma <paul.jakma@sun.com>
* zebra.h: Include inttypes.h rather than stdint.h, best practice
according to the autoconf manual.
Add UINT*_MAX defines for older platforms lacking these (FBSD 4)
|
|
2006-05-21 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* if.h: (struct connected) Document the meaning of the
ZEBRA_IFC_REAL and ZEBRA_IFC_CONFIGURED flags.
* connected.c: (connected_withdraw) Do not delete the connected
address if the ZEBRA_IFC_CONFIGURED flag is set.
(connected_add_ipv4,connected_add_ipv6) Before calling
connected_withdraw, unset the ZEBRA_IFC_CONFIGURED flag
on the superseded connected structure.
|
|
2006-05-15 Paul Jakma <paul.jakma@sun.com>
* log.c: (general) Generalise struct zebra_route_desc into
struct zebra_desc_table and, similar to route_types, add a
command_types table to describe Zserv protocol commands.
(route_types[]) use a macro to use designated initialisers
while avoiding tedious duplication.
(zserv_command_string) lookup string from zebra_desc_table,
similar to zebra_route_string
* zebra.h: Add declaration for zserv_command_string, adjust the
comments to reflect zebra_desc_table.
|
|
2006-05-13 Paul Jakma <paul.jakma@sun.com>
* vty.c: (vty_describe_command) CID #39 fix was too hasty, just
cause it /can/ leak doesn't mean it always will have, check
first.
|
|
2006-05-12 Paul Jakma <paul.jakma@sun.com>
* command.c: (cmd_describe_command_real) Fix return of freed
pointer when no-match, CID #55.
|
|
2006-05-12 Paul Jakma <paul.jakma@sun.com>
* vty.c: (vty_describe_command) fix leak of describe vector in
error path, CID #39.
|
|
2006-05-12 Paul Jakma <paul.jakma@sun.com>
* command.c: (cmd_complete_command_real) Fix leak of cmd_vector
in error case, Coverity CID #37.
|
|
2006-05-12 Paul Jakma <paul.jakma@sun.com>
* plist.c: (vty_prefix_list_uninstall) Fix potential NULL deref
of prefix and typestr strings, Coverity CID #3.
|
|
2006-03-14 Paul Jakma <paul.jakma@sun.com>
* privs.c: (zprivs_caps_init) Change user IDs before lowering
privileges, while this seems to work on Linux, on Solaris
it rightfully refuses due to PRIV_PROC_SETID having been
dropped.
* command.h: Add the struct host global exported from command.c
|
|
2006-03-30 Paul Jakma <paul.jakma@sun.com>
* workqueue.c: (work_queue_run) fix line length of comment
|
|
2006-03-30 Paul Jakma <paul.jakma@sun.com>
* command.h: (DEFUN_CMD_FUNC_TEXT) Annotate arguments as
potentially being unused.
|
|
2006-03-27 Paul Jakma <paul.jakma@sun.com>
* memtypes.awk: Fix gensub call, g should be a string..
|
|
2006-03-25 Paul Jakma <paul.jakma@sun.com>
* workqueue.h: (struct work_queue) Remove status field and
state flag, no longer used.
|
|
2006-03-19 Paul Jakma <paul.jakma@sun.com>
* memtypes.c: Add MTYPE_BGP_SYNCHRONISE.
* bgp_advertise.c: Use a distinct memory type for struct
bgp_synchronize.
|
|
2006-03-16 Paul Jakma <paul.jakma@sun.com>
* Makefile.am: Fix -version-info argument.
|
|
2006-02-15 Paul Jakma <paul.jakma@sun.com>
* configure.ac: Check for mallinfo, being careful to link test
so we can detect things like umem being used (which doesn't
provide a mallinfo).
* lib/memory.c: (mtype_memstr) new helper function to
return human friendly string for a byte count.
(mtype_stats_alloc) new function, for users to retrieve
number of objects allocated.
(show_memory_mallinfo) New function, show mallinfo statistics
if available.
(show_memory_all_cmd) Call show_memory_mallinfo, if mallinfo
is available.
* lib/memory.h: Export mtype_memstr and mtype_stats_alloc.
Provide a define for a reasonable buffer size for
mtype_memstr.
|
|
2006-03-14 Paul Jakma <paul.jakma@sun.com>
* privs.c: (zprivs_caps_init) Change user IDs before lowering
privileges, while this seems to work on Linux, on Solaris
it rightfully refuses due to PRIV_PROC_SETID having been
dropped.
|
|
2006-03-06 Paul Jakma <paul.jakma@sun.com>
* if.h: export show_address_cmd, for anyone who wishes to use
it.
|
|
2006-02-21 Paul Jakma <paul.jakma@sun.com>
* sockunion.c: (sockunion_{su2str,log}) Use XSTRDUP.
Particularly with _su2str, as that string gets XFREEd,
which can be annoying if run debug code in memory.c.
|
|
2006-02-02 Paul Jakma <paul.jakma@sun.com>
* workqueue.h: (struct work_queue) Remove the delay field.
It served no purpose and just introduced bad behaviour.
Should be excised before its allowed to escape into 1.0.
This removes need for the 'flood' and runs_since_clear
fields.
* workqueue.c: (general) excise delay factor between queue
runs, hence the 'flood' crap too.. See above.
* bgp_route.c: (bgp_{clear_node,process}_queue_init) delay
field is removed from workqueue spec.
|
|
2006-01-19 Paul Jakma <paul.jakma@sun.com>
* stream.c: (stream_getq_from) should use POSIX uint64_t
not u_int64_t. Latter is neither a traditional BSD type, nor
a POSIX type.
|
|
* md5.c: Don't forget to keep const.
* regex.c: Cleanup code and remove warnings.
|
|
2006-01-17 Paul Jakma <paul.jakma@sun.com>
* zclient.{c,h}: (zclient_create_header) export this, seems others
could use it (in lieu of more complete zserv helpers).
|
|
2006-01-17 Paul Jakma <paul.jakma@sun.com>
* vty.c: (no_terminal_monitor_cmd) New ALIAS for
terminal_no_monitor, in the more normal negating format,
to be kind to my fingers.
(vty_init) install new ALIAS.
|
|
2006-01-17 Paul Jakma <paul.jakma@sun.com>
* md5.{c,h}: (md5_loop) Is better off taking a void * and doing
cast to byte wise type internally, avoids needs for casts
in users.
|
|
2006-01-16 Paul Jakma <paul.jakma@sun.com>
* lib/zclient.h: Update the Zserv protocol header with a version
field. Define the old command field to be a 'marker', to
allow old Zserv and updated Zserv to be differentiated.
Future updates will bump the version field obviously. New
command field is made wider. Try to stop using the
'zebra_size_t' typedef in the callbacks.
* lib/zclient.c: Update to read/write new format header.
* zebra/zserv.c: Ditto
|
|
2006-01-11 Paul Jakma <paul.jakma@sun.com>
* if.h: (struct interface) expand flags to 8 bytes.
* zclient.c: (zebra_interface_{add,state}_read) stream read of
interface flags now need to use stream_getq.
(zebra_interface_if_set_value) ditto
2006-01-11 Paul Jakma <paul.jakma@sun.com>
* zserv.c: (zsend_interface_{add,delete,update}) if flags are
8 bytes now, update to write out with stream_putq.
|
|
2006-01-10 Paul Jakma <paul.jakma@sun.com>
* stream.c: (stream_new) Allocate stream data as seperate object.
(stream_free) free the data.
(stream_resize) new function, resize stream to new size.
(stream_{get,put}q*) new functions to get/put quad word size
types.
* stream.h: (struct stream) make data seperate from the stream.
Export new stream_resize and quad-word get/put functions.
|
|
* vty.c (vty_hello): add cast to quiet lint (from David Young)
(patch-lint)
|
|
2005-11-26 Paul Jakma <paul.jakma@sun.com>
* buffer.c: (struct buffer_data) change gcc zero array
declaration to C99 incomplete array.
* stream.h: (struct stream) same
* ospf_api.c: (struct opaque_lsa) same
|
|
2005-11-24 Paul Jakma <paul.jakma@sun.com>
* zebra.h: s/u_int/unsigned int/, u_int is a BSD type, defining
__USE_BSD on Linux pulls in further things from netinet/ip.h
which dont preprocess for some reason. There is no C99
shorthand type directly equivalent to u_int afaict, so don't
use it.
|
|
2005-11-24 Paul Jakma <paul.jakma@sun.com>
* privs.c: (zcaps2sys/solaris) remove unused variable.
(zprivs_state_caps/solaris) Format string missing a
specifier.
|
|
2005-11-14 Paul Jakma <paul.jakma@sun.com>
* (general) pass struct work-queue to callback functions.
* workqueue.h: (struct work_queue) move the state flag
variables to end.
Add an opaque pointer to spec, for user-data global to the
queue.
Pass reference to work_queue to all callbacks.
* workqueue.c: (work_queue_item_remove) pass ref to workqueue
to user callbacks.
(work_queue_run) ditto.
|
|
2005-11-14 Paul Jakma <paul.jakma@sun.com>
* configure.ac: Tell gcc we like C99.
[bug #231] Check and test for stdint.h.
* lib/zebra.h: [bug #231] include stdint, if its there.
|
|
* (general) Add state to detect queue floods. There's no sense
trying to be sparing of CPU resources, if the queue is
flooding and using ever more memory resources. we should just
get on with clearing the queue.
The sense of delay and hold were wrong way around, fix.
* workqueue.h: (struct work_queue) Add status bitfield. Add
'flood' integer to workqueue spec. Add runs_since_clear
counter to workqueue.
* workqueue.c: (work_queue_new) set defaults for delay, hold
and flood.
(work_queue_add) initial schedule should use delay, not hold.
(show_work_queues) Print flood field, conserve whitespace.
(work_queue_unplug) use delay, not hold.
(work_queue_run) consecutive runs should be seperated by hold
time, not delay.
Keep track of number of consecutive runs, go into 'overdrive'
if queue is being flooded, we can't avoid making heavy use of
resources, better to use CPU than ever more RAM.
|
|
2005-11-12 Paul Jakma <paul.jakma@sun.com>
* routemap.c: (vty_show_route_map_entry) call action is
seperate from exit action, latter should still be printed
regardless of whether a call is specified.
|
|
* memtypes.h: Update auto-built file.
|
|
* if.c: (connected_free) use MTYPE for connected label.
memtypes.c: Add MTYPE_CONNECTED_LABEL
|
|
* zebra.h: BSD BYTE_ORDER define isn't available everywhere,
define if needs be.
* checksum.h: new file. checksum.c exports in_cksum, provide
a header for it.
* checksum.c: (in_cksum) callers shouldn't have to know it uses
a u_short internally, change to void *.
* Makefile.am: Add checksum.h
* command.h: remove bogus trailling slash.
* md5.c: (general) Update it for the twentieth century. ANSI
declarations are widely supported now.. Don't include system
headers, only include zebra.h. Use POSIX types (the
alternative is to define u_int64_t in a portable way - rest
of Quagga needs same cleanup).
Make endian-conditional code be compiler conditional rather
than preprocessor conditional, so that breakage gets noticed
quicker.
* md5.h: POSIX types. Get rid of the odd __P() non-ANSI capable
compiler compatibility hack.
|
|
* command.c: Use MTYPE_HOST, MTYPE_STRVEC. Some other fixups,
including fixing some likely leaks in config_write_file.
* vty.c: memory macro usage fixes.
(vty_read_config) fix leak where relative config file is
specified.
|
|
* (general) Cleanup a some calls to XFREE,strdup, etc. to use
the memory.h macros.
* memtypes.c: Add MTYPE_IF_RMAP_NAME, MTYPE_PQUEUE,
MTYPE_PQUEUE_DATA and MTYPE_HOST.
* memtypes.h: update auto-built file.
* if_rmap.c: Use MTYPE_IF_RMAP_NAME.
* pqueue.c: Use the two MTYPE_PQUEUE mtypes for allocations.
|
|
* sockopt.c: (setsockopt_multicast_ipv4) If IP_ADD_MEMBERSHIP
fails with errno equal to EADDRINUSE, then issue an info
message and try IP_DROP_MEMBERSHIP followed by IP_ADD_MEMBERSHIP.
|
|
* memory.c: (show_memory_vty) Omit zero statistics. Print separators
only if some non-zero stats have been printed in between.
(show_separator) New function to print a separator.
(show_memory_all) Keep track of whether a separator is needed
between the different memory statistics groups.
|
|
* memtypes.h: Add MTYPE_OSPF_VERTEX_PARENT (to match memtypes.c).
|
|
* (general) SPF memory management cleanup and fix for rare
double-free bug.
* ospf_spf.h: (struct vertex_parent) New struct to hold parent
specific data, eg the backlink and the parent vertex pointer,
and point to the appropriate general struct vertex_nexthop.
(struct vertex_nexthop) remove parent vertex pointer, so
this struct can be shared across vertices.
(struct vertex) rename list child to list children. Remove
list of nexthops, replace with list of vertex_parents.
* ospf_spf.c: (update_stat) trivial, remove cast from void *.
(vertex_nexthop_new) remove init of parent - field is gone
from struct vertex_nexthop.
(ospf_canonical_nexthops_free) Remove the canonical
vertex_nexthop memory objects. These are the vertex_nexthops
attached to the first level of router vertices from the root.
(vertex_parent_new) new function, create a vertex_parent.
(vertex_parent_free) ditto, but free it.
(ospf_vertex_new) Update to match changes to struct vertex.
(ospf_vertex_free) Recursively free a struct vertex and its
children. The parent list is used as a reference count.
vertex_nexthops must be free seperately, if required.
(ospf_vertex_dump) update to match struct vertex changes.
Print out backlink of parents too.
(ospf_vertex_add_parent) ditto.
(ospf_lsa_has_link) update comment.
(ospf_nexthop_add_unique) removed, not needed anymore.
(ospf_nexthop_merge) ditto.
(ospf_spf_consider_nexthop) renamed to ospf_spf_add_parent.
Simplified to just create vertex_parent and add it.
(ospf_spf_flush_parents) new function, flush out the parent
list.
(ospf_nexthop_calculation) Take the relevant route_lsa_link
as an argument, which simplifies things and removes the need
for the hack in ospf_nexthop_add_unique - ospf_spf_next
already knew exactly which link the cost calculated was for.
Update to match struct vertex changes too.
(ospf_spf_next) Don't create a vertex for W unnecessarily, if
it's there's a vertex already created for W, use it, and
hence there's no need to free it either.
Update some manipulation/comparisons of distance to match.
Flush the parent list if a lower cost path is found.
(ospf_spf_route_free) unused, removed.
(ospf_spf_dump) match the struct vertex changes, and dump the
ifname if possible.
(ospf_spf_calculate) At end of SPF, free the canonical nexthops
and call ospf_vertex_free on the root vertex to free the
entire tree.
* ospf_interface.c: (ospf_vl_set_params) match struct vertex
changes.
* ospf_route.c: (ospf_intra_route_add) ditto
(ospf_route_copy_nexthops_from_vertex) ditto
* memtypes.c: (memory_list_ospf) Add MTYPE_OSPF_VERTEX_PARENT.
|
|
* zebra.h: Declare new functions zebra_route_string() and
zebra_route_char().
* log.c: (zroute_lookup,zebra_route_string,zebra_route_char) New
functions to map zebra route numbers to strings.
* zebra_vty.c: (route_type_str) Remove obsolete function: use new
library function zebra_route_string() instead. Note that there
are a few differences: for IPv6 routes, we now get "ripng" and
"ospf6" instead of the old behavior ("rip" and "ospf").
(route_type_char) Remove obsolete function: ues new library function
zebra_route_char() instead. Note that there is one difference:
the old function returned 'S' for a ZEBRA_ROUTE_SYSTEM route,
whereas the new one returns 'X'.
(vty_show_ip_route_detail,vty_show_ipv6_route_detail) Replace
route_type_str() with zebra_route_string().
(vty_show_ip_route,vty_show_ipv6_route) Replace route_type_char()
with zebra_route_char().
* bgp_vty.c: (bgp_config_write_redistribute) Use new library function
zebra_route_string instead of a local hard-coded table.
* ospf6_asbr.c: Remove local hard-coded tables zroute_name and
zroute_abname. Change the ZROUTE_NAME macro to use new library
function zebra_route_string(). Remove the ZROUTE_ABNAME macro.
(ospf6_asbr_external_route_show): Replace ZROUTE_ABNAME() with
a call to zebra_route_char(), and be sure to fix the format string,
since we now have a char instead of a char *.
* ospf6_zebra.c: Remove local hard-coded tables zebra_route_name and
zebra_route_abname. Note that the zebra_route_name[] table
contained mixed-case strings, whereas the zebra_route_string()
function returns lower-case strings.
(ospf6_zebra_read_ipv6): Change debug message to use new library
function zebra_route_string() instead of zebra_route_name[].
(show_zebra): Use new library function zebra_route_string() instead
of zebra_route_name[].
* ospf_dump.c: Remove local hard-coded table ospf_redistributed_proto.
(ospf_redist_string) New function implemented using new library
function zebra_route_string(). Note that there are a few differences
in the output that will result: the new function returns strings
that are lower-case, whereas the old table was mixed case. Also,
the old table mapped ZEBRA_ROUTE_OSPF6 to "OSPFv3", whereas the
new function returns "ospf6".
* ospfd.h: Remove extern struct message ospf_redistributed_proto[],
and add extern const char *ospf_redist_string(u_int route_type)
instead.
* ospf_asbr.c: (ospf_external_info_add) In two messages, use
ospf_redist_string instead of LOOKUP(ospf_redistributed_proto).
* ospf_vty.c: Remove local hard-coded table distribute_str.
(config_write_ospf_redistribute,config_write_ospf_distribute): Use
new library function zebra_route_string() instead of distribute_str[].
* ospf_zebra.c: (ospf_redistribute_set,ospf_redistribute_unset,
ospf_redistribute_default_set,ospf_redistribute_check)
In debug messages, use ospf_redist_string() instead of
LOOKUP(ospf_redistributed_proto).
* rip_zebra.c: (config_write_rip_redistribute): Remove local hard-coded
table str[]. Replace str[] with calls to new library function
zebra_route_string().
* ripd.c: Remove local hard-coded table route_info[].
(show_ip_rip) Replace uses of str[] with calls to new library
functions zebra_route_char and zebra_route_string.
* ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded
table str[]. Replace str[i] with new library function
zebra_route_string(i).
* ripngd.c: Remove local hard-coded table route_info[].
(show_ipv6_ripng) Use new library function zebra_route_char() instead
of table route_info[].
|