Commit Graph

374 Commits

Author SHA1 Message Date
Paul Jakma
bc20c1a463 [ospfd] Bug #330: SPF must consider that nexthop-calc may fail
2007-01-24 Paul Jakma <paul.jakma@sun.com>

	* ospf_spf.c: Bug #330: Nexthop calculation sometimes may fail,
	  and it needs to indicate this result to SPF.
	  (ospf_spf_add_parent) Flush of parent list needs to be done here,
	  for simplicity.
	  (ospf_nexthop_calculation) Caller needs to know whether
	  nexthop calculation succeeded. Every return statement must
	  correctly indicate such.
	  (ospf_spf_next) Queueing/prioritisation of vertices in SPF
	  must take into account whether nexthop_calculation succeeded,
	  or SPF may fail to find best paths.
2007-01-24 14:51:51 +00:00
Andrew J. Schorr
e4529636b7 [PtP over ethernet] New peer flag allows much more addressing flexibility
2006-12-12 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* if.h: (struct connected) Add new ZEBRA_IFA_PEER flag indicating
	  whether a peer address has been configured.  Comment now shows
	  the new interpretation of the destination addr: if ZEBRA_IFA_PEER
	  is set, then it must contain the destination address, otherwise
	  it may contain the broadcast address or be NULL.
	  (CONNECTED_DEST_HOST,CONNECTED_POINTOPOINT_HOST) Remove obsolete
	  macros that were specific to IPv4 and not fully general.
	  (CONNECTED_PEER) New macro to check ZEBRA_IFA_PEER flag.
	  (CONNECTED_PREFIX) New macro giving the prefix to insert into
	  the RIB: if CONNECTED_PEER, then use the destination (peer) address,
	  else use the address field.
	  (CONNECTED_ID) New macro to come up with an identifying address
	  for the struct connected.
	* if.c: (if_lookup_address, connected_lookup_address) Streamline
	  logic with new CONNECTED_PREFIX macro.
	* prefix.h: (PREFIX_COPY_IPV4, PREFIX_COPY_IPV6) New macros
	  for better performance than the general prefix_copy function.
	* zclient.c: (zebra_interface_address_read) For non-null destination
	  addresses, set prefixlen to equal the address prefixlen.  This
	  is needed to get the new CONNECTED_PREFIX macro to work properly.
	* connected.c: (connected_up_ipv4, connected_down_ipv4,
	  connected_up_ipv6, connected_down_ipv6) Simplify logic using the
	  new CONNECTED_PREFIX macro.
	  (connected_add_ipv4) Set prefixlen in destination addresses (required
	  by the CONNECTED_PREFIX macro).  Use CONNECTED_PEER macro instead
	  of testing for IFF_POINTOPOINT.  Delete invalid warning message.
	  Warn about cases where the ZEBRA_IFA_PEER is set but no
	  destination address has been supplied (and turn off the flag).
	  (connected_add_ipv6) Add new flags argument so callers may set
	  the ZEBRA_IFA_PEER flag.  If peer/broadcast address satisfies
	  IN6_IS_ADDR_UNSPECIFIED, then reject it with a warning.
	  Set prefixlen in destination address so CONNECTED_PREFIX will work.
	* connected.h: (connected_add_ipv6) Add new flags argument so
	  callers may set the ZEBRA_IFA_PEER flag.
	* interface.c: (connected_dump_vty) Use CONNECTED_PEER macro
	  to decide whether the destination address is a peer or broadcast
	  address (instead of checking IFF_BROADCAST and IFF_POINTOPOINT).
	* if_ioctl.c: (if_getaddrs) Instead of setting a peer address
	  only when the IFF_POINTOPOINT is set, we now accept a peer
	  address whenever it is available and not the same as the local
	  address.  Otherwise (no peer address assigned), we check
	  for a broadcast address (regardless of the IFF_BROADCAST flag).
	  And must now pass a flags value of ZEBRA_IFA_PEER to
	  connected_add_ipv4 when a peer address is assigned.
	  The same new logic is used with the IPv6 code as well (and we
	  pass the new flags argument to connected_add_ipv6).
	  (if_get_addr) Do not bother to check IFF_POINTOPOINT: just
	  issue the SIOCGIFDSTADDR ioctl and see if we get back
	  a peer address not matching the local address (and set
	  the ZEBRA_IFA_PEER in that case).  If there's no peer address,
	  try to grab SIOCGIFBRDADDR regardless of whether IFF_BROADCAST is set.
	* if_ioctl_solaris.c: (if_get_addr) Just try the SIOCGLIFDSTADDR ioctl
	  without bothering to check the IFF_POINTOPOINT flag.  And if
	  no peer address was found, just try the SIOCGLIFBRDADDR ioctl
	  without checking the IFF_BROADCAST flag.  Call connected_add_ipv4
	  and connected_add_ipv6 with appropriate flags.
	* if_proc.c: (ifaddr_proc_ipv6) Must pass new flags argument to
	  connected_add_ipv6.
	* kernel_socket.c: (ifam_read) Must pass new flags argument to
	  connected_add_ipv6.
	* rt_netlink.c: (netlink_interface_addr) Copy logic from iproute2
	  to determine local and possible peer address (so there's no longer
	  a test for IFF_POINTOPOINT).  Set ZEBRA_IFA_PEER flag appropriately.
	  Pass new flags argument to connected_add_ipv6.
	  (netlink_address) Test !CONNECTED_PEER instead of if_is_broadcast
	  to determine whether the connected destination address is a
	  broadcast address.
	* bgp_nexthop.c: (bgp_connected_add, bgp_connected_delete)
	  Simplify logic by using new CONNECTED_PREFIX macro.
	* ospf_interface.c: (ospf_if_is_configured, ospf_if_lookup_by_prefix,
	  ospf_if_lookup_recv_if) Simplify logic using new CONNECTED_PREFIX
	  macro.
	* ospf_lsa.c: (lsa_link_ptop_set) Using the new CONNECTED_PREFIX
	  macro, both options collapse into the same code.
	* ospf_snmp.c: (ospf_snmp_if_update) Simplify logic using new
	  CONNECTED_ID macro.
	  (ospf_snmp_is_if_have_addr) Simplify logic using new CONNECTED_PREFIX
	  macro.
	* ospf_vty.c: (show_ip_ospf_interface_sub) Use new CONNECTED_PEER macro
	  instead of testing the IFF_POINTOPOINT flag.
	* ospfd.c: (ospf_network_match_iface) Use new CONNECTED_PEER macro
	  instead of testing with if_is_pointopoint.  And add commented-out
	  code to implement alternative (in my opinion) more elegant behavior
	  that has no special-case treatment for PtP addresses.
	  (ospf_network_run) Use new CONNECTED_ID macro to simplify logic.
	* rip_interface.c: (rip_interface_multicast_set) Use new CONNECTED_ID
	  macro to simplify logic.
	  (rip_request_interface_send) Fix minor bug: ipv4_broadcast_addr does
	  not give a useful result if prefixlen is 32 (we require a peer
	  address in such cases).
	* ripd.c: (rip_update_interface) Fix same bug as above.
