Revision 9a158361 proto/rip/rip.c

View differences:

proto/rip/rip.c
491 491
  if (want_multicast)
492 492
    rif->sock->daddr = ipa_from_u32(0x7f000001); /* FIXME: must lookup address in rfc's */
493 493
  if (flags & IF_BROADCAST)
494
    rif->sock->daddr = new->brd;
494
    rif->sock->daddr = new->addr->brd;
495 495
  if (flags & IF_UNNUMBERED)
496
    rif->sock->daddr = new->opposite;
496
    rif->sock->daddr = new->addr->opposite;
497 497

  
498 498
  if (!ipa_nonzero(rif->sock->daddr))
499 499
    log( L_WARN "RIP: interface %s is too strange for me", rif->iface ? rif->iface->name : "(dummy)" );
......
507 507
}
508 508

  
509 509
static void
510
rip_if_notify(struct proto *p, unsigned c, struct iface *new, struct iface *old)
510
rip_if_notify(struct proto *p, unsigned c, struct iface *iface)
511 511
{
512 512
  DBG( "RIP: if notify\n" );
513
  if (old) {
513
  if (iface->flags & IF_IGNORE)
514
    return;
515
  if (c & IF_CHANGE_DOWN) {
514 516
    struct rip_interface *i;
515
    i = find_interface(p, old);
517
    i = find_interface(p, iface);
516 518
    if (i) {
517 519
      rem_node(NODE i);
518 520
      kill_iface(p, i);
519 521
    }
520 522
  }
521
  if (new) {
523
  if (c & IF_CHANGE_UP) {
522 524
    struct rip_interface *rif;
523
    struct iface_patt *k = iface_patt_match(&P_CF->iface_list, new);
525
    struct iface_patt *k = iface_patt_match(&P_CF->iface_list, iface);
524 526

  
525 527
    if (!k) return; /* We are not interested in this interface */
526
    DBG("adding interface %s\n", new->name );
527
    rif = new_iface(p, new, new->flags);
528
    DBG("adding interface %s\n", iface->name );
529
    rif = new_iface(p, iface, iface->flags);
528 530
    rif->patt = (void *) k;
529 531
    add_head( &P->interfaces, NODE rif );
530 532
  }

Also available in: Unified diff