scheduler: mark timers for removal and only remove them in a cleanup walk
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 26 Feb 2016 23:20:24 +0000 (00:20 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 29 Feb 2016 19:55:29 +0000 (20:55 +0100)
commitb9252004852f7a83dcccd6cd4aa01886cc7d554a
tree101b92ceb9cf8eb151cfd2efbfffc89c1500787f
parentb88f5b8b56c9985d493cf9d520bccb65351fc5da
scheduler: mark timers for removal and only remove them in a cleanup walk

Fixes crashes in networks with many nodes.

*** olsr.org - pre-0.9.1-git_dd7c5a0-hash_b9729ef932ee0c718b5da79dcf6a5fce ***
 Build date: 2016-02-24 21:02:23 on jenkins
 http://www.olsr.org

/usr/sbin/olsrd               (olsr_segv_handler)          src/main.c:323
/lib/i386-linux-gnu/libc.so.6 (+0x2de78)                   [0xb760ce78]
/usr/sbin/olsrd               (list_remove)                src/common/list.c:105
/usr/sbin/olsrd               (olsr_stop_timer)            src/scheduler.c:874
/usr/sbin/olsrd               (olsr_del_nbr2_list)         src/neighbor_table.c:85
/usr/sbin/olsrd               (olsr_delete_neighbor_table) src/neighbor_table.c:211
/usr/sbin/olsrd               (olsr_delete_link_entry)     src/link_set.c:375
/usr/sbin/olsrd               (olsr_expire_link_entry)     src/link_set.c:495
/usr/sbin/olsrd               (walk_timers)                src/scheduler.c:650
/usr/sbin/olsrd               (olsr_scheduler)             src/scheduler.c:506
/usr/sbin/olsrd               (main)                       src/main.c:705

olsrd crashed, stack trace follows
/usr/sbin/olsrd               (olsr_segv_handler)          src/main.c:323
/lib/i386-linux-gnu/libc.so.6 (+0x2de78)                   [0xb764ce78]
/usr/sbin/olsrd               (list_remove)                src/common/list.c:105
/usr/sbin/olsrd               (olsr_stop_timer)            src/scheduler.c:874
/usr/sbin/olsrd               (olsr_update_gateway_entry)  src/gateway.c:1208
/usr/sbin/olsrd               (olsr_input_hna)             src/hna_set.c:446
/usr/sbin/olsrd               (parse_packet)               src/parser.c:393
/usr/sbin/olsrd               (olsr_input)                 src/parser.c:496
/usr/sbin/olsrd               (poll_sockets)               src/scheduler.c:341
/usr/sbin/olsrd               (olsr_scheduler)             src/scheduler.c:499
/usr/sbin/olsrd               (main)                       src/main.c:705

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/scheduler.c
src/scheduler.h