]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Minor updates.
authorOndrej Zajicek <santiago@crfreenet.org>
Mon, 14 Dec 2009 16:29:33 +0000 (17:29 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 14 Dec 2009 16:29:33 +0000 (17:29 +0100)
proto/ospf/lsack.c
proto/ospf/lsalib.c
proto/ospf/lsreq.c
proto/ospf/lsupd.c
proto/ospf/ospf.c
proto/ospf/rt.c
proto/ospf/topology.c

index a2189304954c8a1c7dcf9bade5135970f9f4dc72..c740ef69e9e7b64d859e5b7674840a59e5c52139 100644 (file)
@@ -172,12 +172,12 @@ ospf_lsack_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
       if ((lsa.sn == LSA_MAXSEQNO) && (lsa.age == LSA_MAXAGE))
        continue;
 
-      OSPF_TRACE(D_PACKETS, "Strange LS acknoledgement from %I", n->ip);
-      OSPF_TRACE(D_PACKETS, "Id: %R, Rt: %R, Type: 0x%04x",
-                lsa.id, lsa.rt, lsa.type);
-      OSPF_TRACE(D_PACKETS, "I have: Age: %4u, Seqno: 0x%08x, Sum: 0x%04x",
+      OSPF_TRACE(D_PACKETS, "Strange LSACK from %I", n->ip);
+      OSPF_TRACE(D_PACKETS, "Type: %04x, Id: %R, Rt: %R",
+                lsa.type, lsa.id, lsa.rt);
+      OSPF_TRACE(D_PACKETS, "I have: Age: %4u, Seq: %08x, Sum: %04x",
                 en->lsa.age, en->lsa.sn, en->lsa.checksum);
-      OSPF_TRACE(D_PACKETS, "He has: Age: %4u, Seqno: 0x%08x, Sum: 0x%04x",
+      OSPF_TRACE(D_PACKETS, "He has: Age: %4u, Seq: %08x, Sum: %04x",
                 lsa.age, lsa.sn, lsa.checksum);
       continue;
     }
index deb311362bf6281cc4ff581efa6eff7ae6b24d51..ab633984d75b0a873a7f13e7e39e8a8dfc76fc3d 100644 (file)
@@ -14,7 +14,7 @@ flush_lsa(struct top_hash_entry *en, struct proto_ospf *po)
   struct proto *p = &po->proto;
 
   OSPF_TRACE(D_EVENTS,
-            "Going to remove node Type: %u, Id: %R, Rt: %R, Age: %u, SN: 0x%x",
+            "Going to remove LSA Type: %04x, Id: %R, Rt: %R, Age: %u, Seqno: 0x%x",
             en->lsa.type, en->lsa.id, en->lsa.rt, en->lsa.age, en->lsa.sn);
   s_rem_node(SNODE en);
   if (en->lsa_body != NULL)
@@ -143,6 +143,7 @@ ntohlsab(void *n, void *h, u16 type, u16 len)
     hid[i] = ntohl(nid[i]);
 }
 
+/*
 void
 buf_dump(const char *hdr, const byte *buf, int blen)
 {
@@ -171,6 +172,7 @@ buf_dump(const char *hdr, const byte *buf, int blen)
   *bp = 0;
   log(L_WARN "%s\t%s", lhdr, b2);
 }
+*/
 
 #define MODX 4102              /* larges signed value without overflow */
 
index 49d3894420ac7a1f844570aa10569f07b2525713..0e360d75fa748a446d81ac460e659c1ca1cbd970 100644 (file)
@@ -28,8 +28,8 @@ static void ospf_dump_lsreq(struct proto *p, struct ospf_lsreq_packet *pkt)
     sizeof(struct ospf_lsreq_header);
 
   for (i = 0; i < j; i++)
-    log(L_TRACE "%s:     LSR      Id: %R, Rt: %R, Type: 0x%04x", p->name,
-       htonl(pkt->lsh[i].id), htonl(pkt->lsh[i].rt), htonl(pkt->lsh[i].type));
+    log(L_TRACE "%s:     LSR      Type: %04x, Id: %R, Rt: %R", p->name,
+       htonl(pkt->lsh[i].type), htonl(pkt->lsh[i].id), htonl(pkt->lsh[i].rt));
 }
 
 void
