summaryrefslogtreecommitdiffstats
path: root/ospf6d
Commit message (Collapse)AuthorAgeFilesLines
...
| * ospf6d: fix linkdown handlingDinesh Dutt2013-11-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure OSPFv3 handles link down even correctly. OSPFv3 checks only the administrative status of a link instead of its operative status. This prevents it up from detecting a real link down event and reacting appropriately. Only protocol timer timeouts make it detect a link down eventually. This patch makes it look for the operative status of a link instead of admin status. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: James Li <jli at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: correct nexthop through directly connected networksDinesh Dutt2013-11-071-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is implementing this part of RFC 2328: This is the "first case", see below, 16.1.1. The next hop calculation ... If there is at least one intervening router in the current shortest path between the destination and the root, the destination simply inherits the set of next hops from the parent. Otherwise, there are two cases. In the first case, the parent vertex is the root (the calculating router itself). This means that the destination is either a directly connected network or directly connected router. The outgoing interface in this case is simply the OSPF interface connecting to the destination network/router. ... The current Quagga code always tries to inherit the nexthop from a parent vertex, but does not cover the case that the destination is directly connected to the root vertex. This patch adds support for that case. Signed-off-by: James Li <jli at cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: don't suppress empty router LSADinesh Dutt2013-11-071-29/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently in OSPFv3 implementation, if all the interfaces are down/loopback or are without any full adjacencies, the router LSA is suppressed. So for a router with only stub networks, no router LSA is generated. However, intra-prefix LSAs are generated for the stub networks and these intra-prefix LSAs will reference the router LSA. So the router LSA really should not be suppressed. It needs to be generated to be the starting vertex for SPF w.r.t the stub networks. Signed-off-by: James Li <jli at cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: turn off expensive debuggingDinesh Dutt2013-11-072-5/+5
| | | | | | | | | | | | | | | | | | OSPF6 has very expensive LSDB and route debug on by default. This needs to be turned off for scaled performance. Signed-off-by: James Li <jli at cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt at cumulusnetworks.com>Summary: Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: convert LSDB to use route_node, improve performanceDinesh Dutt2013-11-075-111/+78
| | | | | | | | | | | | | | | | | | | | | | the performance in the presence of a large number of LSAs. I also verified that the performance improvements stayed in the presence of a large number of peers (I tested upto 128). Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com>Summary: Reviewed-by: James Li <jli at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: fix neighbor state machine (faster lsdb sync, RFC compliance)Dinesh Dutt2013-11-074-44/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OSPFv3 code doesn't do the following things right as part of an adjacency bringup: - Transmit DbDesc frames appropriately to ensure faster state transition to Loading state - Transmit LsReq frames when switching to exchange state and on receipt of an LS update in Loading state - Requesting LSAs multiple times in LsReq. It currently uses retransmit timer expiry to send the LsReq and DbDesc frames which significantly slows down large lsdb syncs. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: add p2p interface supportDinesh Dutt2013-11-075-92/+256
| | | | | | | | | | | | | | | | Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Signed-off-by: Ayan Banerjee <ayabaner at gmail.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> Reviewed-by: James Li <jli at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: fix various bugs in installing and flooding LSAsDinesh Dutt2013-11-072-13/+10
| | | | | | | | | | | | | | Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: add more details to show ipv6 ospf6 dataDinesh Dutt2013-11-071-0/+5
| | | | | | | | | | | | | | | | | | Specifically, it displays the flags, lock and retransmission count fields. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: JR Rivers <jrrivers at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: enable the commands to support detailed debugging of LSAs.Dinesh Dutt2013-11-071-146/+31
| | | | | | | | | | | | | | | | | | The code for the commands exists, but it hasn't been defined in the definition of the command itself. This patch fixes that. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: remove older version of LSA from neigbor retx list before ↵Dinesh Dutt2013-11-071-0/+23
| | | | | | | | | | | | | | | | | | | | prematurely aging it. See comment in code for very detailed issue and fix. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: reinvoke MaxAge remover thread if not all MaxAge LSAs were flushed.Dinesh Dutt2013-11-073-21/+49
| | | | | | | | | | | | | | | | | | | | | | MaxAge LSAs are being flushed out only on an event, unlike OSPFv2 where they're flushed out periodically. This causes certain LSAs to hang around forever, never getting flushed out. This patch makes flushing out MaxAge LSAs periodic, retriggered after a certain period if not all MaxAge LSAs were flushed out. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: schedule SPF to run on events rather than directly on each event.Dinesh Dutt2013-11-076-23/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | OSPV3 SPF triggers on every SPF-able event instead of using timers the way OSPFv2 does. This patch makes SPF be triggered/throttled similar to OSPFv2. It adds a command to quagga identical to the OSPFv2 equivalent to configure these timers. Summary: Signed-off-by: Dinesh Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> [DL: removed reference to oa->ts_spf for rebase] [DL: killed timeval_subtract] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d/ospfd: refactor some common definesDinesh Dutt2013-10-2213-54/+36
| | | | | | | | | | | | | | | | | | Rearranging common defs and structures for use betweeen OSPFv2 and OSPFv3. Created a new file called libospf.h under lib directory to hold defines that are common between OSPFv2 and OSPFv3 code bases. [DL: split of defines refactor from timer refactor] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | security: Fix some typos and potential NULL-derefRemi Gacogne2014-02-111-1/+1
|/ | | | | | | | | This patch against the git tree fixes minor typos, some of them possibily leading to NULL-pointer dereference in rare conditions. Signed-off-by: Remi Gacogne <rgacogne-github@coredump.fr> Signed-off-by: Joachim Nilsson <troglobit@gmail.com> Acked-by: Feng Lu <lu.feng@6wind.com>
* 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>
* *: use array_size() helper macroBalaji.G2012-10-252-3/+2
| | | | | | | | 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>
* lib: improve fletcher checksum validationJR Rivers2012-10-253-35/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OVERVIEW The checksum used in OSPF (rfc2328) is specified in rc905 annex B. There is an sample implementation in rfc1008 which forms the basis of the quagga implementation. This algorithm works perfectly when generating a checksum; however, validation is a bit problematic. The following LSA (generated by a non-quagga implementation) is received by quagga and marked with an invalid checksum; however, it passes both the rfc905 and rfc1008 validation checks. static uint8_t lsa_10_121_233_29[] = { 0x0e, 0x10, 0x02, 0x03, 0x09, 0x00, 0x35, 0x40, 0x0a, 0x79, 0xe9, 0x1d, 0x80, 0x00, 0x00, 0x03, 0x00, 0x8a, 0x00, 0x1c, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x36, 0xb0 }; LS Type: Summary-LSA (IP network) LS Age: 3600 seconds Do Not Age: False Options: 0x02 (E) Link-State Advertisement Type: Summary-LSA (IP network) (3) Link State ID: 9.0.53.64 Advertising Router: 10.121.233.29 (10.121.233.29) LS Sequence Number: 0x80000003 LS Checksum: 0x008a Length: 28 Netmask: 255.255.255.224 Metric: 14000 You'll note that one byte of the checksum is 0x00; quagga would calculate the checksum as 0xff8a. It can be argued that the sourcing implementation generates an incorrect checksum; however, rfc905 indicates that, for 1's complement arithmetic, the value 255 shall be regarded as 0, thus either values are valid. EXPLANATION The quagga ospfd and ospf6d implementations operate by copying the PDU's existing checksum in a holding variable, calculating the checksum, and comparing the resulting checksum to the original. As a note, this implementation has the side effect of modifying the contents of the PDU. Evaluation of both rfc905 and rfc1008 shows that checksum validation should involve calculating the sum over the PDU and checking that both resulting C0 and C1 values are zero. This behavior is enacted in the rfc1008 implementation by calling encodecc with k = 0 (checksum offset); however, this functionality had been omitted from the quagga implementation. PATCH This patch adds the ability to call the quagga's fletcher_checksum() with a checksum offset value of 0xffff (aka FLETCHER_CHECKSUM_VALIDATE) which returns the sum over the buffer (a value of 0 indicates a valid checksum). This is similar to the mechanism in rfc1008 when called with k = 0. The patch also introduces ospf_lsa_checksum_valid(). ospf6d had it's own implementation of the fletcher checksum in ospf6_lsa_checksum(); it's the same algorithm as in fletcher_checksum(). This patch removes the local implementation in favor of the library's as well as creates and uses ospf6_lsa_checksum_valid(). quagga's ISIS implementation suffers from the same problem; however, I do not have the facilities to validate a fix to ISIS, thus this change has been left to the ISIS maintainers. The function iso_csum_verify() should be reduced to running the fletcher checksum over the buffer using an offset of 0. Signed-off-by: JR Rivers <jrrivers@cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com> Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com> Reviewed-by: Ayan Banerjee <ayan@cumulusnetworks.com> Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: fix segfault when requesting inexistant interfaces or areasVincent Bernat2012-07-101-4/+6
|
* ospf6d: add SNMP notifications/traps supportVincent Bernat2012-06-254-0/+78
| | | | Only implement ospfv3NbrStateChange and ospfv3IfStateChange.
* ospf6d: add SNMP support for ospfv3*LsdbTableVincent Bernat2012-06-251-89/+174
| | | | | | | This includes: - ospfv3AsLsdbTable - ospfv3AreaLsdbTable - ospfv3LinkLsdbTable
* ospf6d: add SNMP implementation of ospfv3IfTableVincent Bernat2012-06-253-1/+206
|
* ospf6d: complete SNMP implementation of ospfv3AreaTableVincent Bernat2012-06-253-2/+31
|
* ospf6d: complete SNMP implementation for scalar objectsVincent Bernat2012-06-251-0/+44
|
* ospf6d: add SNMP support for ospfv3NbrTableVincent Bernat2012-06-253-0/+167
|
* snmp: fix OSPFV3-MIB implementationVincent Bernat2012-06-252-2931/+4188
| | | | | | | | Use the real MIB from RFC 5643. Fix used ASN1 types. Indexes are not exported any more (they are "no access"). Fix some endian issues. Also, ID are just integers, not IPv4 addresses. No additional OID are supported in this commit.
* snmp: let handlers accept OID from a lesser prefixVincent Bernat2012-06-251-0/+8
| | | | | | | | | Most table handlers do not expect to be given an OID whose prefix is outside what they can handle. This is not a problem with the SMUX implementation since it always correct the OID such that the prefix matches. However, this is not the case for the AgentX implementation. A new function, smux_header_table() is used to do this normalization.
* build: use net-snmp-config to configure NetSNMPVincent Bernat2012-06-251-1/+1
| | | | | | | | The correct method to link to NetSNMP is to use net-snmp-config (which is like pkg-config). Explicit link to libcrypto is also dropped (NetSNMP libs are linked to libcrypto, no need to link Quagga to it). Moreover, @SNMP_INCLUDES@ is dropped because useless. Due to a bug in configure.ac, it was properly populated.
* build: only define HAVE_SNMPVincent Bernat2012-06-251-6/+0
| | | | | NetSNMP is the only SNMP implementation for Quagga. We don't need two different symbols.
* build: allow configure and build in a separate directoryVincent Bernat2012-06-251-1/+1
| | | | | | | | | | | 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
* ospf6d: remove defaults from iface config (BZ#550)Vyacheslav Trushkin2012-02-212-23/+45
|
* ospf6d: remove own routes on SIGTERM (BZ#448)Phil Laverdiere2012-02-213-1/+10
|
* ospf6d: fix out of bounds write in ospf6_prefix_apply_maskDavid Lamparter2012-02-111-5/+4
| | | | | | | | | | ospf6_prefix_apply_mask would write one byte beyond the 4/8/12 bytes allocated for prefixes of length 32/64/96. based on report and patch by Jon Andersson <jon.andersson@thales.no> Reported-by: Jon Andersson <jon.andersson@thales.no> Signed-off-by: David Lamparter <equinox@diac24.net>
* fix zebra protocol after MP-BGP changesDenis Ovsienko2012-01-231-0/+1
| | | | | | 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.
* ospf6d: ospf6_lsa_cmd_init() does not existDenis Ovsienko2012-01-081-1/+0
|
* ospf6d: fix compiler warning messagesVyacheslav Trushkin2012-01-021-4/+5
| | | | | | | | | * fix disagreement with C99 in zlog_debug calls Format specifier in some zlog_debug calls for size_t values was changed in order to C99 ('%u' -> '%zu'). * fix -Wsign-compare warnings Type of return value of ospf6_packet_max() was changed.
* ospf6d: add verifying user's privilegesVyacheslav Trushkin2012-01-021-0/+7
|
* ospf6d: always remove the result of a previous SPF calculationTom Goff2011-12-141-2/+2
| | | | | | | | | This is needed to avoid stale routes in some cases; the regression was introduced by commit 1d19234e79c77a7d55194b513f2a77c6a691bc2c. * ospf6_spf.c: (ospf6_spf_calculation) Call ospf6_spf_table_finish() before possibly returning if no router-LSA is found for the root of the SPF tree.
* ospf6d: decode message type with LOOKUP()Denis Ovsienko2011-12-132-15/+16
| | | | | | | | | | | * ospf6_message.h * OSPF6_MESSAGE_TYPE_CANONICAL(): dismiss * OSPF6_MESSAGE_TYPE_NAME(): dismiss * ospf6_message.c * ospf6_message_type_str: rewrite as a message list, add max value * ospf6_packet_examin(): update to use LOOKUP() * ospf6_receive(): idem * ospf6_send(): idem
* ospf6d: make some old sizing checks assertionsDenis Ovsienko2011-12-131-90/+13
| | | | | | | | | | | | | | | | | | | | | | | As long as ospf6_packet_examin() is now the single checkpoint for received packets, most of the old checks performed elsewhere can be converted into assert() constructs. Malformed input data at respective points can be attributed solely to a programming error, not a malformed packet. * ospf6_message.c * ospf6_hello_print() * ospf6_dbdesc_print() * ospf6_lsreq_print() * ospf6_lsupdate_print() * ospf6_lsack_print() * ospf6_hello_recv() * ospf6_dbdesc_recv_master() * ospf6_dbdesc_recv_slave() * ospf6_lsreq_recv() * ospf6_lsupdate_recv() * ospf6_lsupdate_recv() * ospf6_lsack_recv() * ospf6_receive()
* lib: put route_types.txt to real useDavid Lamparter2011-12-131-54/+21
| | | | | | | | | | | this replaces most occurences of routing protocol lists by preprocessor defines from route_types.h. the latter is autogenerated from route_types.txt by a perl script (previously awk). adding a routing protocol now is mostly a matter of changing route_types.txt and log.c. Conflicts: lib/route_types.awk
* build: delete .cvsignore filesDenis Ovsienko2011-12-131-15/+0
|
* quagga: option "-z" ("--socket <path>") addedVyacheslav Trushkin2011-12-131-1/+6
| | | | | | | | | | | All daemons modified to support custom path to zserv socket. lib: generalize a zclient connection zclient_socket_connect added. zclient_socket and zclient_socket_un were hidden under static expression. "zclient_serv_path_set" modified.
* ospf6d: justify multicast group managementVyacheslav Trushkin2011-12-133-82/+14
| | | | | | | | | | | * ospf6_network.[ch] * ospf6_sso(): new function supersedes ospf6_join_allspfrouters(), ospf6_leave_allspfrouters(), ospf6_join_alldrouters() and ospf6_leave_alldrouters() * ospf6_interface.c * ospf6_interface_state_change(): update respectively * interface_up(): ditto * interface_down(): ditto
* ospf6d: implement 'match interface' for route-mapsVyacheslav Trushkin2011-12-132-0/+91
| | | | | | | | ospf6_routemap_rule_match_interface* was imported from ospfd daemon with minor changes. new CLI options defined. `ospf6_routemap_rule_match_interface' was changed to support IPv6 (ospfv3) route's external information.
* ospf6d: fix compile warning from falling off end of mainStephen Hemminger2011-12-071-1/+1
| | | | | ospf6 main always calls ospf6_exit() which always calls exit. Use attributes to tell GCC that this is ok.
* ospf6d: check MTU with message header size in mindDmitrij Tejblum2011-11-171-9/+17
| | | | | | | | | * ospf6_message.c: (ospf6_packet_max): new function, return maximum IPv6 payload on an interface; (ospf6_hello_send, ospf6_dbdesc_send, ospf6_dbdesc_send_newone, ospf6_lsreq_send, ospf6_lsupdate_send_neighbor, ospf6_lsupdate_send_interface, ospf6_lsack_send_neighbor, ospf6_lsack_send_interface): compare message size with the maximum payload instead of the MTU.
* IPv6 transport class suppportStephen Hemminger2011-10-171-0/+9
| | | | | | | | | | | | | | | | | | | | | IPv6 supports the same concept of differentiated service for routing protocols as IPv4, but like too many things, the standards committee decided that having two names for the same thing wasn't good enough and introduced a third more generic term transport class. The socket option to set transport class works the same as IPv4, but the arguments are different. * lib/sockopt.[ch] * setsockopt_ipv6_tclass(): new function * bgpd/bgp_network.c * bgp_connect(): set socket option * bgp_listener(): set socket option * ospf6d/ospf6_network.c * ospf6_set_transport_class(): new function * ospf6_serv_sock(): set socket option * ripngd/ripngd.c * ripng_make_socket(): set socket option
* ospf6d: address more trivial compiler warningsDenis Ovsienko2011-09-273-2/+13
| | | | | | | * ospf6_main.c: include required headers * ospf6_asbr.h: idem * ospf6_spf.c * ospf6_spf_install(): remove unused variables
* ospf6d: spellingDenis Ovsienko2011-09-272-12/+12
|