]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
RIP _NOW_ actually talks to itself (workaround core bug: send data
authorPavel Machek <pavel@ucw.cz>
Tue, 20 Oct 1998 16:45:53 +0000 (16:45 +0000)
committerPavel Machek <pavel@ucw.cz>
Tue, 20 Oct 1998 16:45:53 +0000 (16:45 +0000)
from other port than we receive at), few FIXME's added.

proto/rip/rip.c

index 173b70178c431717cb0e9ca6791c18131f2c633e..e65ac3886eadc9ef5d39bcc770182710b82f4f66 100644 (file)
@@ -135,6 +135,7 @@ givemore:
 
   if (!(NODE c->sendptr)->next) {
     debug( "Looks like I'm done\n" );
+    /* FIXME: we have to kill that socket & connection NOW! */
     return;
   }
 
@@ -182,13 +183,15 @@ rip_sendto( struct proto *p, ip_addr daddr, int dport, struct iface *iface )
   struct rip_connection *c = mb_alloc( p->pool, sizeof( struct rip_connection ));
   static int num = 0;
 
+  /* FIXME: maybe we should not send when we are already sending? */
+  
   c->addr = daddr;
   c->proto = p;
   c->num = num++;
 
   c->send = sk_new( p->pool );
   c->send->type = SK_UDP;
-  c->send->sport = RIP_PORT;
+  c->send->sport = RIP_PORT+1; /* BIG FIXME: have to talk from RIP_PORT */
   c->send->dport = dport;
   c->send->daddr = daddr;
   c->send->rx_hook = NULL;
@@ -302,14 +305,18 @@ rip_process_packet( struct proto *p, struct rip_packet *packet, int num, ip_addr
   case RIPCMD_REQUEST: debug( "Asked to send my routing table\n" ); 
          rip_sendto( p, whotoldme, port, NULL ); /* no broadcast */
           break;
-  case RIPCMD_RESPONSE: debug( "Part of routing table came\n" ); 
+  case RIPCMD_RESPONSE: debug( "*** Part of routing table came from %I\n", whotoldme ); 
           if (port != RIP_PORT) {
-           log( L_AUTH "%I send me routing info from port %d\n", whotoldme, port );
+           log( L_ERR "%I send me routing info from port %d\n", whotoldme, port );
+#if 0
            return 0;
+#else
+           log( L_ERR "...ignoring\n" );
+#endif
          }
 
          if (!neigh_find( p, &whotoldme, 0 )) {
-           log( L_AUTH "%I send me routing info but he is not my neighbour\n", whotoldme );
+           log( L_ERR "%I send me routing info but he is not my neighbour\n", whotoldme );
            return 0;
          }