]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Some fixes and update of OSPF debug messages
authorOndrej Zajicek <santiago@crfreenet.org>
Sun, 11 Jan 2009 11:14:27 +0000 (12:14 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Sun, 11 Jan 2009 11:14:27 +0000 (12:14 +0100)
proto/ospf/dbdes.c
proto/ospf/iface.c
proto/ospf/lsreq.c
proto/ospf/lsupd.c
proto/ospf/neighbor.c
proto/ospf/topology.c

index 7f181fb63fdbfd837fe2c688a8de5b3a2a646855..2c5077b9b11016789b8c0ae3ceba3fd6aaa1a6cf 100644 (file)
@@ -148,7 +148,7 @@ ospf_dbdes_send(struct ospf_neighbor *n)
     OSPF_TRACE(D_PACKETS, "DB_DES (M) sent to %I via %s.", n->ip,
               ifa->iface->name);
 
-    DBG("DB_DES PS=%u, M=%u.", ntohl(pkt->ddseq), pkt->imms.bit.m);
+    DBG("DB_DES PS=%u, M=%u\n", ntohl(pkt->ddseq), pkt->imms.bit.m);
 
     if (!n->myimms.bit.ms)
     {
@@ -210,7 +210,7 @@ ospf_dbdes_receive(struct ospf_dbdes_packet *ps,
   OSPF_TRACE(D_PACKETS, "Received dbdes from %I via %s.", n->ip,
             ifa->iface->name);
 
-  DBG("DB_DES PS=%u, M=%u SIZE=%u.", ntohl(ps->ddseq), ps->imms.bit.m, size);
+  DBG("DB_DES PS=%u, M=%u SIZE=%u\n", ntohl(ps->ddseq), ps->imms.bit.m, size);
 
   ospf_neigh_sm(n, INM_HELLOREC);
 
@@ -349,7 +349,7 @@ ospf_dbdes_receive(struct ospf_dbdes_packet *ps,
     {
       OSPF_TRACE(D_PACKETS, "dbdes - sequence mismatch neighbor %I (full)",
                 n->ip);
-      DBG("PS=%u, DDR=%u, DDS=%u", ntohl(ps->ddseq), n->ddr, n->dds);
+      DBG("PS=%u, DDR=%u, DDS=%u\n", ntohl(ps->ddseq), n->ddr, n->dds);
       ospf_neigh_sm(n, INM_SEQMIS);
     }
     break;
index d5d068b14762861e2aa7bf927137061b787ffbc6..a4c974131012c1c9a13bc3f09ac3910b6dd8b55f 100644 (file)
@@ -230,7 +230,7 @@ ospf_iface_sm(struct ospf_iface *ifa, int event)
 {
   struct ospf_area *oa = ifa->oa;
 
-  DBG("SM on iface %s. Event is \"%s\".", ifa->iface->name, ospf_ism[event]);
+  DBG("SM on iface %s. Event is '%s'\n", ifa->iface->name, ospf_ism[event]);
 
   switch (event)
   {
index 774efe20418abad73d459dcaff800dae3bb03e71..f43a08fe7af556e8356b96807cdc63b0cf8d3c27 100644 (file)
@@ -45,8 +45,8 @@ ospf_lsreq_send(struct ospf_neighbor *n)
     lsh->type = en->lsa.type;
     lsh->rt = htonl(en->lsa.rt);
     lsh->id = htonl(en->lsa.id);
-    DBG("Requesting %uth LSA: Type: %u, Id: %I, RT: %I\n", i, en->lsa.type,
-       en->lsa.id, en->lsa.rt);
+    DBG("Requesting %uth LSA: Type: %u, ID: %I, RT: %I, SN: 0x%x, Age %u\n",
+       i, en->lsa.type, en->lsa.id, en->lsa.rt, en->lsa.sn, en->lsa.age);
     lsh++;
     if (sn == STAIL(n->lsrql))
       break;
@@ -93,7 +93,7 @@ ospf_lsreq_receive(struct ospf_lsreq_packet *ps,
   {
     u32 hid = ntohl(lsh->id);
     u32 hrt = ntohl(lsh->rt);
-    DBG("Processing LSA: ID=%I, Type=%u, Router=%I\n", hid, lsh->type, hrt);
+    DBG("Processing requested LSA: Type: %u, ID: %I, RT: %I\n", lsh->type, hid, hrt);
     llsh = sl_alloc(upslab);
     llsh->lsh.id = hid;
     llsh->lsh.rt = hrt;
@@ -103,8 +103,8 @@ ospf_lsreq_receive(struct ospf_lsreq_packet *ps,
                       llsh->lsh.type) == NULL)
     {
       log(L_WARN
-         "Received bad LS req from: %I looking: RT: %I, ID: %I, Type: %u",
-         n->ip, hrt, hid, lsh->type);
+         "Received bad LS req from: %I looking: Type: %u, ID: %I, RT: %I",
+         n->ip, lsh->type, hid, hrt);
       ospf_neigh_sm(n, INM_BADLSREQ);
       rfree(upslab);
       return;
index 9f7dd638cfa48c0b4488d43eb6a88e08e6d1e512..76d4e6aedb1fcc50168ebe39df7e19c47cf03f5f 100644 (file)
@@ -50,6 +50,10 @@ ospf_lsupd_flood(struct ospf_neighbor *n, struct ospf_lsa_header *hn,
       if (ifa->oa != oa)
         continue;
     }
+
+    DBG("Wanted to flood LSA: Type: %u, ID: %I, RT: %I, SN: 0x%x, Age %u\n",
+       hh->type, hh->id, hh->rt, hh->sn, hh->age);
+
     ret = 0;
     WALK_LIST(nn, ifa->neigh_list)
     {
@@ -59,6 +63,8 @@ ospf_lsupd_flood(struct ospf_neighbor *n, struct ospf_lsa_header *hn,
       {
        if ((en = ospf_hash_find_header(nn->lsrqh, nn->ifa->oa->areaid, hh)) != NULL)
        {
+         DBG("That LSA found in lsreq list for neigh %I\n", nn->rid);
+
          switch (lsa_comp(hh, &en->lsa))
          {
          case CMP_OLDER:
@@ -106,8 +112,7 @@ ospf_lsupd_flood(struct ospf_neighbor *n, struct ospf_lsa_header *hn,
        }
        s_add_tail(&nn->lsrtl, SNODE en);
        memcpy(&en->lsa, hh, sizeof(struct ospf_lsa_header));
-       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);
+       DBG("Adding that LSA for flood to %I\n", nn->ip);
       }
       else
       {
@@ -245,8 +250,8 @@ ospf_lsupd_send_list(struct ospf_neighbor *n, list * l)
       continue;                        /* Probably flushed LSA */
     /* FIXME This is a bug! I cannot flush LSA that is in lsrt */
 
-    DBG("Sending ID=%I, Type=%u, RT=%I Sn: 0x%x Age: %u\n",
-       llsh->lsh.id, llsh->lsh.type, llsh->lsh.rt, en->lsa.sn, en->lsa.age);
+    DBG("Sending LSA: Type=%u, ID=%I, RT=%I, SN: 0x%x, Age: %u\n",
+       llsh->lsh.type, llsh->lsh.id, llsh->lsh.rt, en->lsa.sn, en->lsa.age);
     if (((u32) (len + en->lsa.length)) > ospf_pkt_maxsize(n->ifa))
     {
       pk->lsano = htonl(lsano);
index 7696d45e34b5f7299bdaf1252c5492d6ff3c766f..b904874d32c565d7df7a95286f95284361516837 100644 (file)
@@ -293,7 +293,7 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event)
   struct proto_ospf *po = n->ifa->oa->po;
   struct proto *p = &po->proto;
 
-  DBG("Neighbor state machine for neighbor %I, event \"%s\".", n->ip,
+  DBG("Neighbor state machine for neighbor %I, event '%s'\n", n->ip,
             ospf_inm[event]);
 
   switch (event)
@@ -600,10 +600,11 @@ void
 rxmt_timer_hook(timer * timer)
 {
   struct ospf_neighbor *n = (struct ospf_neighbor *) timer->data;
+  struct proto *p = &n->ifa->oa->po->proto;
   struct top_hash_entry *en;
 
   DBG("%s: RXMT timer fired on interface %s for neigh: %I.\n",
-      p->name, ifa->iface->name, n->ip);
+      p->name, n->ifa->iface->name, n->ip);
 
   if(n->state < NEIGHBOR_EXSTART) return;
 
index 9b2befbbc41a6ab02e0016143d74f65ae5df9657..c3f70fd35308df6d27edb61d27d0ad66fa032e3d 100644 (file)
@@ -539,9 +539,9 @@ check_sum_lsa(struct proto_ospf *po, ort *nf, int dest)
   if ((nf->n.type > RTS_OSPF_IA) && (nf->o.type > RTS_OSPF_IA)) return;
 
 #ifdef LOCAL_DEBUG
-  DBG("Checking...dest = %d, %I/%d", dest, nf->fn.prefix, nf->fn.pxlen);
-  if (nf->n.oa) DBG("New: met=%d, oa=%d", nf->n.metric1, nf->n.oa->areaid);
-  if (nf->o.oa) DBG("Old: met=%d, oa=%d", nf->o.metric1, nf->o.oa->areaid);
+  DBG("Checking...dest = %d, %I/%d\n", dest, nf->fn.prefix, nf->fn.pxlen);
+  if (nf->n.oa) DBG("New: met=%d, oa=%d\n", nf->n.metric1, nf->n.oa->areaid);
+  if (nf->o.oa) DBG("Old: met=%d, oa=%d\n", nf->o.metric1, nf->o.oa->areaid);
 #endif
 
   WALK_LIST(oa, po->area_list)