]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Core in ospf_if_down during shutdown.
authorTomi Salminen <tsalminen@forcepoint.com>
Wed, 2 Feb 2022 09:19:09 +0000 (11:19 +0200)
committermergify-bot <noreply@mergify.com>
Fri, 4 Feb 2022 12:26:32 +0000 (12:26 +0000)
Skip marking routes as changed in ospf_if_down if there's now
new_table present, which might be the case when the instance is
being finished

The backtrace for the core was:

  raise (sig=sig@entry=11) at ../sysdeps/unix/sysv/linux/raise.c:50
  core_handler (signo=11, siginfo=0x7fffffffe170, context=<optimized out>) at lib/sigevent.c:262
  <signal handler called>
  route_top (table=0x0) at lib/table.c:401
  ospf_if_down (oi=oi@entry=0x555555999090) at ospfd/ospf_interface.c:849
  ospf_if_free (oi=0x555555999090) at ospfd/ospf_interface.c:339
  ospf_finish_final (ospf=0x55555599c830) at ospfd/ospfd.c:749
  ospf_deferred_shutdown_finish (ospf=0x55555599c830) at ospfd/ospfd.c:578
  ospf_deferred_shutdown_check (ospf=<optimized out>) at ospfd/ospfd.c:627
  ospf_finish (ospf=<optimized out>) at ospfd/ospfd.c:683
  ospf_terminate () at ospfd/ospfd.c:653
  sigint () at ospfd/ospf_main.c:109
  quagga_sigevent_process () at lib/sigevent.c:130
  thread_fetch (m=m@entry=0x5555556e45e0, fetch=fetch@entry=0x7fffffffe9b0) at lib/thread.c:1709
  frr_run (master=0x5555556e45e0) at lib/libfrr.c:1174
  main (argc=9, argv=0x7fffffffecb8) at ospfd/ospf_main.c:254

Signed-off-by: Tomi Salminen <tsalminen@forcepoint.com>
(cherry picked from commit d4e66f14854d1cc5bdb8b8209613fd596f8c1775)

ospfd/ospf_interface.c

index edbacdcff780aa3c17626b3b25709ea27ebf535f..7f46e6db84865424b2ee58b65f46ef367ca2af98 100644 (file)
@@ -846,6 +846,8 @@ int ospf_if_down(struct ospf_interface *oi)
        /* Shutdown packet reception and sending */
        ospf_if_stream_unset(oi);
 
+       if (!ospf->new_table)
+               return 1;
        for (rn = route_top(ospf->new_table); rn; rn = route_next(rn)) {
                or = rn->info;