Revision eb4097e4 proto/rip/rip.c

View differences:

proto/rip/rip.c
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.
18

  
19
	FIXME: ea_find can return NULL
20 18
 */
21 19

  
22 20
/**
......
76 74
{
77 75
  struct rip_connection *c = s->data;
78 76
  struct proto *p = c->proto;
79
  log( L_ERR "Unexpected error at rip transmit: %M", err );
77
  log( L_ERR "%s: Unexpected error at rip transmit: %M", P_NAME, err );
80 78
}
81 79

  
82 80
static int
......
191 189
  static int num = 0;
192 190

  
193 191
  if (rif->busy) {
194
    log (L_WARN "Interface %s is much too slow, dropping request", iface->name);
192
    log (L_WARN "%s: Interface %s is much too slow, dropping request", P_NAME, iface->name);
195 193
    return;
196 194
  }
197 195
  c = mb_alloc( p->pool, sizeof( struct rip_connection ));
......
208 206
    bug("not enough send magic");
209 207
#if 0
210 208
  if (sk_open(c->send)<0) {
211
    log( L_ERR "Could not open socket for data send to %I:%d on %s", daddr, dport, rif->iface->name );
209
    log( L_ERR "%s Could not open socket for data send to %I:%d on %s", P_NAME, daddr, dport, rif->iface->name );
212 210
    return;
213 211
  }
214 212
#endif
......
280 278

  
281 279
  neighbor = neigh_find( p, &A.gw, 0 );
282 280
  if (!neighbor) {
283
    log( L_REMOTE "%I asked me to route %I/%d using not-neighbor %I.", A.from, b->network, pxlen, A.gw );
281
    log( L_REMOTE "%s: %I asked me to route %I/%d using not-neighbor %I.", p->name, A.from, b->network, pxlen, A.gw );
284 282
    return;
285 283
  }
286 284

  
......
296 294
  /* set to: interface of nexthop */
297 295
  a = rta_lookup(&A);
298 296
  if (pxlen==-1)  {
299
    log( L_REMOTE "%I gave me invalid pxlen/netmask for %I.", A.from, b->network );
297
    log( L_REMOTE "%s: %I gave me invalid pxlen/netmask for %I.", p->name, A.from, b->network );
300 298
    return;
301 299
  }
302 300
  n = net_get( p->table, b->network, pxlen );
......
325 323
    if (metric == 0xff)
326 324
      { debug( "IpV6 nexthop ignored" ); return; }
327 325
#endif
328
    log( L_WARN "Got metric %d from %I", metric, whotoldme );
326
    log( L_WARN "%s: Got metric %d from %I", P_NAME, metric, whotoldme );
329 327
    return;
330 328
  }
331 329

  
......
348 346

  
349 347
  switch( packet->heading.command ) {
350 348
  case RIPCMD_REQUEST: DBG( "Asked to send my routing table\n" ); 
351
	  if (P_CF->honor == HO_NEVER) {
352
	    log( L_REMOTE "They asked me to send routing table, but I was told not to do it" );
353
	    return 0;
354
	  }
355
	  if ((P_CF->honor == HO_NEIGHBOR) && (!neigh_find( p, &whotoldme, 0 ))) {
356
	    log( L_REMOTE "They asked me to send routing table, but he is not my neighbor" );
357
	    return 0;
358
	  }
349
	  if (P_CF->honor == HO_NEVER)
350
	    BAD( "They asked me to send routing table, but I was told not to do it" );
351

  
352
	  if ((P_CF->honor == HO_NEIGHBOR) && (!neigh_find( p, &whotoldme, 0 )))
353
	    BAD( "They asked me to send routing table, but he is not my neighbor" );
359 354
    	  rip_sendto( p, whotoldme, port, HEAD(P->interfaces) ); /* no broadcast */
360 355
          break;
361 356
  case RIPCMD_RESPONSE: DBG( "*** Rtable from %I\n", whotoldme ); 
362 357
          if (port != P_CF->port) {
363
	    log( L_REMOTE "%I send me routing info from port %d", whotoldme, port );
364
	    return 0;
358
	    log( L_REMOTE "%s: %I send me routing info from port %d", P_NAME, whotoldme, port );
359
	    return 1;
365 360
	  }
366 361

  
367 362
	  if (!neigh_find( p, &whotoldme, 0 )) {
368
	    log( L_REMOTE "%I send me routing info but he is not my neighbor", whotoldme );
363
	    log( L_REMOTE "%s: %I send me routing info but he is not my neighbor", P_NAME, whotoldme );
369 364
	    return 0;
370 365
	  }
371 366

  
......
771 766
  if (old) {
772 767
    struct rip_entry *e = fib_find( &P->rtable, &net->n.prefix, net->n.pxlen );
773 768
    if (!e)
774
      log( L_BUG "Deleting nonexistent entry?!" );
769
      log( L_BUG "%s: Deleting nonexistent entry?!", P_NAME );
775 770
    fib_delete( &P->rtable, e );
776 771
  }
777 772

  
......
780 775
#if 0
781 776
    /* This can happen since feeding of protocols is asynchronous */
782 777
    if (fib_find( &P->rtable, &net->n.prefix, net->n.pxlen ))
783
      log( L_BUG "Inserting entry which is already there?" );
778
      log( L_BUG "%s: Inserting entry which is already there?", P_NAME );
784 779
#endif
785 780
    e = fib_get( &P->rtable, &net->n.prefix, net->n.pxlen );
786 781

  

Also available in: Unified diff