summaryrefslogtreecommitdiffstats
path: root/proto/rip/rip.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2000-05-10 14:46:47 +0200
committerPavel Machek <pavel@ucw.cz>2000-05-10 14:46:47 +0200
commit0bff946c0a29469b669939813e5a2861c1f010fb (patch)
treec6549b05fe09244e76bc1985f539095b8804606e /proto/rip/rip.c
parent6f3849774ffe35e445e33ba03f041c1a84ba35f1 (diff)
downloadbird-0bff946c0a29469b669939813e5a2861c1f010fb.tar
bird-0bff946c0a29469b669939813e5a2861c1f010fb.zip
Nicer messages from rip.
Diffstat (limited to 'proto/rip/rip.c')
-rw-r--r--proto/rip/rip.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index edbc9c3..dd76ef8 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -215,7 +215,7 @@ rip_sendto( struct proto *p, ip_addr daddr, int dport, struct rip_interface *rif
c->done = 0;
fit_init( &c->iter, &P->rtable );
add_head( &P->connections, NODE c );
- TRACE(D_PACKETS, "Sending my routing table to %I:%d on %s\n", daddr, dport, rif->iface->name );
+ TRACE(D_PACKETS, "Sending my routing table to %I:%d on %s", daddr, dport, rif->iface->name );
rip_tx(c->rif->sock);
}
@@ -355,20 +355,12 @@ rip_process_packet( struct proto *p, struct rip_packet *packet, int num, ip_addr
case RIPCMD_RESPONSE: DBG( "*** Rtable from %I\n", whotoldme );
if (port != P_CF->port) {
log( L_REMOTE "%I send me routing info from port %d", whotoldme, port );
-#if 0
return 0;
-#else
- log( L_REMOTE "...ignoring" );
-#endif
}
if (!neigh_find( p, &whotoldme, 0 )) {
log( L_REMOTE "%I send me routing info but he is not my neighbor", whotoldme );
-#if 0
return 0;
-#else
- log( L_REMOTE "...ignoring" );
-#endif
}
for (i=0; i<num; i++) {
@@ -420,6 +412,11 @@ rip_rx(sock *s, int size)
num = size / sizeof( struct rip_block );
if (num>PACKET_MAX) BAD( "Too many blocks" );
+ if (ipa_same(i->iface->addr->ip, s->faddr)) {
+ DBG("My own packet\n");
+ return 1;
+ }
+
rip_process_packet( p, (struct rip_packet *) s->rbuf, num, s->faddr, s->fport );
return 1;
}
@@ -449,7 +446,9 @@ rip_timer(timer *t)
WALK_LIST_DELSAFE( e, et, P->garbage ) {
rte *rte;
rte = SKIP_BACK( struct rte, u.rip.garbage, e );
+#ifdef LOCAL_DEBUG
DBG( "Garbage: " ); rte_dump( rte );
+#endif
if (now - rte->u.rip.lastmodX > P_CF->timeout_time) {
TRACE(D_EVENTS, "RIP: entry is too old: %I", rte->net->n.prefix );