summaryrefslogtreecommitdiff
path: root/babeld/babel_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'babeld/babel_interface.c')
-rw-r--r--babeld/babel_interface.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 453fd8e04e..b7c01e73dc 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -27,6 +27,7 @@ THE SOFTWARE.
#include "prefix.h"
#include "vector.h"
#include "distribute.h"
+#include "lib_errors.h"
#include "babel_main.h"
#include "util.h"
@@ -39,6 +40,7 @@ THE SOFTWARE.
#include "route.h"
#include "xroute.h"
#include "babel_memory.h"
+#include "babel_errors.h"
#define IS_ENABLE(ifp) (babel_enable_if_lookup(ifp->name) >= 0)
@@ -167,7 +169,7 @@ babel_interface_address_add (int cmd, struct zclient *client,
if (babel_ifp->ipv4 == NULL) {
babel_ifp->ipv4 = malloc(4);
if (babel_ifp->ipv4 == NULL) {
- zlog_err("not einough memory");
+ flog_err(BABEL_ERR_MEMORY, "not enough memory");
} else {
memcpy(babel_ifp->ipv4, &prefix->u.prefix4, 4);
}
@@ -707,7 +709,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) {
- zlog_err("Couldn't reallocate sendbuf.");
+ flog_err(BABEL_ERR_MEMORY, "Couldn't reallocate sendbuf.");
free(tmp);
babel_ifp->bufsize = 0;
return -1;
@@ -727,8 +729,9 @@ interface_recalculate(struct interface *ifp)
rc = setsockopt(protocol_socket, IPPROTO_IPV6, IPV6_JOIN_GROUP,
(char*)&mreq, sizeof(mreq));
if(rc < 0) {
- zlog_err("setsockopt(IPV6_JOIN_GROUP) on interface '%s': %s",
- ifp->name, safe_strerror(errno));
+ flog_err_sys(LIB_ERR_SOCKET,
+ "setsockopt(IPV6_JOIN_GROUP) on interface '%s': %s",
+ ifp->name, safe_strerror(errno));
/* This is probably due to a missing link-local address,
so down this interface, and wait until the main loop
tries to up it again. */
@@ -790,8 +793,9 @@ interface_reset(struct interface *ifp)
rc = setsockopt(protocol_socket, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
(char*)&mreq, sizeof(mreq));
if(rc < 0)
- zlog_err("setsockopt(IPV6_LEAVE_GROUP) on interface '%s': %s",
- ifp->name, safe_strerror(errno));
+ flog_err_sys(LIB_ERR_SOCKET,
+ "setsockopt(IPV6_LEAVE_GROUP) on interface '%s': %s",
+ ifp->name, safe_strerror(errno));
}
update_interface_metric(ifp);
@@ -1056,7 +1060,7 @@ DEFUN (show_babel_route,
}
route_stream_done(routes);
} else {
- zlog_err("Couldn't allocate route stream.");
+ flog_err(BABEL_ERR_MEMORY, "Couldn't allocate route stream.");
}
xroutes = xroute_stream();
if(xroutes) {
@@ -1068,7 +1072,7 @@ DEFUN (show_babel_route,
}
xroute_stream_done(xroutes);
} else {
- zlog_err("Couldn't allocate route stream.");
+ flog_err(BABEL_ERR_MEMORY, "Couldn't allocate route stream.");
}
return CMD_SUCCESS;
}
@@ -1103,7 +1107,7 @@ DEFUN (show_babel_route_prefix,
}
route_stream_done(routes);
} else {
- zlog_err("Couldn't allocate route stream.");
+ flog_err(BABEL_ERR_MEMORY, "Couldn't allocate route stream.");
}
xroutes = xroute_stream();
if(xroutes) {
@@ -1115,7 +1119,7 @@ DEFUN (show_babel_route_prefix,
}
xroute_stream_done(xroutes);
} else {
- zlog_err("Couldn't allocate route stream.");
+ flog_err(BABEL_ERR_MEMORY, "Couldn't allocate route stream.");
}
return CMD_SUCCESS;
}
@@ -1161,7 +1165,7 @@ DEFUN (show_babel_route_addr,
}
route_stream_done(routes);
} else {
- zlog_err("Couldn't allocate route stream.");
+ flog_err(BABEL_ERR_MEMORY, "Couldn't allocate route stream.");
}
xroutes = xroute_stream();
if(xroutes) {
@@ -1173,7 +1177,7 @@ DEFUN (show_babel_route_addr,
}
xroute_stream_done(xroutes);
} else {
- zlog_err("Couldn't allocate route stream.");
+ flog_err(BABEL_ERR_MEMORY, "Couldn't allocate route stream.");
}
return CMD_SUCCESS;
}
@@ -1220,7 +1224,7 @@ DEFUN (show_babel_route_addr6,
}
route_stream_done(routes);
} else {
- zlog_err("Couldn't allocate route stream.");
+ flog_err(BABEL_ERR_MEMORY, "Couldn't allocate route stream.");
}
xroutes = xroute_stream();
if(xroutes) {
@@ -1232,7 +1236,7 @@ DEFUN (show_babel_route_addr6,
}
xroute_stream_done(xroutes);
} else {
- zlog_err("Couldn't allocate route stream.");
+ flog_err(BABEL_ERR_MEMORY, "Couldn't allocate route stream.");
}
return CMD_SUCCESS;
}