]> git.proxmox.com Git - mirror_frr.git/blobdiff - babeld/route.c
Merge pull request #11981 from proelbtn/add-support-to-change-function-length
[mirror_frr.git] / babeld / route.c
index ceeaa105779a48408a222cc3a370bbf910b2a378..8dd1e40431233521a792cda4f0a411aac19d7f58 100644 (file)
@@ -166,7 +166,7 @@ resize_route_table(int new_slots)
 static struct babel_route *
 insert_route(struct babel_route *route)
 {
-    int i, n;
+    int i, n = 0;
 
     assert(!route->installed);
 
@@ -248,7 +248,7 @@ flush_route(struct babel_route *route)
 }
 
 void
-flush_all_routes()
+flush_all_routes(void)
 {
     int i;
 
@@ -399,17 +399,17 @@ install_route(struct babel_route *route)
         return;
 
     if(!route_feasible(route))
-        flog_err(BABEL_ERR_ROUTE, "WARNING: installing unfeasible route "
-                  "(this shouldn't happen).");
+           flog_err(EC_BABEL_ROUTE,
+                    "Installing unfeasible route (this shouldn't happen).");
 
     i = find_route_slot(route->src->prefix, route->src->plen, NULL);
     assert(i >= 0 && i < route_slots);
 
     if(routes[i] != route && routes[i]->installed) {
-        flog_err(BABEL_ERR_ROUTE,
-                 "WARNING: attempting to install duplicate route "
-                  "(this shouldn't happen).");
-        return;
+           flog_err(
+                   EC_BABEL_ROUTE,
+                   "Attempting to install duplicate route (this shouldn't happen).");
+           return;
     }
 
     rc = kernel_route(ROUTE_ADD, route->src->prefix, route->src->plen,
@@ -418,7 +418,7 @@ install_route(struct babel_route *route)
                       metric_to_kernel(route_metric(route)), NULL, 0, 0);
     if(rc < 0) {
         int save = errno;
-        flog_err(BABEL_ERR_ROUTE, "kernel_route(ADD): %s",
+        flog_err(EC_BABEL_ROUTE, "kernel_route(ADD): %s",
                  safe_strerror(errno));
         if(save != EEXIST)
             return;
@@ -441,7 +441,7 @@ uninstall_route(struct babel_route *route)
                       route->neigh->ifp->ifindex,
                       metric_to_kernel(route_metric(route)), NULL, 0, 0);
     if(rc < 0)
-        flog_err(BABEL_ERR_ROUTE, "kernel_route(FLUSH): %s",
+        flog_err(EC_BABEL_ROUTE, "kernel_route(FLUSH): %s",
                  safe_strerror(errno));
 
     route->installed = 0;
@@ -465,8 +465,8 @@ switch_routes(struct babel_route *old, struct babel_route *new)
         return;
 
     if(!route_feasible(new))
-        flog_err(BABEL_ERR_ROUTE, "WARNING: switching to unfeasible route "
-                  "(this shouldn't happen).");
+           flog_err(EC_BABEL_ROUTE,
+                    "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,
@@ -474,7 +474,7 @@ switch_routes(struct babel_route *old, struct babel_route *new)
                       new->nexthop, new->neigh->ifp->ifindex,
                       metric_to_kernel(route_metric(new)));
     if(rc < 0) {
-        flog_err(BABEL_ERR_ROUTE, "kernel_route(MODIFY): %s",
+        flog_err(EC_BABEL_ROUTE, "kernel_route(MODIFY): %s",
                  safe_strerror(errno));
         return;
     }
@@ -503,7 +503,7 @@ change_route_metric(struct babel_route *route,
                           route->nexthop, route->neigh->ifp->ifindex,
                           new);
         if(rc < 0) {
-            flog_err(BABEL_ERR_ROUTE, "kernel_route(MODIFY metric): %s",
+            flog_err(EC_BABEL_ROUTE, "kernel_route(MODIFY metric): %s",
                      safe_strerror(errno));
             return;
         }
@@ -798,7 +798,7 @@ update_route(const unsigned char *router_id,
         return NULL;
 
     if(martian_prefix(prefix, plen)) {
-        flog_err(BABEL_ERR_ROUTE, "Rejecting martian route to %s through %s.",
+        flog_err(EC_BABEL_ROUTE, "Rejecting martian route to %s through %s.",
                  format_prefix(prefix, plen), format_address(nexthop));
         return NULL;
     }
@@ -835,8 +835,7 @@ update_route(const unsigned char *router_id,
            in a timely manner.  If the source remains the same, we ignore
            the update. */
         if(!feasible && route->installed) {
-            debugf(BABEL_DEBUG_COMMON,"Unfeasible update for installed route to %s "
-                   "(%s %d %d -> %s %d %d).",
+            debugf(BABEL_DEBUG_COMMON,"Unfeasible update for installed route to %s (%s %d %d -> %s %d %d).",
                    format_prefix(src->prefix, src->plen),
                    format_eui64(route->src->id),
                    route->seqno, route->refmetric,
@@ -906,7 +905,7 @@ update_route(const unsigned char *router_id,
         route->next = NULL;
         new_route = insert_route(route);
         if(new_route == NULL) {
-            flog_err(BABEL_ERR_ROUTE, "Couldn't insert route.");
+            flog_err(EC_BABEL_ROUTE, "Couldn't insert route.");
             free(route);
             return NULL;
         }