Revision 5ed68e46

View differences:

proto/rip/rip.c
11 11
		next hops are only advisory, and they are pretty ugly in IpV6.
12 12
		I suggest just forgetting about them.
13 13

  
14
	FIXME (nonurgent): fold rip_connection into rip_interface?
14
	FIXME: (nonurgent): fold rip_connection into rip_interface?
15 15

  
16 16
	FIXME: (nonurgent) allow bigger frequencies than 1 regular update in 6 seconds (?)
17 17
	FIXME: propagation of metric=infinity into main routing table may or may not be good idea.
......
62 62

  
63 63
#define P ((struct rip_proto *) p)
64 64
#define P_CF ((struct rip_proto_config *)p->cf)
65
#define E ((struct rip_entry *) e)
66 65

  
67 66
#define TRACE(level, msg, args...) do { if (p->debug & level) { log(L_TRACE "%s: " msg, p->name , ## args); } } while(0)
68 67

  
69 68
static struct rip_interface *new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_patt *patt);
70 69

  
71
#define P_NAME p->name
72

  
73 70
/*
74 71
 * Output processing
75 72
 *
......
81 78
{
82 79
  struct rip_connection *c = ((struct rip_interface *)(s->data))->busy;
83 80
  struct proto *p = c->proto;
84
  log( L_ERR "%s: Unexpected error at rip transmit: %M", P_NAME, err );
81
  log( L_ERR "%s: Unexpected error at rip transmit: %M", p->name, err );
85 82
}
86 83

  
87 84
/*
......
217 214
  static int num = 0;
218 215

  
219 216
  if (rif->busy) {
220
    log (L_WARN "%s: Interface %s is much too slow, dropping request", P_NAME, iface->name);
217
    log (L_WARN "%s: Interface %s is much too slow, dropping request", p->name, iface->name);
221 218
    return;
222 219
  }
223 220
  c = mb_alloc( p->pool, sizeof( struct rip_connection ));
......
371 368
    if (metric == 0xff)
372 369
      { DBG( "IpV6 nexthop ignored" ); return; }
373 370
#endif
374
    log( L_WARN "%s: Got metric %d from %I", P_NAME, metric, whotoldme );
371
    log( L_WARN "%s: Got metric %d from %I", p->name, metric, whotoldme );
375 372
    return;
376 373
  }
377 374

  
378 375
  advertise_entry( p, block, whotoldme );
379 376
}
380 377

  
381
#define BAD( x ) { log( L_REMOTE "%s: " x, P_NAME ); return 1; }
378
#define BAD( x ) { log( L_REMOTE "%s: " x, p->name ); return 1; }
382 379

  
383 380
/*
384 381
 * rip_process_packet - this is main routine for incoming packets.
......
407 404
          break;
408 405
  case RIPCMD_RESPONSE: DBG( "*** Rtable from %I\n", whotoldme ); 
409 406
          if (port != P_CF->port) {
410
	    log( L_REMOTE "%s: %I send me routing info from port %d", P_NAME, whotoldme, port );
407
	    log( L_REMOTE "%s: %I send me routing info from port %d", p->name, whotoldme, port );
411 408
	    return 1;
412 409
	  }
413 410

  
414 411
	  if (!(neighbor = neigh_find( p, &whotoldme, 0 )) || neighbor->scope == SCOPE_HOST) {
415
	    log( L_REMOTE "%s: %I send me routing info but he is not my neighbor", P_NAME, whotoldme );
412
	    log( L_REMOTE "%s: %I send me routing info but he is not my neighbor", p->name, whotoldme );
416 413
	    return 0;
417 414
	  }
418 415

  
......
622 619
  i = 0;
623 620
  FIB_WALK( &P->rtable, e ) {
624 621
    debug( "RIP: entry #%d: ", i++ );
625
    rip_dump_entry( E );
622
    rip_dump_entry( (struct rip_entry *)e );
626 623
  } FIB_WALK_END;
627 624
  i = 0;
628 625
  WALK_LIST( rif, P->interfaces ) {
......
700 697

  
701 698
  if (new) {
702 699
    if (new->addr->flags & IA_UNNUMBERED)
703
      log( L_WARN "%s: rip is not defined over unnumbered links", P_NAME );
700
      log( L_WARN "%s: rip is not defined over unnumbered links", p->name );
704 701
    if (rif->multicast) {
705 702
#ifndef IPV6
706 703
      rif->sock->daddr = ipa_from_u32(0xe0000009);
......
717 714

  
718 715
  if (!ipa_nonzero(rif->sock->daddr)) {
719 716
    if (rif->iface)
720
      log( L_WARN "%s: interface %s is too strange for me", P_NAME, rif->iface->name );
717
      log( L_WARN "%s: interface %s is too strange for me", p->name, rif->iface->name );
721 718
  } else if (sk_open(rif->sock)<0) {
722
    log( L_ERR "%s: could not create socket for %s", P_NAME, rif->iface ? rif->iface->name : "(dummy)" );
719
    log( L_ERR "%s: could not create socket for %s", p->name, rif->iface ? rif->iface->name : "(dummy)" );
723 720
    if (rif->iface) {
724 721
      rfree(rif->sock);
725 722
      mb_free(rif);
......
850 847
  if (old) {
851 848
    struct rip_entry *e = fib_find( &P->rtable, &net->n.prefix, net->n.pxlen );
852 849
    if (!e)
853
      log( L_BUG "%s: Deleting nonexistent entry?!", P_NAME );
850
      log( L_BUG "%s: Deleting nonexistent entry?!", p->name );
854 851
    fib_delete( &P->rtable, e );
855 852
  }
856 853

  
......
859 856
#if 0
860 857
    /* This can happen since feeding of protocols is asynchronous */
861 858
    if (fib_find( &P->rtable, &net->n.prefix, net->n.pxlen ))
862
      log( L_BUG "%s: Inserting entry which is already there?", P_NAME );
859
      log( L_BUG "%s: Inserting entry which is already there?", p->name );
863 860
#endif
864 861
    e = fib_get( &P->rtable, &net->n.prefix, net->n.pxlen );
865 862

  

Also available in: Unified diff