diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 34282b8..b6b5f5a 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -72,17 +72,6 @@
   } flag;
   struct in6_addr address;
 };
-
-/* Utility function for making IPv6 address string. */
-const char *
-inet6_ntop (struct in6_addr *p)
-{
-  static char buf[INET6_ADDRSTRLEN];
-
-  inet_ntop (AF_INET6, p, buf, INET6_ADDRSTRLEN);
-
-  return buf;
-}
 
 int
 ripng_route_rte (struct ripng_info *rinfo)
@@ -176,7 +165,7 @@
 
   if (IS_RIPNG_DEBUG_SEND) {
     if (to)
-      zlog_debug ("send to %s", inet6_ntop (&to->sin6_addr));
+      zlog_debug ("send to %s", inet6_ntoa (&to->sin6_addr));
     zlog_debug ("  send interface %s", ifp->name);
     zlog_debug ("  send packet size %d", bufsize);
   }
@@ -224,7 +213,7 @@
   if (ret < 0) {
     if (to)
       zlog_err ("RIPng send fail on %s to %s: %s", ifp->name, 
-                inet6_ntop (&to->sin6_addr), safe_strerror (errno));
+                inet6_ntoa (&to->sin6_addr), safe_strerror (errno));
     else
       zlog_err ("RIPng send fail on %s: %s", ifp->name, safe_strerror (errno));
   }
@@ -320,10 +309,10 @@
   for (lim = (caddr_t) packet + size; (caddr_t) rte < lim; rte++)
     {
       if (rte->metric == RIPNG_METRIC_NEXTHOP)
-	zlog_debug ("  nexthop %s/%d", inet6_ntop (&rte->addr), rte->prefixlen);
+	zlog_debug ("  nexthop %s/%d", inet6_ntoa (&rte->addr), rte->prefixlen);
       else
 	zlog_debug ("  %s/%d metric %d tag %d", 
-		   inet6_ntop (&rte->addr), rte->prefixlen, 
+		   inet6_ntoa (&rte->addr), rte->prefixlen, 
 		   rte->metric, ntohs (rte->tag));
     }
 }
@@ -339,18 +328,18 @@
   /* Logging before checking RTE. */
   if (IS_RIPNG_DEBUG_RECV)
     zlog_debug ("RIPng nexthop RTE address %s tag %d prefixlen %d",
-	       inet6_ntop (&rte->addr), ntohs (rte->tag), rte->prefixlen);
+	       inet6_ntoa (&rte->addr), ntohs (rte->tag), rte->prefixlen);
 
   /* RFC2080 2.1.1 Next Hop: 
    The route tag and prefix length in the next hop RTE must be
    set to zero on sending and ignored on receiption.  */
   if (ntohs (rte->tag) != 0)
     zlog_warn ("RIPng nexthop RTE with non zero tag value %d from %s",
-	       ntohs (rte->tag), inet6_ntop (&from->sin6_addr));
+	       ntohs (rte->tag), inet6_ntoa (&from->sin6_addr));
 
   if (rte->prefixlen != 0)
     zlog_warn ("RIPng nexthop RTE with non zero prefixlen value %d from %s",
-	       rte->prefixlen, inet6_ntop (&from->sin6_addr));
+	       rte->prefixlen, inet6_ntoa (&from->sin6_addr));
 
   /* Specifying a value of 0:0:0:0:0:0:0:0 in the prefix field of a
    next hop RTE indicates that the next hop address should be the
@@ -378,7 +367,7 @@
    valid, route may be taken.  If the received next hop address is not
    a link-local address, it should be treated as 0:0:0:0:0:0:0:0.  */
   zlog_warn ("RIPng nexthop RTE with non link-local address %s from %s",
-	     inet6_ntop (&rte->addr),
+	     inet6_ntoa (&rte->addr),
 	     inet_ntop (AF_INET6, &from->sin6_addr, buf, INET6_BUFSIZ));
 
   nexthop->flag = RIPNG_NEXTHOP_UNSPEC;
@@ -497,7 +486,7 @@
 	{
 	  if (IS_RIPNG_DEBUG_PACKET)
 	    zlog_debug ("%s/%d filtered by distribute in",
-		       inet6_ntop (&p->prefix), p->prefixlen);
+		       inet6_ntoa (&p->prefix), p->prefixlen);
 	  return -1;
 	}
     }