2006-12-12 19:18:21 +00:00
Andrew J. Schorr
ed589c1577 [ospfd] Consider all connected addresses when creating ospf interfaces
2006-12-04 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospfd.c: (ospf_network_run) Remove an offending 'break' statement.
	  Previously, after creating a single ospf_interface on a given
	  network interface, the code would skip to the next interface
	  without considering other connected addresses on the interface.
	  After removing the 'break', we now consider all connected addresses.
2006-12-04 18:26:37 +00:00
Andrew J. Schorr
7f643ebf2b [ospfd] Add debug messages for a few zebra messages that had been overlooked
2006-11-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_zebra.c: (ospf_router_id_update_zebra,
	  ospf_interface_address_add, ospf_interface_address_delete)
	  If (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE)) is enabled, then
	  add a debug message about what Zebra is telling us.
	  (ospf_zebra_add_discard) Add a debug message matching the one
	  already in ospf_zebra_delete_discard.
2006-11-30 16:17:02 +00:00
Andrew J. Schorr
4354088661 [ospfd] Fix bug in passive-interface default commands.
2006-11-28 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_vty.c: (ospf_passive_interface_default) Take additional
	  'newval' arg so we can update ospf->passive_interface_default inside
	  this function.  More importantly, we now call ospf_if_set_multicast
	  on all ospf_interfaces.
	  (ospf_passive_interface, no_ospf_passive_interface) Fix bug:
	  for 'default' case, argv[0] is undefined, so we must test for
	  (argc == 0) before using argv[0].  And since
	  ospf_passive_interface_default now calls ospf_if_set_multicast as
	  needed, we can just return after calling
	  ospf_passive_interface_default.
