]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Another LSack update. It's still NOT correct and it surely
authorOndrej Filip <feela@network.cz>
Tue, 18 Apr 2000 17:00:56 +0000 (17:00 +0000)
committerOndrej Filip <feela@network.cz>
Tue, 18 Apr 2000 17:00:56 +0000 (17:00 +0000)
kills gated or Cyclades OSPF implementation. :-)

proto/ospf/lsack.c

index 53346bc2794350c23ac2fc91ce327c3504e1c117..1006cf6b9f800033a12737d44f52999d06a1ac47 100644 (file)
@@ -17,6 +17,8 @@ ospf_lsack_direct_tx(struct ospf_neighbor *n,struct ospf_lsa_header *h)
   sock *sk=n->ifa->ip_sk;
   u16 len;
 
+  DBG("Sending direct ACK to %I\n",n->rid);
+
   pk=(struct ospf_lsack_packet *)sk->tbuf;
   op=(struct ospf_packet *)sk->tbuf;
 
@@ -38,7 +40,7 @@ ospf_lsa_delay(struct ospf_neighbor *n,struct ospf_lsa_header *h,
   no=mb_alloc(p->pool,sizeof(struct lsah_n));
   memcpy(&no->lsa,h,sizeof(struct ospf_lsa_header));
   add_tail(&n->ackl, NODE no);
-
+  DBG("Adding delay ack for %I\n",n->rid);
 }
 
 void
@@ -59,6 +61,8 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
   struct lsah_n *no;
   struct ospf_iface *ifa=n->ifa;
 
+  DBG("Sending delay ack to %I\n", n->rid);
+
   if(ifa->type==OSPF_IT_BCAST)
   {
     sk=ifa->hello_sk;
@@ -79,8 +83,10 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
     no=(struct lsah_n *)HEAD(n->ackl);
     memcpy(h+i,&no->lsa, sizeof(struct ospf_lsa_header));
     i++;
-    rem_node(NODE n);
-    if((i*sizeof(struct ospf_lsa_header)+sizeof(struct ospf_lsack_packet)-SIPH)>
+    DBG("Iter %u ID: %I, RT: %I, Type: %u\n",i, ntohl((h+i)->id),
+      ntohl((h+i)->rt),(h+i)->type);
+    rem_node(NODE no);
+    if((i*sizeof(struct ospf_lsa_header)+sizeof(struct ospf_lsack_packet)+SIPH)>
       n->ifa->iface->mtu)
     {
       if(!EMPTY_LIST(n->ackl))
@@ -88,6 +94,7 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
         len=sizeof(struct ospf_lsack_packet)+i*sizeof(struct ospf_lsa_header);
        op->length=htons(len);
        ospf_pkt_finalize(n->ifa, op);
+       DBG("Sending! Len=%u\n",len);
         if(ifa->type==OSPF_IT_BCAST)
        {
           if((ifa->state==OSPF_IS_DR)||(ifa->state==OSPF_IS_BACKUP))
@@ -103,9 +110,7 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
        {
           sk_send_to_agt(sk, len, ifa, NEIGHBOR_EXCHANGE);
        }
-
        fill_ospf_pkt_hdr(n->ifa, pk, LSUPD);
-       h=(struct ospf_lsa_header *)(pk+1);
        i=0;
       }
     }
@@ -114,6 +119,7 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
   len=sizeof(struct ospf_lsack_packet)+i*sizeof(struct ospf_lsa_header);
   op->length=htons(len);
   ospf_pkt_finalize(n->ifa, op);
+  DBG("Sending! Len=%u\n",len);
   if(ifa->type==OSPF_IT_BCAST)
   {
     if((ifa->state==OSPF_IS_DR)||(ifa->state==OSPF_IS_BACKUP))