Debug cleanup.
Retransmiting of unacknolegded LSAs
n=(struct ospf_neighbor *)timer->data;
ifa=n->ifa;
p=(struct proto *)(ifa->proto);
- debug("%s: RXMT timer fired on interface %s for neigh: %I.\n",
+ DBG("%s: RXMT timer fired on interface %s for neigh: %I.\n",
p->name, ifa->iface->name, n->rid);
if(n->state<NEIGHBOR_LOADING) ospf_dbdes_tx(n);
else
ifa=(struct ospf_iface *)timer->data;
p=(struct proto *)(ifa->proto);
- debug("%s: Hello timer fired on interface %s.\n",
+ DBG("%s: Hello timer fired on interface %s.\n",
p->name, ifa->iface->name);
/* Now we should send a hello packet */
/* First a common packet header */
struct ospf_packet *op;
struct ospf_lsack_packet *pk;
sock *sk=n->ifa->ip_sk;
+ struct proto *p=&n->ifa->proto->proto;
u16 len;
DBG("Sending direct ACK to %I for Type: %u, ID: %I, RT: %I\n",n->rid,
op->length=htons(len);
ospf_pkt_finalize(n->ifa, op);
sk_send_to(sk,len, n->ip, OSPF_PROTO);
+ debug("%s: LS ack sent to %I\n", p->name, n->ip);
}
void
if((n=find_neigh(ifa, nrid))==NULL)
{
- debug("%s: Received lsack from unknown neigbor! (%I)\n", p->name,
+ debug("%s: Received LS ack from unknown neigbor! (%I)\n", p->name,
nrid);
return ;
}
if(n->state<NEIGHBOR_EXCHANGE) return;
-
+
+ debug("%s: Received LS ack from %I\n", p->name,
+ n->ip);
+
nolsa=(ntohs(ps->ospf_packet.length)-sizeof(struct ospf_lsack_packet))/
sizeof(struct ospf_lsa_header);
DBG("Received %d lsa ack(s)\n",nolsa);
if(lsa_comp(&lsa,&en->lsa)!=CMP_SAME)
{
log("Strange LS acknoledgement from %I",n->rid);
+ log("Id: %I, Rt: %I, Type: %u",lsa.id, lsa.rt, lsa.type);
+ log("I have: Age: %u, Seqno: %u", en->lsa.age, en->lsa.sn);
+ log("He has: Age: %u, Seqno: %u", lsa.age, lsa.sn);
continue;
}
struct ospf_lsreq_header *lsh;
u16 length;
int i,j;
+ struct proto *p=&n->ifa->proto->proto;
pk=(struct ospf_lsreq_packet *)n->ifa->ip_sk->tbuf;
op=(struct ospf_packet *)n->ifa->ip_sk->tbuf;
op->length=htons(length);
ospf_pkt_finalize(n->ifa, op);
sk_send_to(n->ifa->ip_sk,length, n->ip, OSPF_PROTO);
- DBG("Lsreq send to: %I\n", n->rid);
+ debug("%s: LS request sent to: %I\n", p->name, n->rid);
}
void
struct ospf_iface *ifa;
struct proto *p;
struct ospf_neighbor *n;
+ struct top_hash_entry *en;
n=(struct ospf_neighbor *)timer->data;
ifa=n->ifa;
p=(struct proto *)(ifa->proto);
- debug("%s: LSRR timer fired on interface %s for neigh: %I.\n",
+
+ DBG("%s: LSRR timer fired on interface %s for neigh: %I.\n",
p->name, ifa->iface->name, n->rid);
if(n->state<NEIGHBOR_FULL) ospf_lsreq_tx(n);
else
{
- int i; /* FIXME Retransmit lsupd again */
+ if(!EMPTY_SLIST(n->lsrtl))
+ {
+ list uplist;
+ slab *upslab;
+ struct l_lsr_head *llsh;
+
+ init_list(&uplist);
+ upslab=sl_new(p->pool,sizeof(struct l_lsr_head));
+
+ WALK_SLIST(SNODE en,n->lsrtl)
+ {
+ if((SNODE en)->next==(SNODE en)) die("BUGGGGGG");
+ llsh=sl_alloc(upslab);
+ llsh->lsh.id=en->lsa.id;
+ llsh->lsh.rt=en->lsa.rt;
+ llsh->lsh.type=en->lsa.type;
+ DBG("Working on ID: %I, RT: %I, Type: %u\n",en->lsa.id,en->lsa.rt,en->lsa.type);
+ add_tail(&uplist, NODE llsh);
+ }
+ ospf_lsupd_tx_list(n, &uplist);
+ rfree(upslab);
+ }
}
}
if((n=find_neigh(ifa, nrid))==NULL)
{
- debug("%s: Received lsreq from unknown neigbor! (%I)\n", p->name,
+ debug("%s: Received lsreq from unknown neighbor! (%I)\n", p->name,
nrid);
return ;
}
- if(n->state<NEIGHBOR_EXCHANGE) debug("%s: Ignoring it.\n", p->name);
+ if(n->state<NEIGHBOR_EXCHANGE) return;
+
+ debug("%s: Received LS req from neighbor: %I\n",p->name, n->ip);
length=htons(ps->ospf_packet.length);
lsh=(void *)(ps+1);
}
}
if(nn==n) continue;
- en=ospf_hash_get_header(nn->lsrth, hh);
+ if((en=ospf_hash_find_header(nn->lsrth, hh))==NULL)
+ {
+ en=ospf_hash_get_header(nn->lsrth, hh);
+ }
+ else
+ {
+ s_rem_node(SNODE en);
+ }
s_add_tail(&nn->lsrtl, SNODE en);
ret=1;
+ DBG("Adding LSA lsrt RT: %I, Id: %I, Type: %u for n: %I\n",
+ en->lsa.rt,en->lsa.id, en->lsa.type, nn->ip);
}
if(ret==0) continue;
if(ifa==iff)
struct top_hash_entry *en;
struct ospf_lsupd_packet *pk;
struct ospf_packet *op;
+ struct proto *p=&n->ifa->oa->po->proto;
void *pktpos;
u8 ii;
u8 *jj=n->ifa->ip_sk->tbuf;
op->length=htons(len);
ospf_pkt_finalize(n->ifa, op);
- for(ii=0;ii<(len-SIPH);ii+=4)
- DBG("Out dump: %d,%d,%d,%d\n", *(jj+ii), *(jj+ii+1), *(jj+ii+2), *(jj+ii+3));
-
sk_send_to(n->ifa->ip_sk,len, n->ip, OSPF_PROTO);
+ debug("%s: LS upd sent to %I\n", p->name, n->ip);
DBG("LSupd: next packet\n");
fill_ospf_pkt_hdr(n->ifa, pk, LSUPD);
DBG("Out dump: %d,%d,%d,%d\n", *(jj+ii), *(jj+ii+1), *(jj+ii+2), *(jj+ii+3));
sk_send_to(n->ifa->ip_sk,len, n->ip, OSPF_PROTO);
- DBG("LSupd: sent\n");
+ debug("%s: LS upd sent to %I\n", p->name, n->ip);
}
void
return;
}
+ debug("%s: Received LS upd from (%I)\n", p->name, n->ip);
+
lsa=(struct ospf_lsa_header *)(ps+1);
area=htonl(ps->ospf_packet.areaid);
oa=ospf_find_area((struct proto_ospf *)p,area);
#include "conf/conf.h"
#include "lib/string.h"
-#define LOCAL_DEBUG
-
#define OSPF_PROTO 89
#ifndef IPV6
#define OSPF_VERSION 2
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-#define LOCAL_DEBUG
-
#include "nest/bird.h"
#include "lib/string.h"
struct top_hash_entry *old;
struct proto_ospf *po=(struct proto_ospf *)p;
- DBG("%s: Originating RT_lsa body for area \"%I\".\n", po->proto.name, oa->areaid);
+ DBG("%s: Originating RT_lsa body for area \"%I\".\n", po->proto.name,
+ oa->areaid);
- WALK_LIST (ifa, p->iface_list) i++;
+ WALK_LIST (ifa, p->iface_list)
{
if((ifa->an==oa->areaid) && (ifa->state!=OSPF_IS_DOWN))
{
struct top_hash_entry *en;
void *body;
- DBG("%s: Originating RT_lsa for area \"%I\".\n", po->proto.name, oa->areaid);
+ debug("%s: Originating RT_lsa for area \"%I\".\n",po->proto.name,oa->areaid);
lsa.age=0;
lsa.id=rtid;
if(ifa->state!=OSPF_IS_DR) return;
- DBG("%s: Originating Net lsa for iface \"%s\".\n", po->proto.name, ifa->iface->name);
+ debug("%s: Originating Net lsa for iface \"%s\".\n", po->proto.name,
+ ifa->iface->name);
if(ifa->fadj==0)
{