2006-11-28 16:36:39 +00:00
Andrew J. Schorr
8fb8a504e2 [ospfd] Stop losing subsequent default-information originate 'always' info
2006-10-24 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_zebra.c: (ospf_redistribute_default_set) Fix bug where
	  a new value for ospf->default_originate was being ignored
	  if a previous 'default-information originate' command
	  had already been processed.
2006-10-24 19:04:26 +00:00
Paul Jakma
7ffa8fa232 [ospfd] Add passive-interface default support
2006-10-22 Yar Tikhiy <yar@comp.chem.msu.su>

	* (general) Add support for passive-interface default (with
	  minor edits by Paul Jakma).
	* ospf_interface.h: Add OSPF_IF_PASSIVE_STATUS macro, looking
	  at configured value, or the global 'default' value, as
	  required.
	* ospf_interface.c: (ospf_if_new_hook) Leave passive
	  unconfigured per default, allowing global 'default' to
	  take effect for unconfigured interfaces.
	* ospf_packet.c: (various) use OSPF_IF_PASSIVE_STATUS
	* ospf_vty.c: (ospf_passive_interface_default) new function,
	  unset passive from all interfaces if default is enabled, as
	  the per-iface settings become redundant.
	  (ospf_passive_interface_update) new func, update passive
	  setting taking global default into account.
	  ({no,}ospf_passive_interface_addr_cmd) Add support for
	  'default' variant of command.
	  (show_ip_ospf_interface_sub) Update to take global
	  default into account when printing passive status.
	  (ospf_config_write) ditto.
	* ospfd.c: (ospf_new) set global passive-interface default.
	* ospfd.h: (struct ospf) Add field for global
          passive-interface.
2006-10-22 20:07:53 +00:00
Paul Jakma
876b8be0ab [daemon startup] Add --dry-run/-C argument to daemons, to check config file syntax
2006-10-04 Oliver Hookins <ohookins@gmail.com>

	* bgpd/bgp_main.c: Add configuration check option, with
	'-C' rather than '-c' for consistency between daemons.
	* isisd/isis_main.c: ditto
	* ospf6d/ospf6_main.c: ditto
	* ospfd/ospf_main.c: ditto
	* ripngd/ripng_main.c: ditto
	* vtysh/vtysh_main.c: ditto
	* ripd/rip_main.c: Change the config check option to
	'-C' and tidy up the code.
	* zebra/main.c: ditto

2006-10-04 Stergiakis Alexandros <astergiakis@antcor.com>

	* ripd/rip_main.c: This trivial patch introduces a new
	  command-line option '-c', which instructs zebra/ripd
	  to check its configuration file for validity,	print
	  any error message, and then exit. This is useful when
	  the configuration file is edited by hand or otherwise,
	  and you simply want to validate it without any other
	  effect.
	* zebra/main.c: ditto
2006-10-15 23:35:57 +00:00
Andrew J. Schorr
08c8367197 [ospfd] Improve some warning messages.
2006-09-25 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_packet.c: (ospf_packet_dup, ospf_make_md5_digest)
	  Fix zlog_warn messages to eliminate compiler warnings.
	  (ospf_hello) Improve warning messages to show why we
	  are complaining.
2006-09-25 13:26:14 +00:00
Paul Jakma
b5aeb4410a [ospfd] Fix assertion in DB-exchange fix, hit by ogier-db-ex-opt commit
2006-08-28 Andy Gay <andy@andynet.net>

	* ospf_packet.c: (ospf_make_db_desc) Assert added with More-bit
	  fixes does not hold up with addition of Ogier DB-Exchange
	  optimisation, which can empty the db-summary list in between
	  sent DD packets. Remove assert, update More-bit always when
	  in Exchange.
2006-08-30 18:47:37 +00:00
Paul Jakma
29b5a044e5 [ospfd] redistribute default no longer works after complete reconfig, fix
2006-08-27 J.J. Krabbendam <jkrabbendam@aimsys.nl>

	* ospfd.c: (ospf_finish_final) default redistribute should be
	  unset too, fixes bug where reconfiguring ospfd completely
	  can no longer enable default redistribution.
