]> git.proxmox.com Git - mirror_frr.git/commitdiff
babeld: change fprintf(stderr) in term of zlog_err.
authorMatthieu Boutier <boutier@pps.jussieu.fr>
Tue, 17 Jan 2012 21:46:21 +0000 (22:46 +0100)
committerPaul Jakma <paul@quagga.net>
Sun, 25 Mar 2012 16:06:52 +0000 (17:06 +0100)
babeld/babel_interface.c
babeld/babel_zebra.c
babeld/message.c
babeld/route.c

index df68afba3ce3c6309431dea6ba66602ec3dcb395..b80bf94e121239ec113ec4ff34bac383ead52b51 100644 (file)
@@ -503,7 +503,7 @@ interface_recalculate(struct interface *ifp)
     tmp = babel_ifp->sendbuf;
     babel_ifp->sendbuf = realloc(babel_ifp->sendbuf, babel_ifp->bufsize);
     if(babel_ifp->sendbuf == NULL) {
-        fprintf(stderr, "Couldn't reallocate sendbuf.\n");
+        zlog_err("Couldn't reallocate sendbuf.");
         free(tmp);
         babel_ifp->bufsize = 0;
         return -1;
index 6d78ecc62f0fd4ec6856b04d08e2d54694d2283d..7ba1adfee05cef16a15fb97b7cc3d96ab59c42d9 100644 (file)
@@ -277,7 +277,6 @@ void babelz_zebra_init(void)
 static int
 zebra_config_write (struct vty *vty)
 {
-    fprintf(stderr, "\tzebra_config_write\n");
     if (! zclient->enable)
     {
         vty_out (vty, "no router zebra%s", VTY_NEWLINE);
index 7930a1b13929b0349dba1b5069e5af9a9d53cd37..92c416b9feb1e0c5e2d08a7ac16cfa6464df2fd1 100644 (file)
@@ -145,35 +145,34 @@ parse_packet(const unsigned char *from, struct interface *ifp,
         v4_nh[16], v6_nh[16];
 
     if(!linklocal(from)) {
-        fprintf(stderr, "Received packet from non-local address %s.\n",
-                format_address(from));
+        zlog_err("Received packet from non-local address %s.",
+                 format_address(from));
         return;
     }
 
     if(packet[0] != 42) {
-        fprintf(stderr, "Received malformed packet on %s from %s.\n",
-                ifp->name, format_address(from));
+        zlog_err("Received malformed packet on %s from %s.",
+                 ifp->name, format_address(from));
         return;
     }
 
     if(packet[1] != 2) {
-        fprintf(stderr,
-                "Received packet with unknown version %d on %s from %s.\n",
-                packet[1], ifp->name, format_address(from));
+        zlog_err("Received packet with unknown version %d on %s from %s.",
+                 packet[1], ifp->name, format_address(from));
         return;
     }
 
     neigh = find_neighbour(from, ifp);
     if(neigh == NULL) {
-        fprintf(stderr, "Couldn't allocate neighbour.\n");
+        zlog_err("Couldn't allocate neighbour.");
         return;
     }
 
     DO_NTOHS(bodylen, packet + 2);
 
     if(bodylen + 4 > packetlen) {
-        fprintf(stderr, "Received truncated packet (%d + 4 > %d).\n",
-                bodylen, packetlen);
+        zlog_err("Received truncated packet (%d + 4 > %d).",
+                 bodylen, packetlen);
         bodylen = packetlen - 4;
     }
 
@@ -188,12 +187,12 @@ parse_packet(const unsigned char *from, struct interface *ifp,
             continue;
         }
         if(i + 1 > bodylen) {
-            fprintf(stderr, "Received truncated message.\n");
+            zlog_err("Received truncated message.");
             break;
         }
         len = message[1];
         if(i + len > bodylen) {
-            fprintf(stderr, "Received truncated message.\n");
+            zlog_err("Received truncated message.");
             break;
         }
 
@@ -330,7 +329,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
                 have_router_id = 1;
             }
             if(!have_router_id && message[2] != 0) {
-                fprintf(stderr, "Received prefix with no router id.\n");
+                zlog_err("Received prefix with no router id.");
                 goto fail;
             }
             debugf(BABEL_DEBUG_COMMON,"Received update%s%s for %s from %s on %s.",
@@ -341,8 +340,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
 
             if(message[2] == 0) {
                 if(metric < 0xFFFF) {
-                    fprintf(stderr,
-                            "Received wildcard update with finite metric.\n");
+                    zlog_err("Received wildcard update with finite metric.");
                     goto done;
                 }
                 retract_neighbour_routes(neigh);
@@ -409,8 +407,8 @@ parse_packet(const unsigned char *from, struct interface *ifp,
         continue;
 
     fail:
-        fprintf(stderr, "Couldn't parse packet (%d, %d) from %s on %s.\n",
-                message[0], message[1], format_address(from), ifp->name);
+        zlog_err("Couldn't parse packet (%d, %d) from %s on %s.",
+                 message[0], message[1], format_address(from), ifp->name);
         goto done;
     }
     return;
@@ -470,8 +468,8 @@ flushbuf(struct interface *ifp)
             if(rc < 0)
                 zlog_err("send: %s", safe_strerror(errno));
         } else {
-            fprintf(stderr, "Warning: bucket full, dropping packet to %s.\n",
-                    ifp->name);
+            zlog_err("Warning: bucket full, dropping packet to %s.",
+                     ifp->name);
         }
     }
     VALGRIND_MAKE_MEM_UNDEFINED(babel_ifp->sendbuf, babel_ifp->bufsize);
@@ -705,11 +703,9 @@ flush_unicast(int dofree)
         if(rc < 0)
             zlog_err("send(unicast): %s", safe_strerror(errno));
     } else {
-        fprintf(stderr,
-                "Warning: bucket full, dropping unicast packet"
-                "to %s if %s.\n",
-                format_address(unicast_neighbour->address),
-                unicast_neighbour->ifp->name);
+        zlog_err("Warning: bucket full, dropping unicast packet to %s if %s.",
+                 format_address(unicast_neighbour->address),
+                 unicast_neighbour->ifp->name);
     }
 
  done:
index aa181be70bab3d8292abaa301b49cc79d51db365..aadf80f2734cee8ed83723c8192cbc654c245472 100644 (file)
@@ -172,8 +172,8 @@ install_route(struct babel_route *route)
         return;
 
     if(!route_feasible(route))
-        fprintf(stderr, "WARNING: installing unfeasible route "
-                "(this shouldn't happen).");
+        zlog_err("WARNING: installing unfeasible route "
+                 "(this shouldn't happen).");
 
     rc = kernel_route(ROUTE_ADD, route->src->prefix, route->src->plen,
                       route->nexthop,
@@ -224,8 +224,8 @@ switch_routes(struct babel_route *old, struct babel_route *new)
         return;
 
     if(!route_feasible(new))
-        fprintf(stderr, "WARNING: switching to unfeasible route "
-                "(this shouldn't happen).");
+        zlog_err("WARNING: switching to unfeasible route "
+                 "(this shouldn't happen).");
 
     rc = kernel_route(ROUTE_MODIFY, old->src->prefix, old->src->plen,
                       old->nexthop, old->neigh->ifp->ifindex,
@@ -414,8 +414,8 @@ update_route(const unsigned char *router_id,
         return NULL; /* I have announced the route */
 
     if(martian_prefix(prefix, plen)) {
-        fprintf(stderr, "Rejecting martian route to %s through %s.\n",
-                format_prefix(prefix, plen), format_address(router_id));
+        zlog_err("Rejecting martian route to %s through %s.",
+                 format_prefix(prefix, plen), format_address(router_id));
         return NULL;
     }