]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Many %u changed into %I and dump cleanup.
authorOndrej Filip <feela@network.cz>
Tue, 18 Apr 2000 18:21:10 +0000 (18:21 +0000)
committerOndrej Filip <feela@network.cz>
Tue, 18 Apr 2000 18:21:10 +0000 (18:21 +0000)
proto/ospf/hello.c
proto/ospf/neighbor.c

index aea9c142aaa605a558d6cd80ecd479067695a1c1..566c36fc8f45f1dd5fbd35d051aa3c82a65b4a62 100644 (file)
@@ -50,49 +50,41 @@ void
 ospf_hello_rx(struct ospf_hello_packet *ps, struct proto *p,
   struct ospf_iface *ifa, int size, ip_addr faddr)
 {
-  char sip[100]; /* FIXME: Should be smaller */
   u32 nrid, *pnrid;
   struct ospf_neighbor *neigh,*n;
   u8 i,twoway;
+  char *beg=": Bad OSPF hello packet from ", *rec=" received: ";
 
   nrid=ntohl(((struct ospf_packet *)ps)->routerid);
 
   if((unsigned)ipa_mklen(ipa_ntoh(ps->netmask))!=ifa->iface->addr->pxlen)
   {
-    ip_ntop(ps->netmask,sip);
-    log("%s: Bad OSPF packet from %u received: bad netmask %s.",
-      p->name, nrid, sip);
-    log("%s: Discarding",p->name);
+    log("%s%s%I%s%Ibad netmask %I.\n", p->name, beg, nrid, rec,
+      ipa_ntoh(ps->netmask));
     return;
   }
   
   if(ntohs(ps->helloint)!=ifa->helloint)
   {
-    log("%s: Bad OSPF packet from %u received: hello interval mismatch.",
-      p->name, nrid);
-    log("%s: Discarding",p->name);
+    log("%s%s%I%shello interval mismatch.\n", p->name, beg, nrid, rec);
     return;
   }
 
   if(ntohl(ps->deadint)!=ifa->helloint*ifa->deadc)
   {
-    log("%s: Bad OSPF packet from %u received: dead interval mismatch.",
-      p->name, nrid);
-    log("%s: Discarding",p->name);
+    log("%s%s%I%sdead interval mismatch.\n", p->name, beg, nrid, rec);
     return;
   }
 
   if(ps->options!=ifa->options)
   {
-    log("%s: Bad OSPF packet from %u received: options mismatch.",
-      p->name, nrid);  /* FIXME: This not good */
-    log("%s: Discarding",p->name);
+    log("%s%s%I%soptions mismatch.\n", p->name, beg, nrid, rec);
     return;
   }
 
   if((n=find_neigh(ifa, nrid))==NULL)
   {
-    log("%s: New neighbor found: %u.", p->name,nrid);
+    log("%s: New neighbor found: %I.", p->name,nrid);
     n=mb_alloc(p->pool, sizeof(struct ospf_neighbor));
     add_tail(&ifa->neigh_list, NODE n);
     n->rid=nrid;
@@ -135,7 +127,7 @@ ospf_hello_rx(struct ospf_hello_packet *ps, struct proto *p,
   {
     if(ntohl(*(pnrid+i))==p->cf->global->router_id)
     {
-      DBG("%s: Twoway received. %u\n", p->name, nrid);
+      DBG("%s: Twoway received from %I\n", p->name, nrid);
       ospf_neigh_sm(n, INM_2WAYREC);
       twoway=1;
       break;
@@ -262,7 +254,7 @@ neighbor_timer_hook(timer *timer)
   n=(struct ospf_neighbor *)timer->data;
   ifa=n->ifa;
   p=(struct proto *)(ifa->proto);
-  debug("%s: Inactivity timer fired on interface %s for neighbor %u.\n",
+  debug("%s: Inactivity timer fired on interface %s for neighbor %I.\n",
     p->name, ifa->iface->name, n->rid);
   tm_stop(n->inactim);
   rfree(n->inactim);
index bb9d21d7fcc8f1ea5ab9a586ee684672d3231de1..9576117385784c479241410e10e98cf01e69a956 100644 (file)
@@ -22,7 +22,7 @@ neigh_chstate(struct ospf_neighbor *n, u8 state)
     ifa=n->ifa;
     p=(struct proto *)(ifa->proto);
   
-    debug("%s: Neigbor '%u' changes state from \"%u\" to \"%u\".\n",
+    debug("%s: Neigbor %I changes state from \"%u\" to \"%u\".\n",
       p->name, n->rid, ospf_ns[n->state], ospf_ns[state]);
     n->state=state;
   }
@@ -329,7 +329,7 @@ bdr_election(struct ospf_iface *ifa, struct proto *p)
   ifa->drid=ndrid;
   ifa->bdrid=nbdrid;
 
-  DBG("%s: DR=%u, BDR=%u\n",p->name, ifa->drid, ifa->bdrid);
+  DBG("%s: DR=%I, BDR=%I\n",p->name, ifa->drid, ifa->bdrid);
 
   if(myid==ifa->drid) iface_chstate(ifa, OSPF_IS_DR);
   else