summaryrefslogtreecommitdiffstats
path: root/isisd/isis_pdu.c
Commit message (Collapse)AuthorAgeFilesLines
* isisd: make send_lsp more robustChristian Franke2015-12-081-34/+58
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Tested-by: NetDEF CI System <cisystem@netdef.org>
* isisd: fix misleading wording in logChristian Franke2015-12-081-5/+5
| | | | | | | | | The changed messages are actually located before transmission is attempted. Therefore, the tense is somewhat misleading, especially since transmission may not always succeed. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: handle lsp confusion (ISO/IEC 10589:2002 7.3.16.2)Christian Franke2015-12-081-5/+27
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: purge on correct levelChristian Franke2015-12-081-1/+1
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: allow to adjust lsp-mtuChristian Franke2015-12-081-27/+9
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: initialize circuit to match area is_typeChristian Franke2015-12-081-0/+14
| | | | | | | | | New circuits should be initialized to match the is_type of their area. Also add an additional check to make sure that no IIHs are sent for levels which are not enabled. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: fix a typo in a log messageChristian Franke2015-12-081-1/+1
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: annotate some function arguments with constChristian Franke2015-12-081-5/+5
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: Add new adjacency to LSP neighbor listAmritha Nambiar2015-09-031-1/+7
| | | | | | | | | | | | | | | | | | isis_pdu.c : New adjacency did not always get added to LSP neighbor list. The adjacencies that were created once minimum time allowed before LSP retransmission had surpassed, instantly got their LSP regenerated, but the adjacency circuit type was not set to IIH PDU circuit type before the LSP was regenerated , hence didn't pass the check for adjacency circuit type in lsp_build(), and the adjacency was not added to neighbor list. When a new adjacency is up, to build LSP with neighbor entry corresponding to the adjacency, set adjacency circuit type to circuit type from hello PDU header before new LSP is regenerated/built. This will result in the new adjacency entry getting added to the LSP neighbor list TLV. Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
* isisd: fix crash on processing own p2p helloAmritha Nambiar2015-05-051-0/+11
| | | | | | | | | | | | | | isis_pdu.c : isisd crashes if router's own p2p hello packets get processed thereby creating an adjacecncy with itself. Asserts at isis_find_vertex. So discard own p2p IIH PDU and avoid creating adjacency with self. This would also fix duplicate systemID on an interface. These checks already exists for IS-IS LAN Level 1/2 Hello PDU in process_lan_hello, but not for point-to-point IIH PDUs. Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: remove unused process_is_hello()David Lamparter2015-04-211-83/+0
| | | | | | | The code uses process_lan_hello() or process_p2p_hello(). The unused process_is_hello() seems to be a leftover generic version. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: fix size_t confusionsDavid Lamparter2015-04-211-8/+6
| | | | | | | isisd had a few places that mixed up size_t vs. unsigned long, and %zd vs. %ld. Clean out. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix signedness mix-upsDavid Lamparter2015-04-211-4/+4
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: match adjacency with source of hellosAmritha Nambiar2015-02-061-0/+11
| | | | | | | | | | | | | isis_pdu.c: match adjacency with source of hellos, check for source ID on receiving hello If an adjacency exists, check the adjacency is with the same router as the source of the hellos. In case a mismatch is detected, bring down the adjacency and let the next hellos trigger creating the new adjacency. Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* make some structures constant.Stephen Hemminger2014-11-031-1/+1
| | | | | | | These pre-initialized arrays are not modified. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Feng Lu <lu.feng@6wind.com>
* isisd: type mix-up in 28a8cfc "don't require IPv4"David Lamparter2014-08-181-2/+2
| | | | | | | | | | | Whoops, these are in6_addrs, not prefix_ipv6... funnily enough, it does the right thing either way, if it compiles, which it only does on Linux because IN6_IS_ADDR_LINKLOCAL contains a cast to the right type. On BSD there is no such cast, hence it explodes on trying to compile, trying to access struct members of in6_addrs while operating on prefix_ipv6... Fixes: 28a8cfc ("isisd: don't require IPv4 for adjacency") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: don't require IPv4 for adjacencyDavid Lamparter2014-08-181-10/+79
| | | | | | | | This was precluding isisd from IPv6-only operation; no adjacency would come up unless there was IPv4 in parallel. Reported-by: Martin Winter <mwinter@netdef.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: drop hellos without supported protocol listDavid Lamparter2012-12-121-5/+25
| | | | | | | | | | | isisd should not form adjacencies on receiving an IS-IS Hello without a list of supported protocols (cf. RFC 1195 s4.4 p32 "Maintaining Router Adjacencies") Also fixes memleaks in these error cases. * isisd/isis_pdu.c: improve TLVFLAG_NLPID handling Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Tested-by: Martin Winter <mwinter@opensourcerouting.org>
* isisd: refuse adjacencies with our own system IDDavid Lamparter2012-12-121-0/+7
| | | | | | | | | | | | | | | isisd would form an adjacency with another router despite the system IDs being identical. This would later cause an assertion failure like this: assertion=0x555555596db8 "isis_find_vertex (spftree->paths, id, vtype) == ((void *)0)", file=0x555555596c60 "isis_spf.c", line=515, function=0x555555597900 "isis_spf_add2tent") at log.c:619 which is caused by trying to add a path expected to not exist, but suddenly colliding due to the duplicate system ID. * isis_pdu.c: check for system ID collision on receiving Hello Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: don't overrun list of protocolsDavid Lamparter2012-10-251-2/+6
| | | | | | | | | | isisd currently has a list of supported protocols as a fixed array of size 4. this can be overran, leading to an overwrite of the ipv4_addrs pointer. * isisd/isis_pdu.c: don't accept more protocols than there's space for Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: fix null pointer dereference in send_lsp()Avneesh Sachdev2012-10-251-1/+13
| | | | | | | * isisd/isis_pdu.c: (send_lsp) Handle case where there are no LSPs on the LSP transmission queue. This can happen if, for instance, the queue is cleared because of protocol events before the send_lsp thread gets a chance to run.
* isisd: tighten checks on ISIS pdu lengthAvneesh Sachdev2012-10-251-5/+7
| | | | | | | | * isisd/isis_pdu.c: Fix problem where isisd would crash if it received a LAN IIH with the 'pdu length' field set to zero. Similar problems can occur in parsing other ISIS PDUs as well -- check that the PDU length in an ISIS hello, LSP or SNP packet is at least as big as the size of the respective fixed header.
* isisd: couple of bug fixesSubbaiah Venkata2012-04-071-44/+94
|
* isisd: add Google's changes to IS-ISJosh Bailey2012-04-071-490/+996
|
* lib: make some structures constantStephen Hemminger2009-12-211-1/+1
| | | | | | | | | | | | | * 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
* [ospfd/isisd] Switch to lib/ Fletcher checksum, fixing bug in isisdJingjing Duan2008-08-221-2/+3
| | | | | | | | | | 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>
* [isisd] Fix compiler warnings and allow v4-only compilationPaul Jakma2006-12-081-3/+3
| | | | | | | | | | | 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.
* [isisd] remove includes of common system headers.paul2005-11-201-2/+0
| | | | | | | | | | | 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.
* * *.c: Massive cleanup of lists loops. Stop abusing ALL_LIST_ELEMENTS.hasso2005-09-281-23/+21
| | | | | | Replace XMALLOC + memset with XCALLOC. Fix some indentation issues. The only really significant change is simplified isis_delete_adj function in isis_adjacency.c.
* * isis_lsp.c, isis_pdu.c, isis_spf.c: Remove some old unused code.hasso2005-09-191-101/+0
|
* * isis_lsp.c (lsp_update): Remove LSP from database before updatinghasso2005-09-161-2/+3
| | | | | | 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.
* * *.c: Try to be less verbose by default (without any debug optionshasso2005-09-041-9/+13
| | | | | | | on). * isis_lsp.c (lsp_build_nonpseudo): Use stream_reset() instead of touching endp directly. * isis_lsp.c (lsp_build_pseudo): Ditto.
* * random.c, spgrid.[ch]: Fix warnings with hope that I didn't brokehasso2005-09-011-6/+14
| | | | | | | | | 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-05-03 Paul Jakma <paul@dishone.st>paul2005-05-031-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (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-04-07 Paul Jakma <paul.jakma@sun.com>quagga_post_listloop_cleanuppaul2005-04-071-34/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (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-02-09 Paul Jakma <paul.jakma@sun.com>paul2005-02-091-10/+9
| | | | | | | | | | | | | * (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.
* * *.c: Changed many functions to static. Some commented outhasso2005-01-181-17/+18
| | | | functions and some tiny related fixes. No functional changes.
* Make authentication of SNPs work correctly - ie. conditionally like it is inhasso2005-01-011-26/+23
| | | | IOS.
* zlog_* cleanup. Level of debug messages to LOG_DEBUG.hasso2004-12-241-113/+113
|
* No warnings here any more.hasso2004-10-071-0/+3
|
* This code didn't survive valgrinding. I wonder how it survived normal run.hasso2004-09-271-0/+3
|
* Compiler warnings fixes.hasso2004-09-261-3/+3
|
* 2004-09-20 LIU Xin <lx at ns.6test.edu.cn>hasso2004-09-201-30/+16
| | | | | | | * 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.
* Second part of fixes from Laurent Rabret.hasso2004-09-151-15/+15
|
* isis_pdu.c: Update l1_desig_is only if neighbor really is DIS.hasso2004-09-141-4/+6
|
* Fixes from LIU Xin.hasso2004-09-101-2/+4
|
* Indentation only. No any functional changes.hasso2004-09-101-1335/+1575
|
* Make it compile in NetBSD and OpenBSD.hasso2004-05-191-1/+0
|
* Threads usage cleanup. Still at least one bug to go.hasso2004-02-111-43/+20
|
* Initial revisionjardin2003-12-231-0/+2478