summaryrefslogtreecommitdiffstats
path: root/isisd
Commit message (Collapse)AuthorAgeFilesLines
* isisd: always print adj->sysid (clang 3.6 warning)David Lamparter2015-05-271-7/+1
| | | | | | | | | | | As any new compiler version, clang 3.6 has new warnings, one of these being that it now warns for testing whether the address of an array will be true. Of course there is no point in this check for the sysid, so let's always just print the sysid. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* 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>
* build: add --enable-werrorDavid Lamparter2015-04-211-1/+1
| | | | | | | | | | | | | | | This allows enabling -Werror in a consistent way. Note that this is different from just specifiying it in CFLAGS, since that would either break configure tests (if done on ./configure), or would override configure's CFLAGS (if done on make). Using --enable-werror instead provides a new WERROR variable that is additionally used during make with a consistent set of warning flags. The tests/ directory is exempt. (Rationale being, better to have more tests than pedantically complain about them.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra, isisd: cast to unsigned char for ctypesDavid Lamparter2015-04-211-1/+1
| | | | | | | | ctype.h macros take int as arguments, but expect arguments to be in unsigned char's range. Even though it probably works, this isn't correct on systems that have a signed char type. Cast explicitly. 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>
* isisd: assorted fixes (unused variables, static)David Lamparter2015-04-215-13/+8
| | | | | | This just mops up a few warnings in isisd. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: fix minor & vs. && mix-upDavid Lamparter2015-04-211-1/+1
| | | | | | apparently we were displaying all IPv6 reachabilities as external. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: don't use POSIX reserved y1/yn namesDavid Lamparter2015-04-211-12/+12
| | | | | | | y1 and yn are POSIX standard names for Bessel functions. For consistency, just rename all of these variables from "y" to "yy". Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: add missing includesDavid Lamparter2015-04-211-0/+2
| | | | | | | Some places, particularly headers, were spewing warnings since they don't include neccessary other headers to get struct/enum definitions. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix signedness mix-upsDavid Lamparter2015-04-214-10/+11
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: remove stray extra semicolonsDavid Lamparter2015-04-211-4/+4
| | | | | | Some places had extra semicolons where none belong. Remove them. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use void * for printing pointersDavid Lamparter2015-04-211-2/+2
| | | | | | | | | On higher warning levels, compilers expect %p printf arguments to be void *. Since format string / argument warnings can be useful otherwise, let's get rid of this noise by sprinkling casts to void * over printf calls. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use long long to print time_tDavid Lamparter2015-04-193-7/+9
| | | | | | | | | | | | Since we can't assume time_t to be long, int, or even long long, this consistently uses %lld/long long (or %llu/unsigned long long in a few cases) to print time_t/susecond_t values. This should fix a bunch of warnings, on NetBSD in particular. (Unfortunately, there seems to be no "PRId64" style printing macro for time_t...) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* build: get rid of INCLUDES, use AM_CPPFLAGSDavid Lamparter2015-02-142-5/+2
| | | | | | | | | | | | INCLUDES in configure.ac was not used at all, and INCLUDES in Makefile.am is supposed to be AM_CPPFLAGS these days. Reduces warnings spewed during bootstrap/autoreconf. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Feng Lu <lu.feng@6wind.com> Acked-by: Paul Jakma <paul@jakma.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>
* isisd: fix crash on changing the circuit type of a passive interfaceLu Feng2015-02-061-19/+22
| | | | | Signed-off-by: Feng Lu <lu.feng@6wind.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>
* *: fix detection and usage of sys/cdefs.hTimo Teräs2014-08-181-1/+1
| | | | | | | | | | | | This header is non-standard (though present on many systems) and there is no standard for what it should or should not define. Remove it where it is not really needed. But add also a configure check, so it can be used if available but otherwise fallback to defining the needed macroes. Signed-off-by: Timo Teräs <timo.teras@iki.fi> 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: ignore the unrecognized TLVsLu Feng2014-06-031-1/+0
| | | | | | | | | | | | When processing LSPDUs, the unrecognized TLVs/sub-TLVs should be silently ignored. In parse_tlvs(), ISIS_WARNING is returned once an unrecognized TLV exists. It breaks the processing in lsp_authentication_check() and lsp_update_data(). So remove it. Signed-off-by: Feng Lu <lu.feng@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib/command.c: rewrite command matching/parsingChristian Franke2014-04-011-2/+0
| | | | | | | | | | Add support for keyword commands. Includes new documentation for DEFUN() in lib/command.h, for preexisting features as well as new keyword specification. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd, ospf6d: use bug-report information from autoconfChristian Franke2013-07-311-1/+1
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: fix ipv6 metric endiannessNick Hilliard2012-12-121-1/+1
| | | | | | | | | | the isis ipv6 reachability metric is transmitted in big endian / network format, but isis_spf_process_lsp() does not convert this into host endian format when mucking around with local cost + received metric. This patch fixes this problem and makes received ipv6 metrics work properly on little-endian machines. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: verify metrics on metric-style transitionChristian Franke2012-12-121-8/+11
| | | | | | | | When switching to metric-style transition, circuit metrics should also be verified to be in the narrow range 0..63. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: fix metrics check for metric-style narrowChristian Franke2012-12-121-2/+2
| | | | | | | | | | When switching to narrow metric style, all configured circuits are verified to have a valid narrow style metric. Check te_metric instead of metric_default as the latter is only 8bit wide and may overflow for wide style metrics. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: address Coverity warningsDavid Lamparter2012-12-129-7/+19
| | | | | | | | | | | | | | | | | this fixes a bunch of issues found by Coverity SCAN and flagged as "high" impact -- although, they're all rather minute issues. * isisd/isis_adjacency.c: one superfluous check, one possible NULL deref * isisd/isis_circuit.c: two prefix memory leaks * isisd/isis_csm.c: one missing break * isisd/isis_lsp.c: one possible NULL deref * isisd/isis_pfpacket.c: one error-case fd leak * isisd/isis_route.c: one isis_route_info memory leak * isisd/isis_routemap.c: one... fnord * isisd/isis_tlv.c: one infinite loop Reported-by: Coverity SCAN Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: always join all IS-IS multicast groupsDavid Lamparter2012-12-122-14/+8
| | | | | | | | | | | | | | | The socket is only created once when an interface is brought up, and the multicast groups were joined according to configuration at that point. This breaks when later switching an interface to another IS-IS level. Since, for a separate conformance issue (ANVL ISIS-6.4), we should be inspecting the destination address anyway, the simplest fix here is to just join all groups unconditionally. There shouldn't be much traffic on these anyway, worst case we might be picking up some unrelated multicast groups due to NIC filter aliasing though... Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Tested-by: Martin Winter <mwinter@opensourcerouting.org>
* isisd: save metric-style narrowChristian Franke2012-12-121-0/+5
| | | | | | | | | isisd defaults to wide metric style. So if narrow metric style is configured, a matching setting should be written to the configuration, allowing a narrow metric-style setting to be saved. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: fix spftree_area_del typo causing SEGVDavid Lamparter2012-12-121-1/+1
| | | | | | | | spftree_area_del didn't clear the IPv6 L2 spftree due to a simple typo, leading to a SEGV on shutdown when the still-armed timer would try to run an IPv6 L2 SPF calculation with its data free'd already. 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: do not add >63 IP addresses to helloDavid Lamparter2012-12-121-4/+3
| | | | | | | | | | | RFC1195 s4.2 "Multiple IP Addresses per Interface" explicitly forbids us from adding multiple tuples of IP addresses, putting a hard cutoff at 63 IP addresses. * isisd/isis_tlv.c: cut off (and return success) at 63 addrs. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Tested-by: Martin Winter <mwinter@opensourcerouting.org>
* isisd: clock_gettime() -> quagga_gettime() conversion.Hasso Tepper2012-11-051-5/+5
| | | | | | | * isisd/isis_spf.c: Use portable quagga_gettime() like the rest of the Quagga code. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use array_size() helper macroBalaji.G2012-10-251-1/+1
| | | | | | | | Use the array_size() helper macro. Replaces several instances of local macros with the same definition. Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com> 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: don't process invalid prefixes from TLVsDavid Lamparter2012-10-251-9/+25
| | | | | | | | | | | it's possible to feed invalid prefixes (1.2.3.4/40 or dead::beef/200) on IS-IS. if this is not checked, it will later cause an assert in processing. let's simply abort processing the TLV if the prefix is invalid. * isisd/isis_tlv.c: check prefix lengths for validity Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: pull up invalid prefix assert()David Lamparter2012-10-251-0/+4
| | | | | | | | | | processing invalid prefixes causes isisd to assert() or otherwise misbehave in ip_masklen/apply_mask. pull up the assert() to indicate better there's broken data in isisd's LSDB. * isisd/isis_spf.c: assert() prefix lengths 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.
* build: allow configure and build in a separate directoryVincent Bernat2012-06-252-2/+2
| | | | | | | | | | | Some .h files in lib/ are autogenerated. The search path should include the build directory and the source directory. They usually match but sometimes, they may be different. For example: $ mkdir build $ cd build $ ../configure $ make
* isisd: fix typo in topology generator (BZ#731)David Lamparter2012-06-211-1/+1
| | | | | | | | There was a "lsp->" missing before "level" in line 2416. (introduced by git commit e38e0df) Reported-by: Seblu <seblu@seblu.net> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* quagga: option "-z" ("--socket <path>") addedVyacheslav Trushkin2012-04-161-1/+7
| | | | | | | All daemons modified to support custom path to zserv socket. [reapplied from b511468 after isisd merge]
* isisd: indent longopts arrayVyacheslav Trushkin2012-04-161-9/+9
|
* isisd: reapply removal of CVS cruftDavid Lamparter2012-04-164-27/+0
| | | | | | this re-removes CVS keywords and .cvsignore files. original commits: b82cdeb delete CVS keywords 05e54ee build: delete .cvsignore files
* isisd: reapply patch to fix zebra protocolAvneesh Sachdev2012-04-111-0/+5
| | | | | | | | | | | | | | | Reapply the bits of revision b4e45f6 that pertain to isisd. That is: git log -n 1 -p b4e45f6 -- isisd These were dropped in the merge with the Google ISIS code (14d2bbaa). The commit message for b4e45f6 is: fix zebra protocol after MP-BGP changes The previous commits modified both zebra and bgpd for additional SAFI field, but not any other routing daemon, which led to zebra daemon crashing with failed assertion.
* isisd: couple of bug fixesSubbaiah Venkata2012-04-0713-215/+348
|
* isisd: add Google's changes to IS-ISJosh Bailey2012-04-0736-3718/+6620
|
* isisd: change ISIS_METHOD to use C preprocessorDavid Lamparter2010-04-284-8/+12
| | | | | | 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)