~brightbox/bird/debian-packaging

« back to all changes in this revision

Viewing changes to proto/ospf/neighbor.c

  • Committer: Ondřej Surý
  • Date: 2013-11-25 14:59:24 UTC
  • Revision ID: git-v1:a3c058b8752bd98df2231ac88d94931fdb4e0c65
New upstream version 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
582
582
  OSPF_TRACE(D_EVENTS, "Deleting neigbor.");
583
583
}
584
584
 
 
585
static void
 
586
ospf_neigh_bfd_hook(struct bfd_request *req)
 
587
{
 
588
  struct ospf_neighbor *n = req->data;
 
589
  struct proto *p = &n->ifa->oa->po->proto;
 
590
 
 
591
  if (req->down)
 
592
  {
 
593
    OSPF_TRACE(D_EVENTS, "BFD session down for %I on %s",
 
594
               n->ip, n->ifa->iface->name);
 
595
 
 
596
    ospf_neigh_remove(n);
 
597
  }
 
598
}
 
599
 
 
600
void
 
601
ospf_neigh_update_bfd(struct ospf_neighbor *n, int use_bfd)
 
602
{
 
603
  if (use_bfd && !n->bfd_req)
 
604
    n->bfd_req = bfd_request_session(n->pool, n->ip, n->ifa->addr->ip, n->ifa->iface,
 
605
                                     ospf_neigh_bfd_hook, n);
 
606
 
 
607
  if (!use_bfd && n->bfd_req)
 
608
  {
 
609
    rfree(n->bfd_req);
 
610
    n->bfd_req = NULL;
 
611
  }
 
612
}
 
613
 
 
614
 
585
615
void
586
616
ospf_sh_neigh_info(struct ospf_neighbor *n)
587
617
{