Revision 3e474192 proto/rip/rip.c

View differences:

proto/rip/rip.c
297 297
  }
298 298
  n = net_get( p->table, b->network, pxlen );
299 299
  r = rte_get_temp(a);
300
  r->u.rip.metric = ntohl(b->metric) + rif->patt->metric;
300
  r->u.rip.metric = ntohl(b->metric) + rif->metric;
301 301
  if (r->u.rip.metric > P_CF->infinity) r->u.rip.metric = P_CF->infinity;
302 302
  r->u.rip.tag = ntohl(b->tag);
303 303
  r->net = n;
......
468 468
      struct iface *iface = rif->iface;
469 469

  
470 470
      if (!iface) continue;
471
      if (rif->patt->mode & IM_QUIET) continue;
471
      if (rif->mode & IM_QUIET) continue;
472 472
      if (!(iface->flags & IF_UP)) continue;
473 473

  
474 474
      rif->triggered = (P->tx_count % 6);
......
577 577
new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_patt *patt )
578 578
{
579 579
  struct rip_interface *rif;
580
  struct rip_patt *PATT = (struct rip_patt *) patt;
580 581

  
581 582
  rif = mb_allocz(p->pool, sizeof( struct rip_interface ));
582 583
  rif->iface = new;
583 584
  rif->proto = p;
584 585
  rif->busy = NULL;
585
  rif->patt = (struct rip_patt *) patt;
586

  
587
  if (rif->patt)
588
    rif->multicast = (!(rif->patt->mode & IM_BROADCAST)) && (flags & IF_MULTICAST);
586
  if (PATT) {
587
    rif->mode = PATT->mode;
588
    rif->metric = PATT->metric;
589
    rif->multicast = (!(PATT->mode & IM_BROADCAST)) && (flags & IF_MULTICAST);
590
  }
589 591
  /* lookup multicasts over unnumbered links - no: rip is not defined over unnumbered links */
590 592

  
591 593
  if (rif->multicast)
......
627 629
  if (!ipa_nonzero(rif->sock->daddr)) {
628 630
    log( L_WARN "%s: interface %s is too strange for me", P_NAME, rif->iface ? rif->iface->name : "(dummy)" );
629 631
  } else
630
    if (!(rif->patt->mode & IM_NOLISTEN))
632
    if (!(rif->mode & IM_NOLISTEN))
631 633
      if (sk_open(rif->sock)<0) {
632 634
	log( L_ERR "%s: could not listen on %s", P_NAME, rif->iface ? rif->iface->name : "(dummy)" );
633 635
	/* Don't try to transmit into this one? Well, why not? This should not happen, anyway :-) */
......
868 870
rip_reconfigure(struct proto *p, struct proto_config *c)
869 871
{
870 872
  struct rip_config *new = (struct rip_config *) c;
871
  int generic = sizeof(struct proto_config) + sizeof(list);
873
  int generic = sizeof(struct proto_config) + sizeof(list) /* + sizeof(struct password_item *) */;
872 874

  
875
#if 0
876
  if (!password_same())
877
    return 0;
878
#endif
873 879
  return !memcmp(((byte *) P_CF) + generic,
874 880
                 ((byte *) new) + generic,
875 881
                 sizeof(struct rip_proto_config) - generic);

Also available in: Unified diff