summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_ism.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: require semicolon after DEFINE_HOOK & co.David Lamparter2021-03-171-1/+1
| | | | | | See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: unify thread/event cancel macrosMark Stapp2020-10-231-1/+1
| | | | | | | | | Replace all lib/thread cancel macros, use thread_cancel() everywhere. Only the THREAD_OFF macro and thread_cancel() api are supported. Also adjust thread_cancel_async() to NULL caller's pointer (if present). Signed-off-by: Mark Stapp <mjs@voltanet.io>
* * : update signature of thread_cancel apiMark Stapp2020-10-231-7/+1
| | | | | | | | Change thread_cancel to take a ** to an event, NULL-check before dereferencing, and NULL the caller's pointer. Update many callers to use the new signature. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* ospfd: GR helper exit scenariosrgirada2020-09-221-0/+1
| | | | | | | | | | Description: The follwoing helper exit scenarios are handled. 1. Recv Max age grace LSA from RESTARTER. 2. Grace timer expiry. 3. Due to topo change if lsa check is enabled. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* ospfd: Do not turn on write thread unless we have something in itDonald Sharp2019-08-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I am rarely seeing this crash: r2: ospfd crashed. Core file found - Backtrace follows: [New LWP 32748] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1". Core was generated by `/usr/lib/frr/ospfd'. Program terminated with signal SIGABRT, Aborted. 2019-08-29 15:59:36,149 ERROR: assert failed at "test_ospf_sr_topo1/test_memory_leak": Which translates to this code: node = listhead(ospf->oi_write_q); assert(node); oi = listgetdata(node); assert(oi); So if we get into ospf_write without anything on the oi_write_q we are stopping the program. This is happening because in ospf_ls_upd_queue_send we are calling ospf_write. Imagine that we have a interface already on the on_write_q and then ospf_write handles the packet send for all functions. We are not clearing the t_write thread and we are popping and causing a crash. Additionally modify OSPF_ISM_WRITE_ON(O) to not just blindly turn on the t_write thread. Only do so if we have data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> ospfd: Remove redundant asserts assert(oi) is impossible all listgetdata(node) directly proceeding it already asserts here, besides a node cannot be created with a null pointer! If list_isempty is called directly before the listhead call it is impossilbe that we do not have a valid pointer here. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-41/+39
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: remove THREAD_ON macros, add nullity checkQuentin Young2017-05-091-21/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way thread.c is written, a caller who wishes to be able to cancel a thread or avoid scheduling it twice must keep a reference to the thread. Typically this is done with a long lived pointer whose value is checked for null in order to know if the thread is currently scheduled. The check-and-schedule idiom is so common that several wrapper macros in thread.h existed solely to provide it. This patch removes those macros and adds a new parameter to all thread_add_* functions which is a pointer to the struct thread * to store the result of a scheduling call. If the value passed is non-null, the thread will only be scheduled if the value is null. This helps with consistency. A Coccinelle spatch has been used to transform code of the form: if (t == NULL) t = thread_add_* (...) to the form thread_add_* (..., &t) The THREAD_ON macros have also been transformed to the underlying thread.c calls. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use hooks for sending SNMP trapsDavid Lamparter2017-03-251-4/+6
| | | | | | | This means there are no ties into the SNMP code anymore other than the init call at startup. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* [ospfd] Make OSPF_ISM_TIMER_OFF macro safer.ajs2005-11-161-5/+7
| | | | | | | 2005-11-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * ospf_ism.h: (OSPF_ISM_TIMER_OFF) Improve macro syntax by enclosing in 'do {...} while(0)'.
* 2005-10-21 Paul Jakma <paul.jakma@sun.com>paul2005-10-211-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (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.
* 2005-09-29 Alain Ritoux <alain.ritoux@6wind.com>vincent2005-09-291-0/+4
| | | | | | | | | | | | | | | | * ospfd/ospf_vty.c: forece default route LSA to be re_issued whenever cost is changed ( [no] ip ospf area XXX default-cost YYY) Support ignore-mtu option * ospfd/ospfd.h: define OSPF_MTU_IGNORE_DEFAULT * ospfd/ospf_packet.c: support ignore-mtu option * ospfd/ospf_interface.h: field added for skipping MTU check * ospfd/ospf_interface.c: fix memory leak in ospf_crypt_key_delete() Set mtu_ignore field to default value * ospfd/ospf_abr.[ch]: export ospf_abr_announce_network_to_area() * ospfd/ospf_ism.h: add MACRO to convert internal ISM status into SNMP correct values * ospfd/ospf_snmp.c: add sanity check on LSA type in lsdb_lookup_next() convert OSPFIFSTATE internal status into SNMP values
* 2005-05-06 Paul Jakma <paul.jakma@sun.com>paul2005-05-061-8/+8
| | | | | | | | | | | | | | | | | | | | | | | * (general) extern and static qualifiers added. unspecified arguments in definitions fixed, typically they should be 'void'. function casts added for callbacks. Guards added to headers which lacked them. Proper headers included rather than relying on incomplete definitions. gcc noreturn function attribute where appropriate. * ospf_opaque.c: remove the private definition of ospf_lsa's ospf_lsa_refresh_delay. * ospf_lsa.h: export ospf_lsa_refresh_delay * ospf_packet.c: (ospf_make_md5_digest) make *auth_key const, correct thing to do - removes need for the casts later. * ospf_vty.c: Use vty.h's VTY_GET_INTEGER rather than ospf_vty's home-brewed versions, shuts up several warnings. * ospf_vty.h: remove VTY_GET_UINT32. VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX moved to lib/vty.h. * ospf_zebra.c: (ospf_distribute_list_update_timer) hacky overloading of the THREAD_ARG pointer should at least use uintptr_t.
* Initial revisionpaul2002-12-131-0/+88