@@ -508,7 +497,7 @@
 	{
 	  if (IS_RIPNG_DEBUG_PACKET)
 	    zlog_debug ("%s/%d filtered by prefix-list in",
-		       inet6_ntop (&p->prefix), p->prefixlen);
+		       inet6_ntoa (&p->prefix), p->prefixlen);
 	  return -1;
 	}
     }
@@ -528,7 +517,7 @@
 		{
 		  if (IS_RIPNG_DEBUG_PACKET)
 		    zlog_debug ("%s/%d filtered by distribute in",
-			       inet6_ntop (&p->prefix), p->prefixlen);
+			       inet6_ntoa (&p->prefix), p->prefixlen);
 		  return -1;
 		}
 	    }
@@ -544,7 +533,7 @@
 		{
 		  if (IS_RIPNG_DEBUG_PACKET)
 		    zlog_debug ("%s/%d filtered by prefix-list in",
-			       inet6_ntop (&p->prefix), p->prefixlen);
+			       inet6_ntoa (&p->prefix), p->prefixlen);
 		  return -1;
 		}
 	    }
@@ -567,7 +556,7 @@
 	{
 	  if (IS_RIPNG_DEBUG_PACKET)
 	    zlog_debug ("%s/%d is filtered by distribute out",
-		       inet6_ntop (&p->prefix), p->prefixlen);
+		       inet6_ntoa (&p->prefix), p->prefixlen);
 	  return -1;
 	}
     }
@@ -578,7 +567,7 @@
 	{
 	  if (IS_RIPNG_DEBUG_PACKET)
 	    zlog_debug ("%s/%d is filtered by prefix-list out",
-		       inet6_ntop (&p->prefix), p->prefixlen);
+		       inet6_ntoa (&p->prefix), p->prefixlen);
 	  return -1;
 	}
     }
@@ -598,7 +587,7 @@
 		{
 		  if (IS_RIPNG_DEBUG_PACKET)
 		    zlog_debug ("%s/%d filtered by distribute out",
-			       inet6_ntop (&p->prefix), p->prefixlen);
+			       inet6_ntoa (&p->prefix), p->prefixlen);
 		  return -1;
 		}
 	    }
@@ -614,7 +603,7 @@
 		{
 		  if (IS_RIPNG_DEBUG_PACKET)
 		    zlog_debug ("%s/%d filtered by prefix-list out",
-			       inet6_ntop (&p->prefix), p->prefixlen);
+			       inet6_ntoa (&p->prefix), p->prefixlen);
 		  return -1;
 		}
 	    }
@@ -683,7 +672,7 @@
 	{
 	  if (IS_RIPNG_DEBUG_PACKET)
 	    zlog_debug ("RIPng %s/%d is filtered by route-map in",
-		       inet6_ntop (&p.prefix), p.prefixlen);
+		       inet6_ntoa (&p.prefix), p.prefixlen);
 	  return;
 	}
 
@@ -1005,11 +994,11 @@
   if (IS_RIPNG_DEBUG_EVENT) {
     if (!nexthop)
       zlog_debug ("Redistribute new prefix %s/%d on the interface %s",
-                 inet6_ntop(&p->prefix), p->prefixlen,
+                 inet6_ntoa(&p->prefix), p->prefixlen,
                  ifindex2ifname(ifindex));
     else
       zlog_debug ("Redistribute new prefix %s/%d with nexthop %s on the interface %s",
-                 inet6_ntop(&p->prefix), p->prefixlen, inet6_ntop(nexthop),
+                 inet6_ntoa(&p->prefix), p->prefixlen, inet6_ntoa(nexthop),
                  ifindex2ifname(ifindex));
   }
 
@@ -1062,7 +1051,7 @@
 	  
           if (IS_RIPNG_DEBUG_EVENT)
             zlog_debug ("Poisone %s/%d on the interface %s with an infinity metric [delete]",
-                       inet6_ntop(&p->prefix), p->prefixlen,
+                       inet6_ntoa(&p->prefix), p->prefixlen,
                        ifindex2ifname(ifindex));
 
 	  ripng_event (RIPNG_TRIGGERED_UPDATE, 0);
@@ -1101,7 +1090,7 @@
 	      struct prefix_ipv6 *p = (struct prefix_ipv6 *) &rp->p;
 
 	      zlog_debug ("Poisone %s/%d on the interface %s [withdraw]",
-	                 inet6_ntop(&p->prefix), p->prefixlen,
+	                 inet6_ntoa(&p->prefix), p->prefixlen,
 	                 ifindex2ifname(rinfo->ifindex));
 	    }
 