@@ -135,7 +135,7 @@ ospf_lsreq_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
     add_tail(&uplist, NODE llsh);
     if (ospf_hash_find(po->gr, dom, hid, hrt, htype) == NULL)
     {
-      log(L_WARN "Received bad LS req from: %I looking: Type: %u, ID: %R, RT: %R",
+      log(L_WARN "Received bad LSREQ from %I: Type: %04x, Id: %R, Rt: %R",
          n->ip, htype, hid, hrt);
       ospf_neigh_sm(n, INM_BADLSREQ);
       rfree(upslab);
index a49fded7df76286e2104db4636032799e4ff6c48..8780e700ed01d774d416025e7b25bcdd98d679c1 100644 (file)
@@ -22,8 +22,8 @@ void ospf_dump_lsahdr(struct proto *p, struct ospf_lsa_header *lsa_n)
   struct ospf_lsa_header lsa;
   ntohlsah(lsa_n, &lsa);
 
-  log(L_TRACE "%s:     LSA      Id: %R, Rt: %R, Type: 0x%04x, Age: %u, Seqno: 0x%08x, Sum: 0x%04x",
-      p->name, lsa.id, lsa.rt, lsa.type, lsa.age, lsa.sn, lsa.checksum);
+  log(L_TRACE "%s:     LSA      Type: %04x, Id: %R, Rt: %R, Age: %u, Seq: %08x, Sum: %04x",
+      p->name, lsa.type, lsa.id, lsa.rt, lsa.age, lsa.sn, lsa.checksum);
 }
 
 void ospf_dump_common(struct proto *p, struct ospf_packet *op)
@@ -561,8 +561,8 @@ ospf_lsupd_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
        lsatmp.sn = LSA_MAXSEQNO;
        lsa->age = htons(LSA_MAXAGE);
        lsa->sn = htonl(LSA_MAXSEQNO);
-       OSPF_TRACE(D_EVENTS, "Premature aging self originated lsa.");
-       OSPF_TRACE(D_EVENTS, "Type: %d, Id: %R, Rt: %R",
+       OSPF_TRACE(D_EVENTS, "Premature aging self originated LSA.");
+       OSPF_TRACE(D_EVENTS, "Type: %04x, Id: %R, Rt: %R",
                   lsatmp.type, lsatmp.id, lsatmp.rt);
        lsasum_check(lsa, (lsa + 1));   /* It also calculates chsum! */
        lsatmp.checksum = ntohs(lsa->checksum);
@@ -715,6 +715,6 @@ ospf_lsupd_flush_nlsa(struct proto_ospf *po, struct top_hash_entry *en)
   lsa->sn = LSA_MAXSEQNO;
   lsasum_calculate(lsa, en->lsa_body);
   OSPF_TRACE(D_EVENTS, "Premature aging self originated lsa!");
-  OSPF_TRACE(D_EVENTS, "Type: %d, Id: %R, Rt: %R", lsa->type, lsa->id, lsa->rt);
+  OSPF_TRACE(D_EVENTS, "Type: %04x, Id: %R, Rt: %R", lsa->type, lsa->id, lsa->rt);
   ospf_lsupd_flood(po, NULL, NULL, lsa, en->domain, 0);
 }
index 1befb7d2aaf4d80032af91ce8e54c24b22225c72..4c2f1c2a20b885f408f5f0ff54fa881525149a3e 100644 (file)
@@ -117,9 +117,9 @@ ospf_start(struct proto *p)
   struct ospf_area_config *ac;
   struct ospf_area *oa;
 
+  po->router_id = proto_get_router_id(p->cf);
   po->rfc1583 = c->rfc1583;
   po->ebit = 0;
-
   po->tick = c->tick;
   po->disp_timer = tm_new(p->pool);
   po->disp_timer->data = po;
@@ -1527,15 +1527,15 @@ ospf_sh_lsadb(struct proto *p)
 #endif
       }
       cli_msg(-1017, "");
-      cli_msg(-1017,"  Router ID       LS ID          Type   Age   Sequence Checksum");
+      cli_msg(-1017," Type   LS ID           Router           Age  Sequence  Checksum");
 
       last_dscope = dscope;
       last_domain = hea[i]->domain;
     }
 
 
-    cli_msg(-1017,"%-15R %-15R 0x%04x %5u 0x%08x 0x%04x",
-           lsa->rt, lsa->id, lsa->type, lsa->age, lsa->sn, lsa->checksum);
+    cli_msg(-1017," %04x  %-15R %-15R %5u  %08x    %04x",
+           lsa->type, lsa->id, lsa->rt, lsa->age, lsa->sn, lsa->checksum);
   }
   cli_msg(0, "");
 }
index 60e48cf8e94601a970ce8e05ce7937dba4553299..ae815b3ca57cd804052ea80ce10acd06660430c8 100644 (file)
@@ -868,8 +868,8 @@ ospf_ext_spf(struct proto_ospf *po)
 
     if (pxlen < 0)
     {
-      log("%s: Invalid mask in LSA. ID: %R, RT: %R, Type: %u",
-         p->name, en->lsa.id, en->lsa.rt, en->lsa.type);
+      log(L_WARN "%s: Invalid mask in LSA (Type: %04x, Id: %R, Rt: %R)",
+         p->name, en->lsa.type, en->lsa.id, en->lsa.rt);
       continue;
     }
     nhi = NULL;
index 231db134721e31636412788ecbf4ba282ab09877..46656811af1beb7bd78b53446662247f6d88dc2c 100644 (file)
@@ -472,7 +472,6 @@ static void *
 originate_net_lsa_body(struct ospf_iface *ifa, u16 *length,
                       struct proto_ospf *po)
 {
-  u32 rid = proto_get_router_id(po->proto.cf);
   u16 i = 1;
   struct ospf_neighbor *n;
   struct ospf_lsa_net *net;