2006-08-27 08:01:20 +00:00
Paul Jakma
2518efd15b [ospfd] Bug #134, ospfd should be more robust to backward time change
2006-08-25 Paul Jakma <paul.jakma@sun.com>

	* (general) Bug #134. Be more robust to backward time changes,
	  use the newly added libzebra time functions.
	  In most cases: recent_time -> recent_relative_time()
	  gettimeofday -> quagga_gettime (QUAGGA_CLK_MONOTONIC, ..)
	  time -> quagga_time.
	  (ospf_make_md5_digest) time() call deliberately not changed.
	  (ospf_external_lsa_refresh) remove useless gettimeofday, LSA
	  tv_orig time was already set in ospf_lsa_new, called via
	  ospf_external_lsa_new.
2006-08-27 06:49:29 +00:00
Paul Jakma
f0894cf8c3 [ospfd] draft-ogier-ospf-dbex-opt DB-exchange optimisation
2006-08-03 Paul Jakma <paul.jakma@sun.com>

	* ospf_packet.c: (ospf_make_db_desc) Implement
	  draft-ogier-ospf-dbex-opt DB-exchange optimisation.
2006-08-27 06:40:04 +00:00
Paul Jakma
8dd24ee6d7 [ospfd] Raise ExchangeDone earlier, avoid often needless round of DD packets
2006-08-03 Paul Jakma <paul.jakma@sun.com>

	* ospf_packet.c: (ospf_make_db_desc) Unset the DD More bit
	  after constructing the packet, if appropriate.
	  (ospf_db_desc_proc) Speed up Exchange, slave should raise
	  ExchangeDone earlier, as RFC mandates, by forming its reply
	  before deciding whether both sides are done, avoids a
	  needless round of empty DD packet exchanges at the end of
	  Exchange, hence speeding up ExchangeDone.
	  (ospf_db_desc) use UNSET_FLAG macro.
2006-08-27 06:29:30 +00:00
Paul Jakma
ba122e779d [ospfd] trivial: consolidate LSDB delete code into single function
2006-08-04 Paul Jakma <paul.jakma@sun.com>

	* ospf_lsdb.c: (ospf_lsdb_delete_entry) new function, consolidate
	  exact same functionality replicated in other functions.
	  (ospf_lsdb_add) Strip out code by using ospf_lsdb_delete_entry.
	  (ospf_lsdb_delete) ditto.
	  (ospf_lsdb_delete_all) ditto.
2006-08-27 06:24:34 +00:00
Andrew J. Schorr
1670008b54 [ospfd] Bug #288: do not change router ID unless forced by manual configuration
2006-07-27 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospfd.c: (ospf_router_id_update) Fix and document the algorithm for
	  selecting the router ID: if there is not a statically configured ID,
	  then stick to the most recent value to avoid disruptive changes.
	  This should fix bug #288.
2006-07-27 22:29:06 +00:00
Paul Jakma
1fe6ed38cd [ospfd] Allow ospf_lsa_unlock to NULL out callers' LSA pointers upon free
2006-07-26 Paul Jakma <paul.jakma@sun.com>

	* ospf_lsa.{c,h}: (ospf_lsa_unlock) Change to take a double pointer
	  to the LSA to be 'unlocked', so that, if the LSA is freed, the
	  callers pointer to the LSA can be NULLed out, allowing any further
	  use of that pointer to provoke a crash sooner rather than later.
	* ospf_*.c: (general) Adjust callers of ospf_lsa_unlock to match
	  previous. Try annotate 'locking' somewhat to show which 'locks'
	  are protecting what LSA reference, if not obvious.
	* ospf_opaque.c: (ospf_opaque_lsa_install) Trivial: remove useless
	  goto, replace with return.
	* ospf_packet.c: (ospf_make_ls_ack) Trivial: merge two list loops,
	  the dual-loop predated the delete-safe list-loop macro.