@@ -1125,7 +1114,7 @@
   if (ntohs (from->sin6_port) != RIPNG_PORT_DEFAULT)
     {
       zlog_warn ("RIPng packet comes from non RIPng port %d from %s",
-		 ntohs (from->sin6_port), inet6_ntop (&from->sin6_addr));
+		 ntohs (from->sin6_port), inet6_ntoa (&from->sin6_addr));
       ripng_peer_bad_packet (from);
       return;
     }
@@ -1136,7 +1125,7 @@
   if (! IN6_IS_ADDR_LINKLOCAL(&from->sin6_addr))
    {
       zlog_warn ("RIPng packet comes from non link local address %s",
-		 inet6_ntop (&from->sin6_addr));
+		 inet6_ntoa (&from->sin6_addr));
       ripng_peer_bad_packet (from);
       return;
     }
@@ -1149,7 +1138,7 @@
   if (ripng_lladdr_check (ifp, &from->sin6_addr))
     {
       zlog_warn ("RIPng packet comes from my own link local address %s",
-		 inet6_ntop (&from->sin6_addr));
+		 inet6_ntoa (&from->sin6_addr));
       ripng_peer_bad_packet (from);
       return;
     }
@@ -1161,7 +1150,7 @@
   if (hoplimit >= 0 && hoplimit != 255)
     {
       zlog_warn ("RIPng packet comes with non 255 hop count %d from %s",
-		 hoplimit, inet6_ntop (&from->sin6_addr));
+		 hoplimit, inet6_ntoa (&from->sin6_addr));
       ripng_peer_bad_packet (from);
       return;
     }
@@ -1195,21 +1184,21 @@
       if (IN6_IS_ADDR_MULTICAST (&rte->addr))
 	{
 	  zlog_warn ("Destination prefix is a multicast address %s/%d [%d]",
-		     inet6_ntop (&rte->addr), rte->prefixlen, rte->metric);
+		     inet6_ntoa (&rte->addr), rte->prefixlen, rte->metric);
 	  ripng_peer_bad_route (from);
 	  continue;
 	}
       if (IN6_IS_ADDR_LINKLOCAL (&rte->addr))
 	{
 	  zlog_warn ("Destination prefix is a link-local address %s/%d [%d]",
-		     inet6_ntop (&rte->addr), rte->prefixlen, rte->metric);
+		     inet6_ntoa (&rte->addr), rte->prefixlen, rte->metric);
 	  ripng_peer_bad_route (from);
 	  continue;
 	}
       if (IN6_IS_ADDR_LOOPBACK (&rte->addr))
 	{
 	  zlog_warn ("Destination prefix is a loopback address %s/%d [%d]",
-		     inet6_ntop (&rte->addr), rte->prefixlen, rte->metric);
+		     inet6_ntoa (&rte->addr), rte->prefixlen, rte->metric);
 	  ripng_peer_bad_route (from);
 	  continue;
 	}
@@ -1219,8 +1208,8 @@
       if (rte->prefixlen > 128)
 	{
 	  zlog_warn ("Invalid prefix length %s/%d from %s%%%s",
-		     inet6_ntop (&rte->addr), rte->prefixlen,
-		     inet6_ntop (&from->sin6_addr), ifp->name);
+		     inet6_ntoa (&rte->addr), rte->prefixlen,
+		     inet6_ntoa (&from->sin6_addr), ifp->name);
 	  ripng_peer_bad_route (from);
 	  continue;
 	}
@@ -1229,7 +1218,7 @@
       if (! (rte->metric >= 1 && rte->metric <= 16))
 	{
 	  zlog_warn ("Invalid metric %d from %s%%%s", rte->metric,
-		     inet6_ntop (&from->sin6_addr), ifp->name);
+		     inet6_ntoa (&from->sin6_addr), ifp->name);
 	  ripng_peer_bad_route (from);
 	  continue;
 	}
@@ -1369,7 +1358,7 @@
   if (((len - 4) % 20) != 0)
     {
       zlog_warn ("RIPng invalid packet size %d from %s", len,
-		 inet6_ntop (&from.sin6_addr));
+		 inet6_ntoa (&from.sin6_addr));
       ripng_peer_bad_packet (&from);
       return 0;
     }
