summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_packet.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'quagga_0_99_20_1_release' into euro_ix_bex22bChris Hall2012-03-221-118/+434
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v0.99.20ex22b Conflicts: bgpd/bgp_open.c bgpd/bgp_packet.c The bpp_open.c code has been replaced by code in bgp_open_state.c, so these changes have no effect on the euro_ix branch, which already rejects invalid OPEN with a NOTIFY. Otherwise: modified: ospfd/ospf_dump.c modified: ospfd/ospf_dump.h modified: ospfd/ospf_lsa.h modified: ospfd/ospf_packet.c modified: ospfd/ospf_packet.h
| * ospfd: reduce ospf_verify_header()Denis Ovsienko2012-03-121-15/+6
| | | | | | | | | | Protocol version checks fits ospf_packet_examin() better (like it is implemented in ospf6d), and packet type check is already there.
| * ospfd: bring ospf_check_auth() into focusDenis Ovsienko2012-03-121-70/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old ospf_check_auth() function did two different jobs depending on AuType. For Null and Simple cases it actually authenticated the packet, but for Cryptographic case it only checked declared packet size (not taking the actual number of bytes on wire into account). The calling function, ospf_verify_header(), had its own set of MD5/checksum checks dispatched depending on AuType. This commit makes the packet size check work against the real number of bytes and moves it to ospf_packet_examine(). All MD5/checksum verification is now performed in ospf_check_auth() function. * ospf_packet.c * ospf_packet_examin(): check length with MD5 bytes in mind * ospf_verify_header(): remove all AuType-specific code * ospf_check_auth(): completely rewrite
| * ospfd: fix packet length check for auth/LLS casesDenis Ovsienko2012-03-121-5/+5
| | | | | | | | | | | | | | | | | | | | An OSPFv2 packet with trailing data blocks (authentication and/or link-local signaling) failed the recently implemented packet length check, because trailing data length isn't counted in the packet header "length" field. This commit fixes respective check conditions. * ospf_packet.c * ospf_packet_examin(): use "bytesdeclared" instead of "bytesonwire"
| * ospfd: introduce ospf_lsa_minlen[] (BZ#705)Denis Ovsienko2012-03-121-1/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit ports more packet checks to OSPFv2, in particular, LSA size verification and Router-LSA link blocks verification. * ospf_lsa.h: add LSA size macros * ospf_packet.h: add struct ospf_ls_update * ospf_packet.c * ospf_lsa_minlen[]: a direct equivalent of ospf6_lsa_minlen[] * ospf_router_lsa_links_examin(): new function, verifies trailing part of a Router-LSA * ospf_lsa_examin(): new function like ospf6_lsa_examin() * ospf_lsaseq_examin(): new function like ospf6_lsaseq_examin() * ospf_packet_examin(): add type-specific deeper level checks
| * ospfd: review ospf_check_md5_digest()Denis Ovsienko2012-03-121-15/+5
| | | | | | | | | | Rewrite some pointer arithmetics without the additional variables and move byte order conversion inside the function.
| * ospfd: review ospf_check_auth()Denis Ovsienko2012-03-121-4/+3
| | | | | | | | | | | | | | | | | | 1. The only purpose of "ibuf" argument was to get stream size, which was always equal to OSPF_MAX_PACKET_SIZE + 1, exactly as initialized in ospf_new(). 2. Fix the packet size check condition, which was incorrect for very large packets, at least in theory.
| * ospfd: introduce ospf_packet_minlen[] (BZ#705)Denis Ovsienko2012-03-121-9/+56
| | | | | | | | | | | | | | | | | | | | | | | | This commit ports some of the OSPFv3 packet reception checks to OSPFv2. * ospf_packet.c * ospf_packet_minlen[]: a direct equivalent of ospf6_packet_minlen[] * ospf_packet_examin(): new function designed after the first part of ospf6_packet_examin() * ospf_read(): verify received packet with ospf_packet_examin() * ospf_packet.h: add convenience macros
| * ospfd: fix ospf_packet_add_top() to use LOOKUP()Denis Ovsienko2012-03-121-1/+1
| |
| * ospfd: use LOOKUP() for ospf_packet_type_strDenis Ovsienko2012-03-121-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * ospf_packet.h: add proper str/max extern declarations * ospf_packet.c * ospf_packet_type_str: rewrite in "struct message", add max value * ospf_packet_add(): use LOOKUP() * ospf_write(): ditto * ospf_hello(): ditto * ospf_read(): ditto * ospf_dump.h: the declaration does not belong here * ospf_dump.c * ospf_header_dump(): use LOOKUP() * show_debugging_ospf(): ditto
* | Merge Quagga master branch -- as of 1-Mar-2012 -- into euro_ix_bex21bChris Hall2012-03-171-22/+45
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Version 0.99.20ex21b This brings us up to date with: commit 48f99b0c2bfed8d3880732d188e1d5964f575ee4 Date: Thu Sep 29 16:55:23 2011 +0400 release: 0.99.20 and the subsequent: commit dc00d2bb56aa6a84dd2328133f69db3c3e6d9dc7 Date: Sun Jan 8 14:47:06 2012 +0000 Marker merge for 'RE-0.99.17.6' This marker merge (i.e. an 'ours' strategy merge) is a placeholder to show that all commits in Quagga-RE stable, to its release RE-0.99.17.6 tag, have been reviewed and merged into 'master'. and then further commits (in descending date order) commit b51a3a31500133e3e26f12e7639f297c655bc735 commit ef2d5d100431031c32ea35b3c834b46cff16f511 commit 4c78376f96cd2ca56f1c6476b76fd659654431f5 commit e854095932260b3e6187902aa9a7baa0e96b9428 commit e6b03b77766dce8009ad7b4a2392e14addf4ab0f commit c25eaffdb2190149e768dc4ee4efc913c6d02992 commit d034aa027ef44d0a74805c27ad2a4d8ea20395d1 commit 907fd95e502e10334e5390c73cc57588b88b8171 commit 7fd6cd819ff98f0580b745ba637990df9c20ef0f commit 4c0cf00afc4340a429a9c4830f638b4593d7c3af commit 4afa50b393ff1fb34dd577888a05b81dfdced5af commit 6eb0c5ab1d43bcf9edd4fefd19031f2b96ded728 commit aca43b656623f38dfa6ea835dacbdfec51d03a67 commit 6bb1273e83c29b3aeff9584bc8f6272e773294ad commit d660f698427277ce695a5b756f3143c8304274ea commit 6134b875f39986564aced5e2d7329fcd852f17f4 commit b4e45f67057be22133b6bec88cdf285d5c8214db commit 6eac79a6fed4842e00607c00c445213b51bba377 commit cb32fd690a957819865219a847e3c21a53a0f419 commit 73bfe0bd9adb8e4dfcee7239e56a425c6d58f4e9 commit f768f367bcd1f37a53c563495176a5a134caf234 commit c7ec179a95c1ed4fcd3d3be3f981c8c20dce534a commit cddf391bf6839e9f093cef15508669c1f3f92122 commit 5a616c08ce089e25dc0e8da920727af4d11279bf commit 6ae93c058725991df5a9ae35cefec368919b5fea commit fc98d16ea77372f4ab4231e8904f8467e8d1ef71 A summary of the changes that relate to bppd, zebra and the lib follows. bgpd changes * attribute handling: (a) now checks the flag byte for all attributes and issues suitable log messages and notifications, (b) reports some length issues that previously let slide (local pref). Tighten End-of-RIB detection -- now iff an MP_UNREACH is the *only* attribute and no ordinary update or withdraw. * added --socket/-z option -- sets zebra socket name * sets IPv6 tclass as required * improved next hop handling and added "show ip bgp scan" and "show ip bgpd scan detail" commands. see commits: fc98d16ea77372f4ab4231e8904f8467e8d1ef71 0e8032d69961ae196c11ba6ead856084c7acf7c2 b64bfc1c4a552fc0b4dd024d5f77171ec848a5df 318f0d8a7f5e8e87086bbf2a9e7c4b35638951ac 8e80bdf20f493a71bcf74262ed3aa3a2437f4df6 f04a80a5d209dbb54f6fec5d0149b7c0e489d29e * removed SAFI_UNICAST_MULTICAST * fiddled with SAFI_MPLS_LABELED_VPN -- unsure if this is now complete -- stuff here TODO ! * support for multicast SAFI see commits: 73bfe0bd9adb8e4dfcee7239e56a425c6d58f4e9 5a616c08ce089e25dc0e8da920727af4d11279bf * added "match probability" commands * uses "route_types.txt" more effectively -- which affects the implementation of "redistribute" commands see commit: e0ca5fde7be5b5ce90dae78c2477e8245aecb8e9 * "nexthop-local unchanged" included in configuration. zebra changes * some whitespace change clutter :-( * ZEBRA_HELLO and mopping up routes (BZ#448) * implement route_types.h * support for SAFI_MULTICAST commit f768f367bcd1f37a53c563495176a5a134caf234 IPv6 MP-BGP Routes addition and deletion commit cddf391bf6839e9f093cef15508669c1f3f92122 IPv4 MP-BGP Routes addition and deletion * brought up to date with RFC6275 * add --socket/-z option * add "ipv6 nd mtu <1-65535>" commands lib changes * filter-list handling -- does not free the filter-list before calling the delete_hook(). However, unlike commit 6a2e0f36b103386e57dbe3a6ee4716e809111198 *does* remove the filter-list from the name look-up, before calling the delete_hook() -- which I believe works better. * md5.c now includes RFC 2104 HMAC However fixed to remove compiler warning, by replacing use of caddr_t by unsigned char*. Some phantom whitespace changes elsewhere * prefix.c: commits d171bf58ef12ace43d48565e6870722dece1e6ed 051954f574b9c26458518a7029aeed118f0da620 9663386f16e6285a322747514527fdf1d19788e4 - optimise masklen2ip() and apply_mask_ipv4() -- the version here should work on a Big-Endian machine as well. - optimise ip_masklen() -- the version here should (a) work on a Big-Endian machine, (b) give the same result as before if the netmask is not, in fact, valid, and (c) uses just 256 bytes of table -- not 64K. Version here is probably not quite as fast as the previous patch... but certainly faster that what was there before. * zclient.c: introduced zclient_serv_path, for general zclient and for bgpd zlookup. Added ZEBRA_HELLO to client start. Added safi to ipv4 and ipv6 route add/delete.
| * | general: remove inline qualifiers and move in-header functions to objectsPaul Jakma2012-01-061-2/+2
| | | | | | | | | | | | | | | | | | * (general) Move functions in headers into files, to be compiled into shared object files. Remove inline qualifier from functions. Let the compiler do the work.
| * | ospfd: fix packet reception for FreeBSD 10.Dmitrij Tejblum2012-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * ospf_packet.c (ospf_recv_packet): FreeBSD, starting from version 10, will not subtract the IP header size from ip_len. This is the patch from FreeBSD's ports/net/quagga/files/patch-ospfd__ospf_packet.c, by Boris Kovalenko.
| * | ospfd: more info in LSA checksum warning (BZ#685)Jaroslav Fojtik2011-12-211-2/+7
| |/
| * ospfd: fix regression in recent commitYAMAMOTO Shigeru2011-09-291-10/+15
| | | | | | | | | | | | | | | | | | commit '717750433839762d23a5f8d88fe0b4d57c8d490a' causes SEGV error, when 'oi = ospf_if_lookup_recv_if (ospf, iph->ip_src, ifp);' returns NULL. * ospf_packet.c * ospf_read(): change a place of calling 'ospf_verify_header()'
| * ospfd: CVE-2011-3325 part 2 (OSPF pkt type segv)Denis Ovsienko2011-09-261-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | This vulnerability (CERT-FI #514838) was reported by CROSS project. The error is reproducible only when ospfd debugging is enabled: * debug ospf packet all * debug ospf zebra When incoming packet header type field is set to 0x0a, ospfd will crash. * ospf_packet.c * ospf_verify_header(): add type field check * ospf_read(): perform input checks early
| * ospfd: CVE-2011-3325 part 1 (OSPF header underrun)Denis Ovsienko2011-09-261-3/+12
| | | | | | | | | | | | | | | | | | This vulnerability (CERT-FI #514838) was reported by CROSS project. When only 14 first bytes of a Hello packet is delivered, ospfd crashes. * ospf_packet.c * ospf_read(): add size check
* | Merge with main Quagga source as of 29-Jul-2011.ex17Chris Hall2011-08-121-0/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create euro_ix branch. Update version to: 0.99.18ex17 Of particular note: * includes support for GTSM: neighbor ... ttl-security hops X no neighbor ... ttl-security hops X where X is 1-254. For usual case of immediately connected peer, X == 1. Cannot set ttl-security while ebgp-multihop is set, and vice-versa. If underlying O/S does not support GTSM, then will set ttl as per ebgp-multihop. In passing, have fixed various bugs in the main Quagga branch. * initial support for draft-ietf-idr-optional-transitive Does not yet support "neighbor-complete" flag. * main Quagga now uses TCP_CORK and permanent non-blocking Do not beleive TCP_CORK to be necessary for euro_ix code... which has a different buffering strategy. The euro_ix code already runs sockets permanently non-blocking. * various fixes to attribute intern/unintern Trying to remove memory leaks. Nobody seems convinced that this has been perfected, yet. * fixes for ospfd and ospf6d issues. Up to date with master branch up to: commit 538cb284864c17de66152a5236db4cd80e3e7639 Merge: 036a6e6 8ced4e8 Author: Paul Jakma <paul@quagga.net> Date: Fri Jul 29 18:21:50 2011 +0100
| * Merge remote-tracking branch 'polymorf/master'Greg Troxel2011-07-131-0/+16
| |\
| | * Fix ip_len byte order in DragonFly's raw socketDavid BÉRARD2010-05-111-0/+16
| | |
| * | ospfd: Prioritise hellos for sending by queueing to head of output bufferPaul Jakma2010-12-081-46/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * It's possible for the packet output buffer to be filled up with a long series of non-Hello packets in between Hellos packets, such that the router's neighbours don't receive the Hello packet in time, even though the hello-timer ran at about the right time. Fix this by prioritising Hello packets, letting them skip the queue and go ahead of any packets already on the queue. This problem can occur when there are lots of LSAs and slow links. * ospf_packet.h: (ospf_hello_send_sub) not used outside of ospf_packet.c * ospf_packet.c: (ospf_fifo_push_head) add packet to head of fifo (so its no longer really a fifo, but hey) (ospf_packet_add_top) add packet to top of the packet output queue. (ospf_hello_send_sub) Put Hello's at the top of the packet output queue. make it take in_addr_t parameter, so that this ospf_hello_send can re-use this code too. (ospf_hello_send) consolidate code by using ospf_hello_send_sub (ospf_poll_send,ospf_hello_reply_timer) adjust for ospf_hello_send_sub.
| * | ospfd: Reset neighbour inactivity timer for any packet arrivalPaul Jakma2010-12-081-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The hello protocol monitors connectivity in 2 different ways: a) local -> remote b) remote -> local Connectivity is required in both directions (2-way) for adjacencies to form. The first requires a round-trip to detect, and is done by advertising which other hosts a router knows about in its hello messages. This allows a host to detect which other routers are and are not receiving its message. If a remote neighbour delists the local router, then the local router raises a "1-Way Received" event. The latter is straight-forward, and is detected by setting a timer for the neighbour. If another Hello packet is not received within this time then the neighbour is dead, and a separate "Inactive" event is raised. These are 2 different and relatively independent measures. Knowing that we can optimise the 2nd, remote->local measure and reset the timer when /any/ packet arrives from that neighbour. For any packet is as good as a Hello packet. This can help in marginal situations, where the number of protocol messages that must be sent sometimes can exceed the capacity of the network to transmit the messages within the configured dead-time. I.e. an OSPF network with lots of LSAs, slow links and/or slow hosts (e.g. O(10k) LSAs, O(100kbit) links, embedded CPUs, and O(10s) dead-times). This optimisation allows an OSPF network to run closer to this margin, and/or allows networks to perhaps better cope with rare periods of exceptional load, where otherwise they would not. It's fully compatible with plain OSPF implementations and doesn't prejudice dead-neighbour detection. * ospf_nsm.h: Rename HelloReceived event to PacketReceived. * ospf_nsm.c: (nsm_hello_received) -> nsm_packet_received * ospf_packet.c: Schedule PacketReceived whenever a valid message is received.
| * | ospfd: OSPF_MIN_LS_ARRIVAL compare should be >= to match ospf_floodPaul Jakma2010-12-081-1/+1
| |/ | | | | | | | | | | | | * ospf_packet.c: (ospf_ls_upd) the corresponding test on the arrival side in (ospf_flood) is <, so this should be >=, not >, purely for consistency. There is no practical effect here though.
| * ospfd: Fix debug messages that were masked by DISCARD_LSAPaul Jakma2010-01-141-3/+4
| | | | | | | | | | * ospf_packet.c: (ospf_ls_upd) DISCARD_LSA continues, and so should be after debug messages, not before them.
* | Bring "ex" version up to date with 0.99.18ex14Chris Hall2011-03-291-51/+65
| | | | | | | | | | | | | | | | Release: 0.99.18ex14 Also fixes issue with unknown attributes -- does not release them prematurely. Contains the "bgpd: New show commands for improved view and address family support", which is post 0.99.18. (But not RFC 5082 GTSM.)
* | Bring up to date with 0.99.16 releaseChris Hall2010-04-171-2/+3
| | | | | | | | | | | | | | | | | | | | This brings this branch up to date with 0.99.16, EXCEPT for the change to bgpd to use monotonic clock for timing updates. There are places where bgpd expects to find the actual time that things happened... so this change is not though to be complete. Further tidying in zebra, for FreeBSD.
* | Removing compiler warnings.Chris Hall2010-04-161-2/+1
|/ | | | | | | | Removed nearly 100 compiler warnings in the various routing daemons which now clean compile. Removed one warning in vty.c, which was obscured by the other warnings. SO... this commit corrects the previous one.
* ospfd: Make "Packet ... received on wrong link" conditional on debugPaul Jakma2009-08-111-2/+3
| | | | | | * ospf_packet.c: make this message conditional on 'debug ospf event', as it be easily triggered with, e.g., multiple subnets sharing same physical network. E.g, see bug #532.
* ospfd: Make ospf_if_lookup_recv_if() find the right unnumbered i/fJoakim Tjernlund2009-07-281-2/+2
| | | | | | | | | | | | | | | This function will return the interface for the first matching remote address for PtP i/f's. That won't work for multiple unnumbered i/f's as these may all have the same address. Pass in the struct interface pointer, ifp, to find the correct set of oi's to search in. This also reduces the size of the search list, making it faster. * ospfd/ospf_interface.c: Add struct interface * param to ospf_if_lookup_recv_if() to select the right list to search in. * ospfd/ospf_interface.h: ditto. * ospfd/ospf_packet.c: Pass new ifp argument to ospf_if_lookup_recv_if()
* [ospfd] discount IP header size from a new LSA pktDmitry Tejblum2009-06-241-3/+12
|
* [ospfd] Move passive interface checkJoakim Tjernlund2008-09-241-18/+26
| | | | | | | * ospf_packet.c: Apply passive check and drop for all packages and not just Hellos. Signed-off-by: Paul Jakma <paul@quagga.net>
* Set destination for PtP links to OSPF_ALLSPFROUTERS.Joakim Tjernlund2008-08-251-6/+14
| | | | | | | | | | | | | | | | | | | Update ospf_db_desc_send(), ospf_ls_upd_queue_send() and ospf_ls_req_send() to always use OSPF_ALLSPFROUTERS for PtP links. See RFC 2328, chap 8.1 for details: "The IP destination address for the packet is selected as follows. On physical point-to-point networks, the IP destination is always set to the address AllSPFRouters." Without this, it won't be possible to establish adjacencies on multiple unnumbered links to the same router. ChangeLog: 2008-07-25 Joakim Tjernlund <Joakim.Tjernlund@transmode.se> * ospfd/ospf_packet.c: Set destination for PtP links to OSPF_ALLSPFROUTERS.
* Bug #362 is fixed now.Denis Ovsienko2007-08-211-2/+6
|
* [autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warningsPaul Jakma2007-05-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 2007-05-09 Paul Jakma <paul.jakma@sun.com> * configure.ac: sys/conf.h depends on sys/param.h, at least on FBSD 6.2. (bug #363) Should check for in_pktinfo for IRDP 2006-05-27 Paul Jakma <paul.jakma@sun.com> * configure.ac: General cleanup of header and type checks, introducing an internal define, QUAGGA_INCLUDES, to build up a list of stuff to include so as to avoid 'present but cant be compiled' warnings. Misc additional checks of things missing according to autoscan. Add LIBM, for bgpd's use of libm, so as to avoid burdening LIBS, and all the binaries, with libm linkage. Remove the bad practice of using m4 changequote(), just quote the []'s in the case statements properly. This should fix bugs 162, 303 and 178. * */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN, * bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
* [ospfd] Add passive-interface default supportPaul Jakma2006-10-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-10-22 Yar Tikhiy <yar@comp.chem.msu.su> * (general) Add support for passive-interface default (with minor edits by Paul Jakma). * ospf_interface.h: Add OSPF_IF_PASSIVE_STATUS macro, looking at configured value, or the global 'default' value, as required. * ospf_interface.c: (ospf_if_new_hook) Leave passive unconfigured per default, allowing global 'default' to take effect for unconfigured interfaces. * ospf_packet.c: (various) use OSPF_IF_PASSIVE_STATUS * ospf_vty.c: (ospf_passive_interface_default) new function, unset passive from all interfaces if default is enabled, as the per-iface settings become redundant. (ospf_passive_interface_update) new func, update passive setting taking global default into account. ({no,}ospf_passive_interface_addr_cmd) Add support for 'default' variant of command. (show_ip_ospf_interface_sub) Update to take global default into account when printing passive status. (ospf_config_write) ditto. * ospfd.c: (ospf_new) set global passive-interface default. * ospfd.h: (struct ospf) Add field for global passive-interface.
* [ospfd] Improve some warning messages.Andrew J. Schorr2006-09-251-7/+14
| | | | | | | | | 2006-09-25 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * ospf_packet.c: (ospf_packet_dup, ospf_make_md5_digest) Fix zlog_warn messages to eliminate compiler warnings. (ospf_hello) Improve warning messages to show why we are complaining.
* [ospfd] Fix assertion in DB-exchange fix, hit by ogier-db-ex-opt commitPaul Jakma2006-08-301-21/+13
| | | | | | | | | | 2006-08-28 Andy Gay <andy@andynet.net> * ospf_packet.c: (ospf_make_db_desc) Assert added with More-bit fixes does not hold up with addition of Ogier DB-Exchange optimisation, which can empty the db-summary list in between sent DD packets. Remove assert, update More-bit always when in Exchange.
* [ospfd] Bug #134, ospfd should be more robust to backward time changePaul Jakma2006-08-271-5/+7
| | | | | | | | | | | | | | 2006-08-25 Paul Jakma <paul.jakma@sun.com> * (general) Bug #134. Be more robust to backward time changes, use the newly added libzebra time functions. In most cases: recent_time -> recent_relative_time() gettimeofday -> quagga_gettime (QUAGGA_CLK_MONOTONIC, ..) time -> quagga_time. (ospf_make_md5_digest) time() call deliberately not changed. (ospf_external_lsa_refresh) remove useless gettimeofday, LSA tv_orig time was already set in ospf_lsa_new, called via ospf_external_lsa_new.
* [ospfd] draft-ogier-ospf-dbex-opt DB-exchange optimisationPaul Jakma2006-08-271-14/+34
| | | | | | | 2006-08-03 Paul Jakma <paul.jakma@sun.com> * ospf_packet.c: (ospf_make_db_desc) Implement draft-ogier-ospf-dbex-opt DB-exchange optimisation.
* [ospfd] Raise ExchangeDone earlier, avoid often needless round of DD packetsPaul Jakma2006-08-271-19/+42
| | | | | | | | | | | | | 2006-08-03 Paul Jakma <paul.jakma@sun.com> * ospf_packet.c: (ospf_make_db_desc) Unset the DD More bit after constructing the packet, if appropriate. (ospf_db_desc_proc) Speed up Exchange, slave should raise ExchangeDone earlier, as RFC mandates, by forming its reply before deciding whether both sides are done, avoids a needless round of empty DD packet exchanges at the end of Exchange, hence speeding up ExchangeDone. (ospf_db_desc) use UNSET_FLAG macro.
* [ospfd] Allow ospf_lsa_unlock to NULL out callers' LSA pointers upon freePaul Jakma2006-07-261-24/+6
| | | | | | | | | | | | | | | | 2006-07-26 Paul Jakma <paul.jakma@sun.com> * ospf_lsa.{c,h}: (ospf_lsa_unlock) Change to take a double pointer to the LSA to be 'unlocked', so that, if the LSA is freed, the callers pointer to the LSA can be NULLed out, allowing any further use of that pointer to provoke a crash sooner rather than later. * ospf_*.c: (general) Adjust callers of ospf_lsa_unlock to match previous. Try annotate 'locking' somewhat to show which 'locks' are protecting what LSA reference, if not obvious. * ospf_opaque.c: (ospf_opaque_lsa_install) Trivial: remove useless goto, replace with return. * ospf_packet.c: (ospf_make_ls_ack) Trivial: merge two list loops, the dual-loop predated the delete-safe list-loop macro.
* [ospfd] Improve Hello NetworkMask mismatch warning to give more infoAndrew J. Schorr2006-07-111-2/+3
| | | | | | | 2006-07-10 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * ospf_packet.c: (ospf_hello) Improve NetworkMask mismatch warning message to include interface name and conflicting prefix lengths.
* [ospfd] Fix multicast membership drop bugPaul Jakma2006-06-151-3/+3
| | | | | | | | | | | | | | | | | | 2006-06-15 Paul Jakma <paul.jakma@sun.com> * Reported by Milan Koci * ospf_interface.h: (struct ospf_if_info) Add reference counts for multicast group memberships. Add various macros to help manipulate/check membership state. * ospf_interface.c: (ospf_if_set_multicast) Maintain the ospf_if_info reference counts, and only actually drop memberships if it hits 0, to avoid losing membership when OSPF is disabled on an interface with multiple active OSPF interfaces. * ospf_packet.c: (ospf_{hello,read}) Use the new macros to check/set multicast membership. * ospf_vty.c: (show_ip_ospf_interface_sub) ditto.
* [ospfd] suppres mostly uninteresting debug message unless debug is setPaul Jakma2006-06-151-3/+4
| | | | | | | | 2006-05-30 Paul Jakma <paul.jakma@sun.com> * ospf_packet.c: (ospf_read) Debug message about packets received on unenabled interfaces should be conditional on debug being set.
* [ospfd/zserv] adjust to new formatpaul2006-01-171-2/+2
| | | | | | | | 2006-01-17 Paul Jakma <paul.jakma@sun.com> * ospf_packet.c: (ospf_verify_header) print out the types involved if there's a mismatch. * ospf_zebra.c: (ospf_zebra_add) Adjust to new zserv format.
* [ospfd] fix undefined effect expressionpaul2006-01-101-1/+5
| | | | | | | 2006-01-10 Juris Kalnins <juris@mt.lv> * ospf_packet.c: (ospf_make_md5_digest) fix odd, if not undefined effect, assignment of an increment expression.
* 2005-11-03 Paul Jakma <paul.jakma@sun.com>paul2005-11-031-14/+18
| | | | | * ospf_packet.c: Change level of some warnings to informational.
* 2005-11-03 Paul Jakma <paul.jakma@sun.com>paul2005-11-031-3/+1
| | | | | | | * ospf_apiserver.c: (apiserver_sync_callback) stray semi-colon * ospf_packet.c: include checksum.h, remove the in_cksum extern * prototypes. * ospf_te.h: Add braces, quell warning.
* 2005-10-21 Paul Jakma <paul.jakma@sun.com>paul2005-10-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (general) SPF millisecond resolution timer with adaptive, linear back-off holdtime. Prettification of ospf_timer_dump. * ospf_dump.c: (ospf_timeval_dump) new function. The guts of ospf_timer_dump, but made to be more dynamic in printing out the relative timeval, sliding the precision printed out according to the value. (ospf_timer_dump) guts moved to ospf_timeval_dump. * ospf_dump.h: export ospf_timeval_dump. * ospf_flood.c: (ospf_flood) remove gettimeofday, use the libzebra exported recent_time instead, as it's not terribly critical to have time exactly right - the dropped LSA will be retransmited to us if we don't ACK it. * ospf_packet.c: (ospf_ls_upd_timer) Ditto, but here we're not transmitting, just putting LSA back on update transmit list. * ospfd.h: delay and holdtimes should be unsigned. Add spf_max_holdtime and spf_hold_multiplier. Update default defines for delay and hold time to be in msec. (struct ospf) change the SPF timestamp to a struct timeval. Remove ospf_timers_spf_(un)?set. * ospfd.c: (ospf_timers_spf_{set,unset}) removed. (ospf_new) initialise spf_max_holdtime and spf_hold_multiplier * ospf_spf.c: (ospf_spf_calculate) SPF timestamp is a timeval now, update with gettimeofday. (ospf_spf_calculate_schedule) Change SPF timers to millisecond resolution. Make the holdtime be adaptive, with a linear increase in holdtime ever consecutive SPF run which occurs within holdtime of previous SPF, bounded by spf_max_holdtime. * ospf_vty.c: Update spf timers commands. (ospf_timers_spf_set) trivial helper. (ospf_timers_throttle_spf_cmd) new command to set SPF delay, initial hold and max hold times with millisecond resolution. (ospf_timers_spf_cmd) Deprecated. Accept the old values, convert to msec, truncate to new limits. (no_ospf_timers_throttle_spf_cmd) set timers to defaults. (no_ospf_timers_spf_cmd) deprecated form, same as previous. (show_ip_ospf_cmd) Display SPF parameters and times. (show_ip_ospf_neighbour_header) Centralise the 'sh ip os ne' header. (show_ip_ospf_neighbor_sub) Fix the field widths. Get rid of the multiple spaces which were making the lines even longer. (show_ip_ospf_neighbor_cmd) Use show_ip_ospf_neighbour_header (show_ip_ospf_neighbor_all_cmd) ditto and fix the field widths for NBMA neighbours. (show_ip_ospf_neighbor_int) Use header function. (show_ip_ospf_nbr_nbma_detail_sub) use sizeof for timebuf, local array - safer. (show_ip_ospf_neighbor_detail_sub) ditto (ospf_vty_init) install the new SPF throttle timer commands.
* 2005-10-21 Paul Jakma <paul.jakma@sun.com>paul2005-10-211-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (general) OSPF fast, sub-second hello and 1s dead-interval support. A warning fix. Millisec support for ospf_timer_dump. Change auto-cost ref-bandwidth to add a comment to write out of config, rather than printing annoying messages to vty on startup. * ospf_dump.c: (ospf_timer_dump) Print out milliseconds too. Callers typically specify a length of 9, so most see millisecs unless they specify the additional length. * ospf_interface.h: (struct ospf_interface) new interface param, fast_hello. * ospf_interface.c: (ospf_if_table_lookup) add brackets, gcc warning fix. (ospf_new_if_params) Initialise fast_hello param. (ospf_free_if_params) Check whether fast_hello is configured. (ospf_if_new_hook) set fast_hello to default. * ospf_ism.h: Wrap OSPF_ISM_TIMER_ON inside do {} while (0) to prevent funny side-effects from its if statement when this macro is used conditionally by other macros. (OSPF_ISM_TIMER_MSEC_ON) new macro, set in milliseconds. (OSPF_HELLO_TIMER_ON) new macro to set hello timer according to whether fast_hello is set. * ospf_ism.c: Update all setting of the hello timer to use either OSPF_ISM_TIMER_MSEC_ON or OSPF_HELLO_TIMER_ON. The former is used when hello is to be sent immediately. * ospf_nsm.c: ditto * ospf_packet.c: (ospf_hello) hello-interval is not checked for mismatch if fast_hello is set. (ospf_read) Annoying nit, fix "no ospf_interface" to be debug rather than a warning, as it can be perfectly normal to receive packets when logical subnets are used. (ospf_make_hello) Set hello-interval to 0 if fast-hellos are configured. * ospf_vty.c: (ospf_auto_cost_reference_bandwidth) annoying nit, don't vty_out if this command is given, it gets tired quick. (show_ip_ospf_interface_sub) Print the hello-interval according to whether fast-hello is set or not. Print the extra 5 millisec characters from (ospf_timer_dump) if fast-hello is configured. (ospf_vty_dead_interval_set) new function, common to all forms of dead-interval command, to set dead-interval and fast-hello correctly. If a dead-interval is given, unset fast-hello, else if a hello-multiplier is set, set dead-interval to 1 and fast-hello to given multiplier. (ip_ospf_dead_interval_addr_cmd) use ospf_vty_dead_interval_set(). (ip_ospf_dead_interval_minimal_addr_cmd) ditto. (no_ip_ospf_dead_interval) Unset fast-hello. (no_ip_ospf_hello_interval) Bug-fix, unset of hello-interval should set it to OSPF_HELLO_INTERVAL_DEFAULT, not OSPF_ROUTER_DEAD_INTERVAL_DEFAULT. (config_write_interface) Write out fast-hello. (ospf_config_write) Write a comment about "auto-cost reference-bandwidth" having to be equal on all routers. Hopefully just as noticeable as old practice of writing to vty, but less annoying. (ospf_vty_if_init) install the two new dead-interval commands. * ospfd.h: Add defines for OSPF_ROUTER_DEAD_INTERVAL_MINIMAL and OSPF_FAST_HELLO_DEFAULT.