2006-07-26 09:37:26 +00:00
Paul Jakma
3fed4160cd [ospfd] Additional NSM neighbour state change stats/information
2006-07-25 Paul Jakma <paul.jakma@sun.com>

	* ospf_neigbor.h: (struct ospf_neighbor) Add some additional
	  neighbour state statistics fields, timestamps for progressive
	  and regressive state changes, and pointer to event string
	  for the latter state change.
	* ospf_nsm.c: (nsm_notice_state_change) Update new state changs
	  history as required.
	* ospf_vty.c: (show_ip_ospf_neighbor_detail_sub) Print out above
	  new per-neighbour state change stats.
2006-07-25 20:44:12 +00:00
Paul Jakma
90c33177f5 [ospfd] record timestamp and event of last NSM state change for neighbour
2006-07-10 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.c: (ospf_nsm_event) Record state change timestamp
	  and event in nbr struct.
	* ospf_neighbor.h: (struct ospf_neighbor) Add fields to record
	  timestamp of last NSM change and event.
	* ospf_vty.c: (show_ip_ospf_neighbor_detail_sub) Print
	  last state change timestamp and event, if available.
2006-07-11 17:57:25 +00:00
Paul Jakma
3d63f38064 [ospfd] trivial: NSM AdjChange should print event, declutter core functions
2006-07-10 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.c: (nsm_notice_state_changes) Move state change
	  logging code to new func to declutter nsm_change_state and
	  ospf_nsm_event.
	  Log event with AdjChange, it's useful to know.
	  (nsm_change_state) move adjchange and snmp logging to previous.
	  (ospf_nsm_event) call nsm_notice_state_changes from here.
	  Move the debug message to entry of function, so it gets out
	  even if something goes wrong.
2006-07-11 17:52:53 +00:00
Paul Jakma
539e1523c7 [ospfd] Remove nsm_reset_nbr and a bunch of useless NSM event/action functions
2006-07-10 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.c: (nsm_change_state) call nsm_clear_adj for all
	  adjacency losses, hence removing need for nsm_reset_nbr.
	  (nsm_reset_nbr) kill it, clear_adj in previous does fine.
	  (nsm_kill_nbr,nsm_start) remove nsm_reset_nbr call.
	  (ospf_nsm_event) Allow NSM function to be NULL, this along with
	  removal of nsm_reset_nbr, allows a bunch of now useless functiosn
	  to be removed.
	  Remove some useless variables.
	  (nsm_ignore) now useless, remove.
	  (nsm_bad_ls_req) ditto
	  (nsm_seq_number_mismatch)   "
	  (nsm_oneway_received)       "
	  (nsm_inactivity_timer)      "
	  (nsm_ll_down)               "
	  (NSM) replace removed action functions with NULL.
2006-07-11 17:49:22 +00:00
Andrew J. Schorr
13cd3dc1e8 [ospfd] Improve Hello NetworkMask mismatch warning to give more info
2006-07-10 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_packet.c: (ospf_hello) Improve NetworkMask mismatch warning
	  message to include interface name and conflicting prefix lengths.
2006-07-11 01:50:30 +00:00
Paul Jakma
1f2c2743ac [ospfd] cleanup NSM neighbour delete through a new Deleted NSM state
2006-07-07 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.h: Add a NSM_Deleted neighbour state, to act as dummy
	  state indicating the neighbour is to be deleted.
	* ospf_nsm.c: (general) Use the NSM_Deleted state to delete
	  neighbours, thus allowing code to be slightly more obvious
	  in its flow.
	  (nsm_timer_set) Add NSM_Deleted. Add another timer the code
	  missed.
	  (nsm_kill_nbr) No need for special case call to nsm_change_state
	  anymore.
	  Make the assert and error-handling for same case more readable
	  (Andrew Schorr)
	  Remove the call to ospf_nbr_delete, nsm_change_state can do
	  this generally now via NSM_Deleted.
	  (struct ... NSM) Add the dummy NSM_Deleted state, the 3 events
	  that can lead to nsm_kill_nbr all now transition the NBR to
	  NSM_Deleted and the general change_state function can be left
	  to do the work.
	  (ospf_nsm_event) Special casing of events and early-return can
	  be removed now.
	  On transition into Deleted, delete the nbr.
	* ospf_dump.c: (ospf_nsm_state_msg) Add Deleted.
2006-07-10 07:45:13 +00:00
Paul Jakma
aa2737a08a [ospfd] early-return in nsm_event missed LLDown event, fixes use after free
2006-07-06 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.c: (ospf_nsm_event) LLDown event also results in nbr
	  being deleted, requires early-return too. Likely explains
	  some crash reports after interface events.