@@ -1380,7 +1369,7 @@
   /* RIPng packet received. */
   if (IS_RIPNG_DEBUG_EVENT)
     zlog_debug ("RIPng packet received from %s port %d on %s",
-	       inet6_ntop (&from.sin6_addr), ntohs (from.sin6_port), 
+	       inet6_ntoa (&from.sin6_addr), ntohs (from.sin6_port), 
 	       ifp ? ifp->name : "unknown");
 
   /* Logging before packet checking. */
@@ -1614,7 +1603,7 @@
   if (IS_RIPNG_DEBUG_EVENT) {
     if (to)
       zlog_debug ("RIPng update routes to neighbor %s",
-                 inet6_ntop(&to->sin6_addr));
+                 inet6_ntoa(&to->sin6_addr));
     else
       zlog_debug ("RIPng update routes on interface %s", ifp->name);
   }
@@ -1683,7 +1672,7 @@
 		{
 		  if (IS_RIPNG_DEBUG_PACKET)
 		    zlog_debug ("RIPng %s/%d is filtered by route-map out",
-			       inet6_ntop (&p->prefix), p->prefixlen);
+			       inet6_ntoa (&p->prefix), p->prefixlen);
 		  continue;
 		}
 
@@ -1702,7 +1691,7 @@
 		{
 		  if (IS_RIPNG_DEBUG_PACKET)
 		    zlog_debug ("RIPng %s/%d is filtered by route-map",
-			       inet6_ntop (&p->prefix), p->prefixlen);
+			       inet6_ntoa (&p->prefix), p->prefixlen);
 		  continue;
 		}
 	    }
@@ -1788,7 +1777,7 @@
 		{
 		  if (IS_RIPNG_DEBUG_PACKET)
 		    zlog_debug ("RIPng %s/%d is filtered by route-map out",
-			       inet6_ntop (&p->prefix), p->prefixlen);
+			       inet6_ntoa (&p->prefix), p->prefixlen);
 		  continue;
 		}
 
@@ -2053,10 +2042,10 @@
 #ifdef DEBUG
 	  len = vty_out (vty, "R(a) %d/%d %s/%d ",
 			 aggregate->count, aggregate->suppress,
-			 inet6_ntop (&p->prefix), p->prefixlen);
+			 inet6_ntoa (&p->prefix), p->prefixlen);
 #else
 	  len = vty_out (vty, "R(a) %s/%d ", 
-			 inet6_ntop (&p->prefix), p->prefixlen);
+			 inet6_ntoa (&p->prefix), p->prefixlen);
 #endif /* DEBUG */
 	  vty_out (vty, "%s", VTY_NEWLINE);
 	  vty_out (vty, "%*s", 18, " ");
@@ -2076,16 +2065,16 @@
 			 route_info[rinfo->type].str,
 			 ripng_route_subtype_print(rinfo),
 			 rinfo->suppress,
-			 inet6_ntop (&p->prefix), p->prefixlen);
+			 inet6_ntoa (&p->prefix), p->prefixlen);
 #else
 	  len = vty_out (vty, "%s(%s) %s/%d ",
 			 route_info[rinfo->type].str,
 			 ripng_route_subtype_print(rinfo),
-			 inet6_ntop (&p->prefix), p->prefixlen);
+			 inet6_ntoa (&p->prefix), p->prefixlen);
 #endif /* DEBUG */
 	  vty_out (vty, "%s", VTY_NEWLINE);
 	  vty_out (vty, "%*s", 18, " ");
-	  len = vty_out (vty, "%s", inet6_ntop (&rinfo->nexthop));
+	  len = vty_out (vty, "%s", inet6_ntoa (&rinfo->nexthop));
 
 	  len = 28 - len;
 	  if (len > 0)
@@ -2688,7 +2677,7 @@
       for (rp = route_top (ripng->aggregate); rp; rp = route_next (rp))
 	if (rp->info != NULL)
 	  vty_out (vty, " aggregate-address %s/%d%s", 
-		   inet6_ntop (&rp->p.u.prefix6),
+		   inet6_ntoa (&rp->p.u.prefix6),
 		   rp->p.prefixlen, 
 
 		   VTY_NEWLINE);
@@ -2696,7 +2685,7 @@
       /* RIPng static routes. */
       for (rp = route_top (ripng->route); rp; rp = route_next (rp))
 	if (rp->info != NULL)
-	  vty_out (vty, " route %s/%d%s", inet6_ntop (&rp->p.u.prefix6),
+	  vty_out (vty, " route %s/%d%s", inet6_ntoa (&rp->p.u.prefix6),
 		   rp->p.prefixlen,
 		   VTY_NEWLINE);
 
