summaryrefslogtreecommitdiff
path: root/ospf6d
AgeCommit message (Collapse)Author
2012-10-25*: use array_size() helper macroBalaji.G
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>
2012-10-25lib: improve fletcher checksum validationJR Rivers
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>
2012-07-10ospf6d: fix segfault when requesting inexistant interfaces or areasVincent Bernat
2012-06-25ospf6d: add SNMP notifications/traps supportVincent Bernat
Only implement ospfv3NbrStateChange and ospfv3IfStateChange.
2012-06-25ospf6d: add SNMP support for ospfv3*LsdbTableVincent Bernat
This includes: - ospfv3AsLsdbTable - ospfv3AreaLsdbTable - ospfv3LinkLsdbTable
2012-06-25ospf6d: add SNMP implementation of ospfv3IfTableVincent Bernat
2012-06-25ospf6d: complete SNMP implementation of ospfv3AreaTableVincent Bernat
2012-06-25ospf6d: complete SNMP implementation for scalar objectsVincent Bernat
2012-06-25ospf6d: add SNMP support for ospfv3NbrTableVincent Bernat
2012-06-25snmp: fix OSPFV3-MIB implementationVincent Bernat
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.
2012-06-25snmp: let handlers accept OID from a lesser prefixVincent Bernat
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.
2012-06-25build: use net-snmp-config to configure NetSNMPVincent Bernat
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.
2012-06-25build: only define HAVE_SNMPVincent Bernat
NetSNMP is the only SNMP implementation for Quagga. We don't need two different symbols.
2012-06-25build: allow configure and build in a separate directoryVincent Bernat
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
2012-02-21ospf6d: remove defaults from iface config (BZ#550)Vyacheslav Trushkin
2012-02-21ospf6d: remove own routes on SIGTERM (BZ#448)Phil Laverdiere
2012-02-11ospf6d: fix out of bounds write in ospf6_prefix_apply_maskDavid Lamparter
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>
2012-01-23fix zebra protocol after MP-BGP changesDenis Ovsienko
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.
2012-01-08ospf6d: ospf6_lsa_cmd_init() does not existDenis Ovsienko
2012-01-02ospf6d: fix compiler warning messagesVyacheslav Trushkin
* 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.
2012-01-02ospf6d: add verifying user's privilegesVyacheslav Trushkin
2011-12-14ospf6d: always remove the result of a previous SPF calculationTom Goff
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.
2011-12-13ospf6d: decode message type with LOOKUP()Denis Ovsienko
* 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
2011-12-13ospf6d: make some old sizing checks assertionsDenis Ovsienko
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()
2011-12-13lib: put route_types.txt to real useDavid Lamparter
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
2011-12-13build: delete .cvsignore filesDenis Ovsienko
2011-12-13quagga: option "-z" ("--socket <path>") addedVyacheslav Trushkin
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.
2011-12-13ospf6d: justify multicast group managementVyacheslav Trushkin
* 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
2011-12-13ospf6d: implement 'match interface' for route-mapsVyacheslav Trushkin
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.
2011-12-07ospf6d: fix compile warning from falling off end of mainStephen Hemminger
ospf6 main always calls ospf6_exit() which always calls exit. Use attributes to tell GCC that this is ok.
2011-11-17ospf6d: check MTU with message header size in mindDmitrij Tejblum
* 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.
2011-10-17IPv6 transport class suppportStephen Hemminger
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
2011-09-27ospf6d: address more trivial compiler warningsDenis Ovsienko
* ospf6_main.c: include required headers * ospf6_asbr.h: idem * ospf6_spf.c * ospf6_spf_install(): remove unused variables
2011-09-27ospf6d: spellingDenis Ovsienko
2011-09-27ospf6d: add lost lines to area config blockJon Andersson
* ospf6_area.c * ospf6_area_config_write(): write filter-list, import-list and export-list lines
2011-09-27ospf6d: fix crash on filter-list handling (BZ#530)Christian Hammers
This essentially merges the fix available from Debian build of Quagga. * ospf6_area.c * area_filter_list(): use correct argv indices * no_area_filter_list(): idem
2011-09-26ospf6d: CVE-2011-3323 (fortify packet reception)Denis Ovsienko
This vulnerability (CERT-FI #514840) was reported by CROSS project. ospf6d processes IPv6 prefix structures in incoming packets without verifying that the declared prefix length is valid. This leads to a crash caused by out of bounds memory access. * ospf6_abr.h: new macros for size/alignment validation * ospf6_asbr.h: idem * ospf6_intra.h: idem * ospf6_lsa.h: idem * ospf6_message.h: idem * ospf6_proto.h: idem * ospf6_message.c * ospf6_packet_minlen: helper array for ospf6_packet_examin() * ospf6_lsa_minlen: helper array for ospf6_lsa_examin() * ospf6_hello_recv(): do not call ospf6_header_examin(), let upper layer verify the input data * ospf6_dbdesc_recv(): idem * ospf6_lsreq_recv(): idem * ospf6_lsupdate_recv(): idem * ospf6_lsack_recv(): idem * ospf6_prefixes_examin(): new function, implements A.4.1 * ospf6_lsa_examin(): new function, implements A.4 * ospf6_lsaseq_examin(): new function, an interface to above * ospf6_packet_examin(): new function, implements A.3 * ospf6_rxpacket_examin(): new function, replaces ospf6_header_examin() * ospf6_header_examin(): sayonara * ospf6_receive(): perform passive interface check earliest possible, employ ospf6_rxpacket_examin()
2011-09-26ospf6d: CVE-2011-3324 (DD LSA assertion)Denis Ovsienko
This vulnerability (CERT-FI #514839) was reported by CROSS project. When Database Description LSA header list contains trailing zero octets, ospf6d tries to process this data as an LSA header. This triggers an assertion in the code and ospf6d shuts down. * ospf6_lsa.c * ospf6_lsa_is_changed(): handle header-only argument(s) appropriately, do not treat LSA length underrun as a fatal error.
2011-08-27ospf6d: add missing includeDenis Ovsienko
Two extern declarations in ospf6_abr.h are based on struct ospf6_route, which may not be available at the time ospf6_abr.h is included. This may lead to warnings after including ospf6_abr.h just for the structures defined in it.
2011-08-27ospf6d: move named constants to ospf6d.hDenis Ovsienko
2011-08-27ospf6d: justify some ABR debug codeDenis Ovsienko
* ospf6_abr.c * ospf6_abr_examin_summary(): only fill "buf" when it is used
2011-04-22ospf6d: copy "mtu-ignore" option from ospfdDmitrij Tejblum
"mtu-ignore" is an option ospfd used to mimic from the vendor's implementation, now ospf6d will also implement it. * ospf6_interface.h: extend ospf6_interface structure by one flag * ospf6_interface.c: (ipv6_ospf6_mtu_ignore, no_ipv6_ospf6_mtu_ignore): new declarations; (ospf6_interface_create): show initial value for consistency; (ospf6_interface_show): print flag status * ospf6_message.c: (ospf6_dbdesc_recv): consider interface-specific flag when checking MTU
2011-04-04ospf6d: fix crash if zebra_interface_state_read can't find interfaceIngo Flaschberger
* ospf6_zebra.c: (ospf6_zebra_if_state_update) zebra_interface_state_read may return NULL, if it can't find an interface, deal with it.
2011-03-21ospf6d: Extend the "[no] debug ospf6 route" vty commandsTom Goff
* ospf6_route.c ([no_]debug_ospf6_route) Include memory as a debug option. This allows ospf6 route memory debugging to be enabled or disabled interactively or from a config file.
2011-03-21ospf6d: Route locking (memory) cleanupTom Goff
* ospf6_route.c: (ospf6_route_best_next) Allows unlock route, even when there's no next route. This is consistent with how ospf6_route_next() behaves. * ospf6_intra.c: (ospf6_intra_prefix_lsa_remove) Make sure the last route considered is always unlocked. This is needed when the for loop terminates because ospf6_route_is_prefix() returns zero.
2011-03-21ospf6d: Have ospf6d cleanup when it terminates normallyTom Goff
A clean exit makes it easier to use memory debuggers. * ospf6_asbr.c: (ospf6_asbr_terminate) Add a function to do route map cleanup. * ospf6_lsa.c: (ospf6_lsa_terminate) Add a function to cleanup the lsa handler vector. * ospf6_main.c: (ospf6_exit) Add an function that causes ospf6d to gracefully exit. * ospf6_message.c: (ospf6_message_terminate) Add a function that frees the send and receive buffers. * ospf6_top.c: (ospf6_delete) Enable the ospf6_delete() function. Disable ospf6 before freeing everything.
2011-03-21ospf6d: Remove obsolete codeTom Goff
* ospf6_area.c: (ospf6_area_delete) Get rid of unused code that refers to a nonexistent function and structure member.
2011-03-21ospf6d: Fix memory allocation issues in SPFTom Goff
* ospf6_area.c: Call ospf6_spf_table_finish() before deleting the spf table. This ensures that the associated ospf6_vertex structures are also freed. * ospf6_spf.c: Only allocate a priority queue when a spf calculation is actually performed. Also defer calling ospf6_spf_table_finish().
2011-01-13ospf6d: fix crash in SPF calculationDmitrij Tejblum
* ospf6_spf.c: Don't replace a node with another node with a lower number of hops, instead get them from the queue in the correct order. (Actually, the replacement crashed the ospf6d daemon rather than worked.)
2010-04-28ospf6d: Fix crash when '[no] ipv6 ospf6 advertise prefix-list' is in ↵David Ward
startup-config * ospf6_interface.c: When '[no] ipv6 ospf6 advertise prefix-list' appears in the startup configuration for ospf6d, a crash occurs, because ospf6d attempts to schedule LSAs when the 'oi->area' structure has not yet been initialized. Now, when the command above is issued (either in the startup configuration or at runtime), ospf6d will only schedule LSAs if the 'oi->area' structure has been initalized. A similar test is already used when handling the commands 'ipv6 ospf6 priority' and 'ipv6 ospf6 cost'.