2006-07-06 11:12:39 +00:00
Paul Jakma
f7a76abf30 [ospfd] Apply some simplifications to ospf_nsm, from Andrew's suggestions
2006-07-04 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.c: (general) Various small cleanups from Andrew's
	  review of last set of patches.
	  (nsm_timer_set) Loading, Full and default can share
	  same code too.
	  (nsm_should_adj) Can just be one big OR.
	  (nsm_twoway_received) Collapse into return statement.
2006-07-04 13:57:49 +00:00
Paul Jakma
5db95bc2dd [ospfd] CID #13, dont try print out fields of LSA we know to be NULL.
2006-07-02 Paul Jakma <paul.jakma@sun.com>

	* ospf_lsa.c: (ospf_translated_nssa_refresh) CID #13.
2006-07-04 13:52:29 +00:00
Paul Jakma
d1b1cd8fb9 [ospfd] Clear adjacency state for NSM changes down to TwoWay/ExStart
2006-07-02 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.c: (nsm_clear_adj) clear adjacency related state for a
	  neighbour, needed for some state changes from > ExStart down
	  to ExStart or less, which need not go through nsm_reset_nbr.
	  (nsm_reset_nbr) move code to former. Should be static.
	  (ospf_nsm_event) Remove long dead code.
	  Use nsm_clear_adj for state changes that take down
	  adjacencies to TwoWay/ExStart.
	  (nsm_kill_nbr) Oops, action function shouldn't try return
	  1 for error.
2006-07-04 13:50:44 +00:00
Paul Jakma
e55dd53bca [ospfd] trivial cleanup of nsm_timer_set
2006-07-02 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.c: (nsm_timer_set) ls_req timer should be OFF in
	  early states.
	  Compact several identical sections.
	  Set inactivity timer to OFF for Down, for documentary purposes.
2006-07-04 13:46:14 +00:00
Paul Jakma
ba0beb4a84 [ospfd] Ensure NSM state functions can redirect next_state accidently
2006-07-02 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.c: (ospf_nsm_event) Don't allow action functions to
	  change next_state if the NSM tables do not indicate
	  next_state is conditional, log warning if one tries -
	  existing code appears fine though.
2006-07-04 13:44:19 +00:00
Paul Jakma
d7b0fb62ec [ospfd] consolidate adjacency check logic
2006-07-02 Paul Jakma <paul.jakma@sun.com>

	* ospf_nsm.c: (nsm_should_adj) New function, just consolidate the
	  10.4 adjacency check from nsm_twoway_received/nsm_adj_ok.
	  (nsm_twoway_received/nsm_adj_ok) Use former.
2006-07-04 13:35:24 +00:00
Andrew J. Schorr
1c066bfe62 [ospfd] Fix "show ip ospf neighbor A.B.C.D" to show all matches
2006-06-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_vty.c: (show_ip_ospf_neighbor_id) Should show all instances
	  of that neighbor (since it may appear on multiple interfaces)
	  instead of bailing out after showing the first match.
2006-06-30 16:53:47 +00:00
Andrew J. Schorr
7694787c19 [ospfd] Avoid getting NSM stuck in ExStart by using local view of DR/BDR
2006-06-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_nsm.c: (nsm_twoway_received) When deciding whether to
	  change from state Init to ExStart, the test for whether the
	  neighboring router is DR or BDR should be against the
	  local router's notion of DR/BDR, not the neighbor's view.
2006-06-30 03:21:05 +00:00
Andrew J. Schorr
d7e60dd7a9 [ospfd] Implement new ospf router subcommand "log-adjacency-changes [detail]"
2006-06-28 Erik Muller <erikm@internap.com>

	* ospfd.h: Define 2 new struct ospf config flags:
	  OSPF_LOG_ADJACENCY_CHANGES and OSPF_LOG_ADJACENCY_DETAIL
	* ospf_nsm.c (nsm_change_state): Log adjacency changes if
	  requested.
	* ospf_vty.c (ospf_log_adjacency_changes): New command function
	  to implement ospf subcommand "log-adjacency-changes [detail]".
	  (no_ospf_log_adjacency_changes) Turn off log-adjacency-changes.
	  (show_ip_ospf) Show whether adjacency changes are logged.
	  (ospf_config_write) Add "log-adjacency-changes [detail]" to config.
	  (ospf_vty_init) Add ospf_log_adjacency_changes and
	  no_ospf_log_adjacency_changes.
	* ospfd.texi: Document new ospf router subcommand
	  "log-adjacency-changes [detail]".
