diff --git a/ripd/ChangeLog b/ripd/ChangeLog
index 46b7f19..d1dab04 100644
--- a/ripd/ChangeLog
+++ b/ripd/ChangeLog
@@ -1,3 +1,7 @@
+2004-12-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+	* *.c: Change level of debug messages to LOG_DEBUG.
+
 2004-12-07 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
 	* rip_main.c: (main) The 2nd argument to openzlog has been removed.
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 55848fa..68dcb01 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -213,7 +213,7 @@
     {
       
       if (IS_RIP_DEBUG_EVENT)
-	zlog_info ("multicast request on %s", ifp->name);
+	zlog_debug ("multicast request on %s", ifp->name);
 
       rip_request_send (NULL, ifp, version, NULL);
       return;
@@ -225,7 +225,7 @@
       struct listnode *cnode;
 
       if (IS_RIP_DEBUG_EVENT)
-	zlog_info ("broadcast request to %s", ifp->name);
+	zlog_debug ("broadcast request to %s", ifp->name);
 
       for (cnode = listhead (ifp->connected); cnode; nextnode (cnode))
 	{
@@ -247,7 +247,7 @@
 				      connected->address->prefixlen);
 
 	      if (IS_RIP_DEBUG_EVENT)
-		zlog_info ("SEND request to %s", inet_ntoa (to.sin_addr));
+		zlog_debug ("SEND request to %s", inet_ntoa (to.sin_addr));
 	      
 	      rip_request_send (&to, ifp, version, connected);
 	    }
@@ -308,7 +308,7 @@
     return;
 
   if (IS_RIP_DEBUG_EVENT)
-    zlog_info ("request to the all neighbor");
+    zlog_debug ("request to the all neighbor");
 
   /* Send request to all neighbor. */
   for (rp = route_top (rip->neighbor); rp; rp = route_next (rp))
