Commit Graph

34 Commits

Author SHA1 Message Date
Fritz Reichmann
e6b03b7776 isisd: implement MD5 circuit authentication
* Replace command "isis passwd" with "isis passwd {clear|md5}"
* Verify HMAC MD5 on ISIS Hello PDUs
* Add HMAC MD5 authentication to md5.h/md5.c from RFC2104
2012-02-14 03:06:36 +04:00
Fritz Reichmann
c25eaffdb2 isisd: unexpected kernel routing table (BZ#544)
Fix bug 544: isisd produces an unexpected routing table for wide-metric.

* isis_spf.c: Accept VTYPE_PSEUDO_TE_IS and VTYPE_NONPSEUDO_TE_IS
  vertex types for SPF calculation
* isis_pdu.c: Change order of TLVs to match Cisco to make bitwise
  comparison easier for Wireshark
* isis_tlv.c: EXTREME_TLV_DEBUG for TLV debugging instead of
  EXTREME_DEBUG
2012-02-14 03:06:29 +04:00
Peter Szilagyi
d034aa027e isisd: fix wrong next-hops from SPF
The forwarding table was filled with wrong next-hops, and which is even
worse, it was done in a totally non-deterministic way.

The next-hop set for an IP prefix by isisd was the neighbor IS from
which the flooded LSP about the IP prefix was arrived. So, if an IS
received all the LSPs through its, say, eth0 interface, all entries
in the forwarding table contained the next IS reachable via eth0 as
the next-hop.

The solution is to propagate the correct next-hop further from node to
node as the SPF algorithm traverses the graph and selects the next
node to be added to the set of already covered nodes.

Also, the construction of the tentative node list (the nodes where the
shortest path is not known yet) was buggy: if a node was already a
member of this list with a certain path cost, and an alternative path
was found to it with a lower cost while processing a pseudo-node LSP,
it was not added to the list. This way, the path selected by isisd for
a certain prefix was the first one it encountered during the LSDB
processing.

Signed-off-by: Fritz Reichmann <fritz@reichmann.nl>
2012-02-14 03:06:17 +04:00
Peter Szilagyi
907fd95e50 isisd: send proper LSP after DIS election
After an IS has been elected as the Designated IS for a LAN, it did
not refresh the content of the pseudo-node after a new node has been
connected to the same LAN. Instead, the periodically reoriginated
pseudo-node LSP still contained only those IS neighbors that were
already present when the DIS election process was commenced.

The fix for the problem schedules an LSP regeneration rather than
just reoriginating the same LSP with the old content.

Signed-off-by: Fritz Reichmann <fritz@reichmann.nl>
2012-02-14 03:06:09 +04:00
Peter Szilagyi
7fd6cd819f isisd: fix circuit state machine
isisd has a so-called circuit state machine that takes care about
the interface state changes, such as initializing, down, up. When
an interface was brought down by a link failure, the interface
information was deleted and set to NULL. When the link was restored
later, the interface was looked up by the old pointer, but since it
was cleared, it was never found again, resulting in an interface
never entering the up state again.

Also, the program regularly crashed because of a deleted pointer in
the same context which was later accessed without any further
checking.

Signed-off-by: Fritz Reichmann <fritz@reichmann.nl>
2012-02-14 03:06:00 +04:00
Peter Szilagyi
306ca83213 isisd: include hash.h, not hash.c 2011-09-27 20:50:17 +04:00
Fritz Reichmann
8998075956 isisd: raise hello rate for DIS (BZ#539)
* isis_pdu.c: Divide hello interval by three, depending if we are DIS or
  not.
2011-09-27 20:49:26 +04:00
Fritz Reichmann
5574999e59 isisd: fix crash on "no router isis" (BZ#536)
The crash is due to threads accessing data that gets destroyed
during the removal of the configuration.

* isis_circuit.c: Destroy adjacencies to stop adjacency expiry thread.
  Stop PSNP threads.
* isisd.c: Change state of circuit back to INIT and reassign the
  circuit structure to isis->init_circ_list rather than destroying
  the circuit data structure. Stop SPF threads. Stop LSP generation
  threads.
* isisd.h: Add pointers to LSP threads into area structure in order to
  stop them in isisd.c
* isis_lsp.c: Store pointer to LSP thread in area structure.
* isis_pdu.c: Stop PDU generation for a circuit with a removed area.
* isis_pfpacket.c: Stop processing received PDUs for a circuit with a
  removed area.
2011-09-27 20:48:43 +04:00
Stephen Hemminger
2d362d1099 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
2009-12-21 13:03:51 +03:00
Jingjing Duan
6a270cd93d [ospfd/isisd] Switch to lib/ Fletcher checksum, fixing bug in isisd
2008-08-13 Jingjing Duan <Jingjing.Duan@sun.com>

	* ospfd/: Remove the old checksum implementation and
	  use the consolidated version.
	* isisd/: ditto, thus fixing isisd checksuming on big-endian.

Signed-off-by: Paul Jakma <paul@quagga.net>
2008-08-22 19:52:57 +01:00
Paul Jakma
41b36e9013 [isisd] Fix compiler warnings and allow v4-only compilation
2006-12-08 Hannes Gredler <hannes@gredler.at>

	* isis_adjacency.c: (isis_new_adj) Allow NULL snpa argument.
	* isis_pdu.c: (various) Update calls to isis_new_adj() to pass
	  NULL and use default.
	* (general) Add forward declarations where required.
	  Fix up const char *'s.
	  Allow V4-only compilation.
2006-12-08 01:09:50 +00:00
paul
77b1cffe3b [isisd] remove includes of common system headers.
2005-11-20 Paul Jakma <paul.jakma@sun.com>

        * (general) remove includes of very common system headers,
          these are already picked up by zebra.h. Further, including
          them before zebra.h messes up all our lovely (sarcasm)
          autoconf'd detecting of platform specific things. Recent
          addition of stdint.h to configure.ac and zebra.h appears
          particularly to throw up this problem.
2005-11-20 02:15:50 +00:00
hasso
3fdb2dd9dd * *.c: Massive cleanup of lists loops. Stop abusing ALL_LIST_ELEMENTS.
Replace XMALLOC + memset with XCALLOC. Fix some indentation issues.
	  The only really significant change is simplified isis_delete_adj
	  function in isis_adjacency.c.
2005-09-28 18:45:54 +00:00
hasso
f06834b805 * isis_lsp.c, isis_pdu.c, isis_spf.c: Remove some old unused code. 2005-09-19 10:44:04 +00:00
hasso
a96d8d1095 * isis_lsp.c (lsp_update): Remove LSP from database before updating
its data and put it back after. Database entry MUST contain at least
	  correct pointers to the sysid to get correct compare results.
	* isis_lsp.[ch], isis_pdu.c: Pass level to the lsp_update() function.
2005-09-16 14:44:23 +00:00
hasso
c89c05dd04 * *.c: Try to be less verbose by default (without any debug options
on).
	* isis_lsp.c (lsp_build_nonpseudo): Use stream_reset() instead of
	  touching endp directly.
	* isis_lsp.c (lsp_build_pseudo): Ditto.
2005-09-04 21:36:36 +00:00
hasso
29e50b2353 * random.c, spgrid.[ch]: Fix warnings with hope that I didn't broke
anything. These floats to longs and vice versa casts are starnge
	  indeed.
	* isis_pdu.c: As we don't use %z for size_t for now because we support
	  older compilers, cast them to unsigned long.

	Also fix previous changelog entry. Isisd compiles cleanly now again.
2005-09-01 18:18:47 +00:00
paul
15935e9ae1 2005-05-03 Paul Jakma <paul@dishone.st>
* (general) More cleaning up of stream abuse, isisd should be
	  back to previous functionality. Replace various XMALLOC+memset's
	  with XCALLOC
	* isis_tlv.c: (tlv_add_padding) use stream_put to clear the stream
	  rather than forward endp, as isisd reuses streams.
	* isis_pdu.c: (process_lsp) cleanup direct reference to stream endp
	  (send_lsp) manual copy of a stream cleaned up to use stream_copy.
	* isis_network.c: (isis_recv_pdu_bcast) replace direct memcpy with
	  stream_write
	  (isis_recv_pdu_p2p) replace recvfrom directly into stream with
	  stream_recvfrom. Remove dangerous and now unneeded manual update
	  of endp.
	  (isis_recv_pdu_bcast / non-GNU_LINUX) Replace direct memcpy with
	  stream_write.
	  (isis_recv_pdu_p2p) replace read direct into stream with
	  stream_read_try, and hence remove the manual update of endp.
	* isis_lsp.c: (lsp_update_data) manual stream dup replaced with
	  stream_dup.
	  (lsppdu_realloc) mempcy into stream data replaced with stream_put.
	  (lsp_build_nonpseudo) remove mysterious stream_forward_endp's -
	  which were originally stream_set_putp - shouldn't be needed
	  now that all the manual fiddling of private stream data has been
	  corrected.
	  (build_topology_lsp_data) remove unneeded twiddling of endp,
	  appears to be due to lsppdu_realloc(), but it appears to sort of
	  do the right thing wrt streams.
2005-05-03 09:27:23 +00:00
paul
1eb8ef2584 2005-04-07 Paul Jakma <paul.jakma@sun.com>
* (global): Fix up list loops to match changes in lib/linklist,
	  and some basic auditing of usage.
	* configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES
	* HACKING: Add notes about deprecating interfaces and commands.
	* lib/linklist.h: Add usage comments.
	  Rename getdata macro to listgetdata.
	  Rename nextnode to listnextnode and fix its odd behaviour to be
	  less dangerous.
	  Make listgetdata macro assert node is not null, NULL list entries
          should be bug condition.
          ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use
          with for loop, Suggested by Jim Carlson of Sun.
          Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the
          "safety" of previous macro.
	  LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to
	  distinguish from the similarly named functions, and reflect their
	  effect better.
	  Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section
	  with the old defines which were modified above,
	  for backwards compatibility - guarded to prevent Quagga using it..
	* lib/linklist.c: fix up for linklist.h changes.
	* ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single
	  scan of the area list, rather than scanning all areas first for
	  INTER_ROUTER and then again for INTER_NETWORK. According to
	  16.2, the scan should be area specific anyway, and further
	  ospf6d does not seem to implement 16.3 anyway.
2005-04-07 07:30:20 +00:00
paul
9985f83ce7 2005-02-09 Paul Jakma <paul.jakma@sun.com>
* (global) Update code to match stream.h changes.
	  stream_get_putp effectively replaced with stream_get_endp.
	  stream_forward renamed to stream_forward_getp.
	  stream_forward_endp introduced to replace some previous
	  setting/manual twiddling of putp by daemons.
	* lib/stream.h: Remove putp. Update reference to putp with endp.
	  Add stream_forward_endp, which daemons were doing manually.
	  Rename stream_forward to stream_forward_getp.
	  lib/stream.c: Remove/update references to putp.
	  introduce stream_forward_endp.
2005-02-09 15:51:56 +00:00
hasso
92365889d1 * *.c: Changed many functions to static. Some commented out
functions and some tiny related fixes. No functional changes.
2005-01-18 13:53:33 +00:00
hasso
1cbc562b0c Make authentication of SNPs work correctly - ie. conditionally like it is in
IOS.
2005-01-01 10:29:51 +00:00
hasso
529d65b3db zlog_* cleanup. Level of debug messages to LOG_DEBUG. 2004-12-24 00:14:50 +00:00
hasso
1cd80845dc No warnings here any more. 2004-10-07 20:07:40 +00:00
hasso
e082ac1dc6 This code didn't survive valgrinding. I wonder how it survived normal run. 2004-09-27 18:13:57 +00:00
hasso
f7c43dcbbc Compiler warnings fixes. 2004-09-26 16:24:14 +00:00
hasso
a211d65dfd 2004-09-20 LIU Xin <lx at ns.6test.edu.cn>
* isis_dr.c, isis_events.c: Remove hello multiplier usage while scheduling
  DIS election.
* isis_pdu.c: Don't call isis_event_dis_status_change() whenever
  l[1|2]_desig_is is different from hdr.lan_id.
2004-09-20 14:55:29 +00:00
hasso
53c997c90d Second part of fixes from Laurent Rabret. 2004-09-15 16:21:59 +00:00
hasso
64a7afd6de isis_pdu.c: Update l1_desig_is only if neighbor really is DIS. 2004-09-14 11:05:13 +00:00
hasso
13c48f7280 Fixes from LIU Xin. 2004-09-10 21:19:13 +00:00
hasso
f390d2c783 Indentation only. No any functional changes. 2004-09-10 20:48:21 +00:00
hasso
37da8c0114 Make it compile in NetBSD and OpenBSD. 2004-05-19 11:38:40 +00:00
hasso
d70f99e15b Threads usage cleanup. Still at least one bug to go. 2004-02-11 20:26:31 +00:00
jardin
eb5d44eb8d Initial revision 2003-12-23 08:09:43 +00:00