2006-06-29 20:20:52 +00:00
Paul Jakma
d1c65c211c [ospfd] Replace redistribution strings with new route_types.h defines.
2006-05-23 Paul Jakma <paul.jakma@sun.com>

	* ospf_vty.c: (general) Replace in-place route redistribution
	  command and help strings with the new auto-generated defines
	  from lib/route_types.h
2006-06-27 08:01:43 +00:00
Paul Jakma
9560fa8ac9 [ospfd] NSSA translate-enabled ABR should declare itself as ASBR
2006-06-26 Paul Jakma <paul.jakma@sun.com>

	* ospf_abr.c: (general) NSSA translate-candidate ABRs need to
	  be ASBRs, or other routers may rightfully refuse to install
	  translated type-5s LSAs. reported by dendroot@gmail.com.
	  (ospf_abr_nssa_check_status) Detect change in translator
	  state when ABR, and inc/dec redistribute count as when we
	  leave/enter the disabled state - so that translate-enabled
	  ABR properly sets ASBR bit on non-NSSA areas.
	  Run the resulting function through indent to clean it up.
	* ospf_lsa.c: (router_lsa_flags) For purposes of ASBR bit,
	  NSSA area is same as stub area.
2006-06-26 12:50:06 +00:00
Andrew J. Schorr
9aecfae2ec [ospfd] Improve two info log messages in ospf_snmp.c
2006-06-24 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_snmp.c: (ospfTrapNbrStateChange, ospfTrapIfStateChange) Improve
	  info log message to indicate why the trap is being sent.
2006-06-24 20:05:02 +00:00
Andrew J. Schorr
0ffb7094d3 [ospfd] When writing out config, show "debug ospf nsm status" properly
2006-06-24 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_dump.c: (config_write_debug) Fix typo to show debug ospf nsm
	  status properly (not ism status).
2006-06-24 19:40:13 +00:00
Andrew J. Schorr
6e72cb6a09 [ospfd] Fix ospf passive-interface subcommand to create interface if necessary
2006-06-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

	* ospf_vty.c: ({no_,}ospf_passive_interface) Replace if_lookup_by_name
	  with a call to if_get_by_name -- if the interface does not exist
	  already, it should be created.  And remove the obsolete warning
	  message.
2006-06-18 00:45:48 +00:00
Paul Jakma
429ac78cc6 [ospfd] Fix multicast membership drop bug
2006-06-15 Paul Jakma <paul.jakma@sun.com>

	* Reported by Milan Koci
	* ospf_interface.h: (struct ospf_if_info) Add reference counts
	  for multicast group memberships. Add various macros to help
	  manipulate/check membership state.
	* ospf_interface.c: (ospf_if_set_multicast) Maintain the
	  ospf_if_info reference counts, and only actually drop
	  memberships if it hits 0, to avoid losing membership when
	  OSPF is disabled on an interface with multiple active OSPF
	  interfaces.
	* ospf_packet.c: (ospf_{hello,read}) Use the new macros to
	  check/set
	  multicast membership.
	* ospf_vty.c: (show_ip_ospf_interface_sub) ditto.
2006-06-15 18:40:49 +00:00
Paul Jakma
ac904dec03 [ospfd] lsdb_delete/discard_from_db should be more robust to bad args
2006-05-31 Paul Jakma <paul.jakma@sun.com>

	* ospf_lsdb.c: (ospf_lsdb_delete) robustify against NULL arguments,
	  print warning.
	* ospf_lsa.c: (ospf_discard_from_db) ditto.
	  (ospf_maxage_lsa_remover) Check lsa->lsdb for validity, possible
	  mitigation (but not solution) for bug #269.
2006-06-15 12:04:57 +00:00
Paul Jakma
88871b1d1e [ospfd] suppres mostly uninteresting debug message unless debug is set
2006-05-30 Paul Jakma <paul.jakma@sun.com>

	* ospf_packet.c: (ospf_read) Debug message about packets
	  received on unenabled interfaces should be conditional on
	  debug being set.