@@ -325,7 +325,7 @@
   if (if_is_operative (ifp) && if_is_multicast (ifp))
     {
       if (IS_RIP_DEBUG_EVENT)
-	zlog_info ("multicast join at %s", ifp->name);
+	zlog_debug ("multicast join at %s", ifp->name);
 
       for (cnode = listhead (ifp->connected); cnode; nextnode (cnode))
 	{
@@ -358,7 +358,7 @@
   if (if_is_up (ifp) && if_is_multicast (ifp))
     {
       if (IS_RIP_DEBUG_EVENT)
-	zlog_info ("multicast leave from %s", ifp->name);
+	zlog_debug ("multicast leave from %s", ifp->name);
 
       for (cnode = listhead (ifp->connected); cnode; nextnode (cnode))
 	{
@@ -513,7 +513,7 @@
   rip_if_down(ifp);
  
   if (IS_RIP_DEBUG_ZEBRA)
-    zlog_info ("interface %s index %d flags %ld metric %d mtu %d is down",
+    zlog_debug ("interface %s index %d flags %ld metric %d mtu %d is down",
 	       ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
 
   return 0;
@@ -533,7 +533,7 @@
     return 0;
 
   if (IS_RIP_DEBUG_ZEBRA)
-    zlog_info ("interface %s index %d flags %ld metric %d mtu %d is up",
+    zlog_debug ("interface %s index %d flags %ld metric %d mtu %d is up",
 	       ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
 
   /* Check if this interface is RIP enabled or not.*/
@@ -557,7 +557,7 @@
   ifp = zebra_interface_add_read (zclient->ibuf);
 
   if (IS_RIP_DEBUG_ZEBRA)
-    zlog_info ("interface add %s index %d flags %ld metric %d mtu %d",
+    zlog_debug ("interface add %s index %d flags %ld metric %d mtu %d",
 	       ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
 
   /* Check if this interface is RIP enabled or not.*/
@@ -724,7 +724,7 @@
   if (ri->running)
    {
      if (IS_RIP_DEBUG_EVENT)
-       zlog_info ("turn off %s", ifp->name);
+       zlog_debug ("turn off %s", ifp->name);
 
      /* Leave from multicast group. */
      rip_multicast_leave (ifp, rip->sock);
@@ -795,7 +795,7 @@
   if (p->family == AF_INET)
     {
       if (IS_RIP_DEBUG_ZEBRA)
-	zlog_info ("connected address %s/%d is added", 
+	zlog_debug ("connected address %s/%d is added", 
 		   inet_ntoa (p->u.prefix4), p->prefixlen);
 
       rip_enable_apply(ifc->ifp);
@@ -849,8 +849,7 @@
       if (p->family == AF_INET)
 	{
 	  if (IS_RIP_DEBUG_ZEBRA)
-
-	    zlog_info ("connected address %s/%d is deleted",
+	    zlog_debug ("connected address %s/%d is deleted",
 		       inet_ntoa (p->u.prefix4), p->prefixlen);
 
 #ifdef HAVE_SNMP
@@ -1141,7 +1140,7 @@
     {
 	{
 	  if (IS_RIP_DEBUG_EVENT)
-	    zlog_info ("turn on %s", ifp->name);
+	    zlog_debug ("turn on %s", ifp->name);
 
 	  /* Add interface wake up thread. */
 	  if (! ri->t_wakeup)
@@ -1287,7 +1286,7 @@
 		 passive_default : !passive_default);
 
   if (IS_RIP_DEBUG_ZEBRA)
-    zlog_info ("interface %s: passive = %d",ifp->name,ri->passive);
+    zlog_debug ("interface %s: passive = %d",ifp->name,ri->passive);
 }
 
 void
diff --git a/ripd/ripd.c b/ripd/ripd.c
index e239fd4..01e669f 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -226,7 +226,7 @@
 			     (struct prefix *) p) == FILTER_DENY)
 	{
 	  if (IS_RIP_DEBUG_PACKET)
-	    zlog_info ("%s/%d filtered by distribute in",
+	    zlog_debug ("%s/%d filtered by distribute in",
 		       inet_ntoa (p->prefix), p->prefixlen);
 	  return -1;
 	}
@@ -237,7 +237,7 @@
 			     (struct prefix *) p) == PREFIX_DENY)
 	{
 	  if (IS_RIP_DEBUG_PACKET)
-	    zlog_info ("%s/%d filtered by prefix-list in",
+	    zlog_debug ("%s/%d filtered by prefix-list in",
 		       inet_ntoa (p->prefix), p->prefixlen);
 	  return -1;
 	}
@@ -257,7 +257,7 @@
 				     (struct prefix *) p) == FILTER_DENY)
 		{
 		  if (IS_RIP_DEBUG_PACKET)
-		    zlog_info ("%s/%d filtered by distribute in",
+		    zlog_debug ("%s/%d filtered by distribute in",
 			       inet_ntoa (p->prefix), p->prefixlen);
 		  return -1;
 		}
@@ -273,7 +273,7 @@
 				     (struct prefix *) p) == PREFIX_DENY)
 		{
 		  if (IS_RIP_DEBUG_PACKET)
-		    zlog_info ("%s/%d filtered by prefix-list in",
+		    zlog_debug ("%s/%d filtered by prefix-list in",
 			       inet_ntoa (p->prefix), p->prefixlen);
 		  return -1;
 		}
@@ -296,7 +296,7 @@
 			     (struct prefix *) p) == FILTER_DENY)
 	{
 	  if (IS_RIP_DEBUG_PACKET)
-	    zlog_info ("%s/%d is filtered by distribute out",
+	    zlog_debug ("%s/%d is filtered by distribute out",
 		       inet_ntoa (p->prefix), p->prefixlen);
 	  return -1;
 	}
@@ -307,7 +307,7 @@
 			     (struct prefix *) p) == PREFIX_DENY)
 	{
 	  if (IS_RIP_DEBUG_PACKET)
-	    zlog_info ("%s/%d is filtered by prefix-list out",
+	    zlog_debug ("%s/%d is filtered by prefix-list out",
 		       inet_ntoa (p->prefix), p->prefixlen);
 	  return -1;
 	}
@@ -327,7 +327,7 @@
 				     (struct prefix *) p) == FILTER_DENY)
 		{
 		  if (IS_RIP_DEBUG_PACKET)
-		    zlog_info ("%s/%d filtered by distribute out",
+		    zlog_debug ("%s/%d filtered by distribute out",
 			       inet_ntoa (p->prefix), p->prefixlen);
 		  return -1;
 		}
@@ -343,7 +343,7 @@
 				     (struct prefix *) p) == PREFIX_DENY)
 		{
 		  if (IS_RIP_DEBUG_PACKET)
-		    zlog_info ("%s/%d filtered by prefix-list out",
+		    zlog_debug ("%s/%d filtered by prefix-list out",
 			       inet_ntoa (p->prefix), p->prefixlen);
 		  return -1;
 		}
@@ -435,7 +435,7 @@
       if (ret == RMAP_DENYMATCH)
         {
           if (IS_RIP_DEBUG_PACKET)
-            zlog_info ("RIP %s/%d is filtered by route-map in",
+            zlog_debug ("RIP %s/%d is filtered by route-map in",
                        inet_ntoa (p.prefix), p.prefixlen);
           return;
         }
@@ -471,7 +471,7 @@
   if (rip_nexthop_check (nexthop) < 0)
     {
       if (IS_RIP_DEBUG_PACKET)
-        zlog_info ("Nexthop address %s is myself", inet_ntoa (*nexthop));
+        zlog_debug ("Nexthop address %s is myself", inet_ntoa (*nexthop));
       return;
     }
 
@@ -693,7 +693,7 @@
     command_str = "unknown";
 
   /* Dump packet header. */
-  zlog_info ("%s %s version %d packet size %d",
+  zlog_debug ("%s %s version %d packet size %d",
 	     sndrcv, command_str, packet->version, size);
 
   /* Dump each routing table entry. */
@@ -711,7 +711,7 @@
 		{
 		  p = (u_char *)&rte->prefix;
 
-		  zlog_info ("  family 0x%X type %d auth string: %s",
+		  zlog_debug ("  family 0x%X type %d auth string: %s",
 			     ntohs (rte->family), ntohs (rte->tag), p);
 		}
               else if (rte->tag == htons (RIP_AUTH_MD5))
@@ -720,22 +720,22 @@
 
 		  md5 = (struct rip_md5_info *) &packet->rte;
 
-		  zlog_info ("  family 0x%X type %d (MD5 authentication)",
+		  zlog_debug ("  family 0x%X type %d (MD5 authentication)",
 			     ntohs (md5->family), ntohs (md5->type));
-		  zlog_info ("    RIP-2 packet len %d Key ID %d"
+		  zlog_debug ("    RIP-2 packet len %d Key ID %d"
                              " Auth Data len %d",
                              ntohs (md5->packet_len), md5->keyid,
                              md5->auth_len);
-                  zlog_info ("    Sequence Number %ld",
+                  zlog_debug ("    Sequence Number %ld",
                              (u_long) ntohl (md5->sequence));
 		}
               else if (rte->tag == htons (RIP_AUTH_DATA))
 		{
 		  p = (u_char *)&rte->prefix;
 
-		  zlog_info ("  family 0x%X type %d (MD5 data)",
+		  zlog_debug ("  family 0x%X type %d (MD5 data)",
 			     ntohs (rte->family), ntohs (rte->tag));
-		  zlog_info ("    MD5: %02X%02X%02X%02X%02X%02X%02X%02X"
+		  zlog_debug ("    MD5: %02X%02X%02X%02X%02X%02X%02X%02X"
 			     "%02X%02X%02X%02X%02X%02X%02X",
                              p[0], p[1], p[2], p[3], p[4], p[5], p[6],
                              p[7], p[9], p[10], p[11], p[12], p[13],
@@ -743,12 +743,12 @@
 		}
 	      else
 		{
-		  zlog_info ("  family 0x%X type %d (Unknown auth type)",
+		  zlog_debug ("  family 0x%X type %d (Unknown auth type)",
 			     ntohs (rte->family), ntohs (rte->tag));
 		}
             }
 	  else
-	    zlog_info ("  %s/%d -> %s family %d tag %d metric %ld",
+	    zlog_debug ("  %s/%d -> %s family %d tag %d metric %ld",
                        inet_ntop (AF_INET, &rte->prefix, pbuf, BUFSIZ),
                        netmask, inet_ntop (AF_INET, &rte->nexthop, nbuf,
                                            BUFSIZ), ntohs (rte->family),
@@ -756,7 +756,7 @@
 	}
       else
 	{
-	  zlog_info ("  %s family %d tag %d metric %ld", 
+	  zlog_debug ("  %s family %d tag %d metric %ld", 
 		     inet_ntop (AF_INET, &rte->prefix, pbuf, BUFSIZ),
 		     ntohs (rte->family), ntohs (rte->tag),
 		     (u_long)ntohl (rte->metric));
@@ -802,7 +802,7 @@
   char *auth_str;
 
   if (IS_RIP_DEBUG_EVENT)
-    zlog_info ("RIPv2 simple password authentication from %s",
+    zlog_debug ("RIPv2 simple password authentication from %s",
 	       inet_ntoa (from->sin_addr));
 
   ri = ifp->info;
@@ -852,7 +852,7 @@
   char *auth_str = NULL;
   
   if (IS_RIP_DEBUG_EVENT)
-    zlog_info ("RIPv2 MD5 authentication from %s",
+    zlog_debug ("RIPv2 MD5 authentication from %s",
                inet_ntoa (from->sin_addr));
 
   ri = ifp->info;
@@ -870,7 +870,7 @@
          || (md5->auth_len == RIP_AUTH_MD5_COMPAT_SIZE)))
     {
       if (IS_RIP_DEBUG_EVENT)
-        zlog_warn ("RIPv2 MD5 authentication, strange authentication "
+        zlog_debug ("RIPv2 MD5 authentication, strange authentication "
                    "length field %d", md5->auth_len);
     return 0;
     }
@@ -881,7 +881,7 @@
   if (packet_len > (length - RIP_HEADER_SIZE - RIP_AUTH_MD5_SIZE))
     {
       if (IS_RIP_DEBUG_EVENT)
-        zlog_warn ("RIPv2 MD5 authentication, packet length field %d "
+        zlog_debug ("RIPv2 MD5 authentication, packet length field %d "
                    "greater than received length %d!",
                    md5->packet_len, length);
       return 0;
@@ -1165,13 +1165,13 @@
 		      && rinfo->sub_type == RIP_ROUTE_RTE)
 		    {
 		      if (IS_RIP_DEBUG_EVENT)
-			zlog_info ("Next hop %s is on RIP network.  Set nexthop to the packet's originator", inet_ntoa (rte->nexthop));
+			zlog_debug ("Next hop %s is on RIP network.  Set nexthop to the packet's originator", inet_ntoa (rte->nexthop));
 		      rte->nexthop = rinfo->from;
 		    }
 		  else
 		    {
 		      if (IS_RIP_DEBUG_EVENT)
-			zlog_info ("Next hop %s is not directly reachable. Treat it as 0.0.0.0", inet_ntoa (rte->nexthop));
+			zlog_debug ("Next hop %s is not directly reachable. Treat it as 0.0.0.0", inet_ntoa (rte->nexthop));
 		      rte->nexthop.s_addr = 0;
 		    }
 
@@ -1180,7 +1180,7 @@
 	      else
 		{
 		  if (IS_RIP_DEBUG_EVENT)
-		    zlog_info ("Next hop %s is not directly reachable. Treat it as 0.0.0.0", inet_ntoa (rte->nexthop));
+		    zlog_debug ("Next hop %s is not directly reachable. Treat it as 0.0.0.0", inet_ntoa (rte->nexthop));
 		  rte->nexthop.s_addr = 0;
 		}
 
@@ -1232,7 +1232,7 @@
 	      if ((rte->prefix.s_addr & rte->mask.s_addr) != rte->prefix.s_addr)
 		masklen2ip (32, &rte->mask);
 	      if (IS_RIP_DEBUG_EVENT)
-		zlog_info ("Subnetted route %s", inet_ntoa (rte->prefix));
+		zlog_debug ("Subnetted route %s", inet_ntoa (rte->prefix));
 	    }
 	  else
 	    {
@@ -1242,8 +1242,8 @@
 
 	  if (IS_RIP_DEBUG_EVENT)
 	    {
-	      zlog_info ("Resultant route %s", inet_ntoa (rte->prefix));
-	      zlog_info ("Resultant mask %s", inet_ntoa (rte->mask));
+	      zlog_debug ("Resultant route %s", inet_ntoa (rte->prefix));
+	      zlog_debug ("Resultant mask %s", inet_ntoa (rte->mask));
 	    }
 	}
 
@@ -1265,7 +1265,7 @@
 	  && (rte->mask.s_addr != 0))
 	{
 	  if (IS_RIP_DEBUG_EVENT)
-	    zlog_info ("Default route with non-zero netmask.  Set zero to netmask");
+	    zlog_debug ("Default route with non-zero netmask.  Set zero to netmask");
 	  rte->mask.s_addr = 0;
 	}
 	  
@@ -1299,7 +1299,7 @@
           sin.sin_addr.s_addr = htonl (INADDR_RIP_GROUP);
           strcpy(dst, inet_ntoa(sin.sin_addr));
         }
-      zlog_info("rip_send_packet %s > %s (%s)",
+      zlog_debug("rip_send_packet %s > %s (%s)",
                 inet_ntoa(ifc->address->u.prefix4),
                 dst, ifc->ifp->name);
     }
@@ -1317,7 +1317,7 @@
        * source address on non-linux systems.  
        */
       if (IS_RIP_DEBUG_PACKET)
-        zlog_info("duplicate dropped");
+        zlog_debug("duplicate dropped");
       return 0;
     }
 
@@ -1366,7 +1366,7 @@
 		sizeof (struct sockaddr_in));
 
   if (IS_RIP_DEBUG_EVENT)
-      zlog_info ("SEND to  %s.%d", inet_ntoa(sin.sin_addr), 
+      zlog_debug ("SEND to  %s.%d", inet_ntoa(sin.sin_addr), 
                   ntohs (sin.sin_port));
 
   if (ret < 0)
@@ -1449,11 +1449,11 @@
 
   if (IS_RIP_DEBUG_EVENT) {
     if (!nexthop)
-      zlog_info ("Redistribute new prefix %s/%d on the interface %s",
+      zlog_debug ("Redistribute new prefix %s/%d on the interface %s",
                  inet_ntoa(p->prefix), p->prefixlen,
                  ifindex2ifname(ifindex));
     else
-      zlog_info ("Redistribute new prefix %s/%d with nexthop %s on the interface %s",
+      zlog_debug ("Redistribute new prefix %s/%d with nexthop %s on the interface %s",
                  inet_ntoa(p->prefix), p->prefixlen, inet_ntoa(rinfo->nexthop),
                  ifindex2ifname(ifindex));
   }
@@ -1493,7 +1493,7 @@
 	  rinfo->flags |= RIP_RTF_CHANGED;
 
           if (IS_RIP_DEBUG_EVENT)
-            zlog_info ("Poisone %s/%d on the interface %s with an infinity metric [delete]",
+            zlog_debug ("Poisone %s/%d on the interface %s with an infinity metric [delete]",
                        inet_ntoa(p->prefix), p->prefixlen,
                        ifindex2ifname(ifindex));
 
@@ -1709,7 +1709,7 @@
   if (if_check_address (from.sin_addr)) 
     {
       if (IS_RIP_DEBUG_PACKET)
-	zlog_warn ("ignore packet comes from myself");
+	zlog_debug ("ignore packet comes from myself");
       return -1;
     }
 
@@ -1718,7 +1718,7 @@
   
   /* RIP packet received */
   if (IS_RIP_DEBUG_EVENT)
-    zlog_info ("RECV packet from %s port %d on %s",
+    zlog_debug ("RECV packet from %s port %d on %s",
 	       inet_ntoa (from.sin_addr), ntohs (from.sin_port),
 	       ifp ? ifp->name : "unknown");
 
@@ -1791,7 +1791,7 @@
   if (! ri->running && ! rip_neighbor_lookup (&from))
     {
       if (IS_RIP_DEBUG_EVENT)
-	zlog_info ("RIP is not enabled on interface %s.", ifp->name);
+	zlog_debug ("RIP is not enabled on interface %s.", ifp->name);
       rip_peer_bad_packet (&from);
       return -1;
     }
@@ -1805,7 +1805,7 @@
 	    if (! (vrecv & RIPv1))
 	      {
 		if (IS_RIP_DEBUG_PACKET)
-		  zlog_warn ("  packet's v%d doesn't fit to if version spec", 
+		  zlog_debug ("  packet's v%d doesn't fit to if version spec", 
 			     packet->version);
 		rip_peer_bad_packet (&from);
 		return -1;
@@ -1814,7 +1814,7 @@
 	    if (! (vrecv & RIPv2))
 	      {
 		if (IS_RIP_DEBUG_PACKET)
-		  zlog_warn ("  packet's v%d doesn't fit to if version spec", 
+		  zlog_debug ("  packet's v%d doesn't fit to if version spec", 
 			     packet->version);
 		rip_peer_bad_packet (&from);
 		return -1;
@@ -1831,7 +1831,7 @@
       && (packet->rte->family == htons(RIP_FAMILY_AUTH)))
     {
       if (IS_RIP_DEBUG_EVENT)
-	zlog_warn ("packet RIPv%d is dropped because authentication disabled", 
+	zlog_debug ("packet RIPv%d is dropped because authentication disabled", 
 		   packet->version);
       rip_peer_bad_packet (&from);
       return -1;
@@ -1854,7 +1854,7 @@
       && packet->rte->family == htons(RIP_FAMILY_AUTH))
 	{
 	  if (IS_RIP_DEBUG_PACKET)
-            zlog_warn
+            zlog_debug
               ("packet RIPv%d is dropped because authentication enabled",
                packet->version);
 	  rip_peer_bad_packet (&from);
@@ -1872,7 +1872,7 @@
 		  if (! ret)
 		    {
 		      if (IS_RIP_DEBUG_EVENT)
-                        zlog_warn
+                        zlog_debug
                           ("RIPv2 simple password authentication failed");
 		      rip_peer_bad_packet (&from);
 		      return -1;
@@ -1880,7 +1880,7 @@
 		  else
 		    {
 		      if (IS_RIP_DEBUG_EVENT)
-                        zlog_info
+                        zlog_debug
                           ("RIPv2 simple password authentication success");
 		    }
                 }
@@ -1890,14 +1890,14 @@
 		  if (! ret)
 		    {
 		      if (IS_RIP_DEBUG_EVENT)
-			zlog_warn ("RIPv2 MD5 authentication failed");
+			zlog_debug ("RIPv2 MD5 authentication failed");
 		      rip_peer_bad_packet (&from);
 		      return -1;
 		    }
 		  else
 		    {
 		      if (IS_RIP_DEBUG_EVENT)
-			zlog_info ("RIPv2 MD5 authentication success");
+			zlog_debug ("RIPv2 MD5 authentication success");
 		    }
 		  /* Reset RIP packet length to trim MD5 data. */
 		  len = ret; 
@@ -1905,7 +1905,7 @@
 	      else
 		{
 		  if (IS_RIP_DEBUG_EVENT)
-		    zlog_warn ("Unknown authentication type %d",
+		    zlog_debug ("Unknown authentication type %d",
 			       ntohs (packet->rte->tag));
 		  rip_peer_bad_packet (&from);
 		  return -1;
@@ -1917,7 +1917,7 @@
 	      if (ri->auth_str || ri->key_chain)
 		{
 		  if (IS_RIP_DEBUG_EVENT)
-                    zlog_warn
+                    zlog_debug
                       ("RIPv2 authentication failed: no authentication in packet");
 		  rip_peer_bad_packet (&from);
 		  return -1;
@@ -2119,9 +2119,9 @@
   if (IS_RIP_DEBUG_EVENT)
     {
       if (to)
-	zlog_info ("update routes to neighbor %s", inet_ntoa (to->sin_addr));
+	zlog_debug ("update routes to neighbor %s", inet_ntoa (to->sin_addr));
       else
-	zlog_info ("update routes on interface %s ifindex %d",
+	zlog_debug ("update routes on interface %s ifindex %d",
 		   ifc->ifp->name, ifc->ifp->ifindex);
     }
 
@@ -2185,7 +2185,7 @@
 	    p = (struct prefix_ipv4 *) &rp->p;
 
 	    if (IS_RIP_DEBUG_PACKET)
-	      zlog_info("RIPv1 mask check, %s/%d considered for output",
+	      zlog_debug("RIPv1 mask check, %s/%d considered for output",
 			inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen);
 
 	    if (subnetted &&
@@ -2204,7 +2204,7 @@
 		  continue;
 	      }
 	    if (IS_RIP_DEBUG_PACKET)
-	      zlog_info("RIPv1 mask check, %s/%d made it through",
+	      zlog_debug("RIPv1 mask check, %s/%d made it through",
 			inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen);
 	  }
 	else 
@@ -2269,7 +2269,7 @@
 	    if (ret == RMAP_DENYMATCH)
 	      {
 	        if (IS_RIP_DEBUG_PACKET)
-	          zlog_info ("RIP %s/%d is filtered by route-map out",
+	          zlog_debug ("RIP %s/%d is filtered by route-map out",
 			     inet_ntoa (p->prefix), p->prefixlen);
 		  continue;
 	      }
@@ -2285,7 +2285,7 @@
 	    if (ret == RMAP_DENYMATCH) 
 	      {
 		if (IS_RIP_DEBUG_PACKET)
-		  zlog_info ("%s/%d is filtered by route-map",
+		  zlog_debug ("%s/%d is filtered by route-map",
 			     inet_ntoa (p->prefix), p->prefixlen);
 		continue;
 	      }
@@ -2387,7 +2387,7 @@
   if (version == RIPv2 && if_is_multicast (ifc->ifp)) 
     {
       if (IS_RIP_DEBUG_EVENT)
-	zlog_info ("multicast announce on %s ", ifc->ifp->name);
+	zlog_debug ("multicast announce on %s ", ifc->ifp->name);
 
       rip_output_process (ifc, NULL, route_type, version);
       return;
@@ -2411,7 +2411,7 @@
           to.sin_port = htons (RIP_PORT_DEFAULT);
 
           if (IS_RIP_DEBUG_EVENT)
-            zlog_info ("%s announce to %s on %s",
+            zlog_debug ("%s announce to %s on %s",
                        if_is_pointopoint (ifc->ifp) ? "unicast" : "broadcast",
                        inet_ntoa (to.sin_addr), ifc->ifp->name);
 
@@ -2456,10 +2456,10 @@
 	  if (IS_RIP_DEBUG_EVENT) 
 	    {
 	      if (ifp->name) 
-		zlog_info ("SEND UPDATE to %s ifindex %d",
+		zlog_debug ("SEND UPDATE to %s ifindex %d",
 			   ifp->name, ifp->ifindex);
 	      else
-		zlog_info ("SEND UPDATE to _unknown_ ifindex %d",
+		zlog_debug ("SEND UPDATE to _unknown_ ifindex %d",
 			   ifp->ifindex);
 	    }
 
@@ -2532,7 +2532,7 @@
   rip->t_update = NULL;
 
   if (IS_RIP_DEBUG_EVENT)
-    zlog_info ("update timer fire!");
+    zlog_debug ("update timer fire!");
 
   /* Process update output. */
   rip_update_process (rip_all_route);
@@ -2600,7 +2600,7 @@
 
   /* Logging triggered update. */
   if (IS_RIP_DEBUG_EVENT)
-    zlog_info ("triggered update!");
+    zlog_debug ("triggered update!");
 
   /* Split Horizon processing is done when generating triggered
      updates as well as normal updates (see section 2.6). */
@@ -2648,7 +2648,7 @@
 	    if (IS_RIP_DEBUG_EVENT) {
               struct prefix_ipv4 *p = (struct prefix_ipv4 *) &rp->p;
 
-              zlog_info ("Poisone %s/%d on the interface %s with an infinity metric [withdraw]",
+              zlog_debug ("Poisone %s/%d on the interface %s with an infinity metric [withdraw]",
                          inet_ntoa(p->prefix), p->prefixlen,
                          ifindex2ifname(rinfo->ifindex));
 	    }
