Revision 62e64905 proto/bgp/packets.c

View differences:

proto/bgp/packets.c
700 700
      WITHDRAW(BAD_NEXT_HOP);
701 701

  
702 702
    a->dest = RTD_UNICAST;
703
    a->nh.gw = nbr->addr;
704
    a->nh.iface = nbr->iface;
705
    a->nh.next = NULL;
703
    a->nh = (struct nexthop){ .gw = nbr->addr, .iface = nbr->iface };
706 704
    a->hostentry = NULL;
707 705
    a->igp_metric = 0;
708 706
  }
......
749 747
  if (s->channel->cf->next_hop_self)
750 748
    return 0;
751 749

  
752
  /* We need valid global gateway */
753
  if ((ra->dest != RTD_UNICAST) || (ra->nh.next) || ipa_zero(ra->nh.gw) || ipa_is_link_local(ra->nh.gw))
750
  /* We need one valid global gateway */
751
  if ((ra->dest != RTD_UNICAST) || ra->nh.next || ipa_zero(ra->nh.gw) || ipa_is_link_local(ra->nh.gw))
754 752
    return 0;
755 753

  
756 754
  /* Use it when exported to internal peers */
......
1434 1432

  
1435 1433
  if (ea)
1436 1434
  {
1437
    a = alloca(sizeof(struct rta));
1438
    memset(a, 0, sizeof(struct rta));
1435
    a = allocz(sizeof(struct rta));
1439 1436

  
1440 1437
    a->source = RTS_BGP;
1441 1438
    a->scope = SCOPE_UNIVERSE;
1442
    a->dest = RTD_UNREACHABLE;
1443 1439
    a->from = s->proto->cf->remote_ip;
1444 1440
    a->eattrs = ea;
1445 1441

  

Also available in: Unified diff