2006-06-15 11:41:19 +00:00
Paul Jakma
ae128056e9 [ospfd] Fix small error in CID #13 commit
2006-05-13 Paul Jakma <paul.jakma@sun.com>

	* ospf_lsa.c: (ospf_translated_nssa_refresh) fix the sanity
	  check to match the assert, small error in CID #13 fix.
2006-05-12 23:15:30 +00:00
Paul Jakma
e54e6e5720 [ospfd] CID #13, debug for NULL type7 LSA should not print out data from it
2006-05-12 Paul Jakma <paul.jakma@sun.com>

	* ospf_lsa.c: (ospf_translated_nssa_refresh) Add non-assert
	  sanity check, in case DEBUG isn't defined.  Debug message
	  when no type7 exists should print the ID from the type5, not
	  the type7, fixes CID #13.
2006-05-12 23:11:14 +00:00
Paul Jakma
deb1561c18 [ospfd] CID #15, remove redundant NULL check in ism_change_state
2006-05-12 Paul Jakma <paul.jakma@sun.com>

	* ospf_ism.c: (ism_change_state) NULL check on oi->area is
	  useless, it's always valid. Only possibility where it
 	  couldn't be is if there is a race between abr_task and
	  cleaning up oi's, in which case a NULL check here isn't going
	  to do anything. Fixes CID #15.
2006-05-12 23:07:27 +00:00
Paul Jakma
bfd7c7dc06 [ospfd] CID #14, NULL check ospf->backbone before use, ospf_update_router_route
2006-05-12 Paul Jakma <paul.jakma@sun.com>

	* ospf_ia.c: (ospf_update_router_route) ospf->backbone could be
	  NULL when passed to ospf_find_asbr_route_through_area,
	  check for NULL first, CID #14.
2006-05-12 23:04:45 +00:00
Paul Jakma
6db3a6f75c [ospfd] CID #28, remove another ospf_lookup call - ospf_redistribute_withdraw
2006-05-12 Paul Jakma <paul.jakma@sun.com>

	* ospf_asbr.c: (ospf_redistribute_withdraw) remove ospf_lookup
	  call by taking the struct ospf * as argument, which the
	  caller has, fixing CID #28.
	* ospf_asbr.h: (ospf_redistribute_withdraw) update declaration
	* ospf_zebra.c: (ospf_redistribute_unset) update call to
	  ospf_redistribute_withdraw to match.
2006-05-12 23:02:46 +00:00
Paul Jakma
e43be0edb7 [ospfd] CID #27, fix missing NULL return check
2006-05-12 Paul Jakma <paul.jakma@sun.com>

	* ospf_interface.c: (ospf_if_exists) Fix missing NULL return
	  check on ospf_lookup, CID #27.
2006-05-12 23:00:06 +00:00
Paul Jakma
70461d7934 [ospfd] CID #29, fix missing NULL check by removing unused code.
2006-05-12 Paul Jakma <paul.jakma@sun.com>

	* ospf_lsa.c: (ospf_lsa_action) Get rid of the ospf_lookup
	  call, which is not checked for NULL return, by stripping out
	  functionality which is never used, hence fixing Coverity CID
	  #29.
	  (struct lsa_action) remove unused member.
2006-05-12 22:57:57 +00:00
Paul Jakma
4021b60aad [ospfd] Squash another ospf_lookup call
2006-05-11 Paul Jakma <paul.jakma@sun.com>

	* ospf_lsa.c: (ospf_default_originate_timer) Let the thread
	  take (struct ospf *) as thread argument, rather than (struct
	  ospf *)->default_originate, thus avoiding having to call
	  ospf_lookup.
	* ospf_zebra.c: (ospf_redistribute_default_set) change setup
	  of ospf_default_originate_timer thread to match.
	* ospfd.c: (ospf_router_id_update) ditto.
2006-05-12 22:55:41 +00:00
Paul Jakma
214a445437 [ospfd] Fix leak in area-range-cost command, CID #46.
2006-05-11 Paul Jakma <paul.jakma@sun.com>

	* ospf_abr.c: (ospf_area_range_cost_set) Shouldn't create a new
	  range, should just lookup to see if one exists, the new range
	  is just leaked. Fixes CID #46.
2006-05-12 22:51:49 +00:00