babeld: Convert all zlog_err to zlog_ferr and add appropriate info

Convert babeld to use zlog_ferr and add appropriate BABEL_ERR_XXX
information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-06-18 14:08:34 -04:00 committed by Quentin Young
parent f135ba5272
commit e33b116cdf
9 changed files with 117 additions and 63 deletions

View File

@ -29,6 +29,24 @@ static struct ferr_ref ferr_babel_err[] = {
.description = "Babel has failed to allocate memory, the system is about to run out of memory", .description = "Babel has failed to allocate memory, the system is about to run out of memory",
.suggestion = "Find the process that is causing memory shortages and remediate that process\nRestart FRR" .suggestion = "Find the process that is causing memory shortages and remediate that process\nRestart FRR"
}, },
{
.code = BABEL_ERR_PACKET,
.title = "BABEL Packet Error",
.description = "Babel has detected a packet encode/decode problem",
.suggestion = "Collect relevant log files and file an Issue"
},
{
.code = BABEL_ERR_CONFIG,
.title = "BABEL Configuration Error",
.description = "Babel has detected a configuration error of some sort",
.suggestion = "Ensure that the configuration is correct"
},
{
.code = BABEL_ERR_ROUTE,
.title = "BABEL Route Error",
.description = "Babel has detected a routing error and has an inconsistent state",
.suggestion = "Gather data for filing an Issue and then restart FRR"
},
{ {
.code = END_FERR, .code = END_FERR,
} }

View File

@ -25,6 +25,9 @@
enum babel_ferr_refs { enum babel_ferr_refs {
BABEL_ERR_MEMORY = BABEL_FERR_START, BABEL_ERR_MEMORY = BABEL_FERR_START,
BABEL_ERR_PACKET,
BABEL_ERR_CONFIG,
BABEL_ERR_ROUTE,
}; };
extern void babel_error_init(void); extern void babel_error_init(void);

View File

@ -300,7 +300,7 @@ babel_load_state_file(void)
unsigned char sid[8]; unsigned char sid[8];
rc = parse_eui64(buf2, sid); rc = parse_eui64(buf2, sid);
if(rc < 0) { if(rc < 0) {
zlog_err("Couldn't parse babel-state."); zlog_ferr(BABEL_ERR_CONFIG, "Couldn't parse babel-state.");
} else { } else {
struct timeval realnow; struct timeval realnow;
debugf(BABEL_DEBUG_COMMON, debugf(BABEL_DEBUG_COMMON,
@ -310,12 +310,13 @@ babel_load_state_file(void)
if(memcmp(sid, myid, 8) == 0) if(memcmp(sid, myid, 8) == 0)
myseqno = seqno_plus(s, 1); myseqno = seqno_plus(s, 1);
else else
zlog_err("ID mismatch in babel-state. id=%s; old=%s", zlog_ferr(BABEL_ERR_CONFIG,
"ID mismatch in babel-state. id=%s; old=%s",
format_eui64(myid), format_eui64(myid),
format_eui64(sid)); format_eui64(sid));
} }
} else { } else {
zlog_err("Couldn't parse babel-state."); zlog_ferr(BABEL_ERR_CONFIG, "Couldn't parse babel-state.");
} }
} }
goto fini; goto fini;
@ -366,12 +367,13 @@ babel_save_state_file(void)
format_eui64(myid), (int)myseqno, format_eui64(myid), (int)myseqno,
(long)realnow.tv_sec); (long)realnow.tv_sec);
if(rc < 0 || rc >= 100) { if(rc < 0 || rc >= 100) {
zlog_err("write(babel-state): overflow."); zlog_ferr(BABEL_ERR_CONFIG, "write(babel-state): overflow.");
unlink(state_file); unlink(state_file);
} else { } else {
rc = write(fd, buf, rc); rc = write(fd, buf, rc);
if(rc < 0) { if(rc < 0) {
zlog_err("write(babel-state): %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_CONFIG, "write(babel-state): %s",
safe_strerror(errno));
unlink(state_file); unlink(state_file);
} }
fsync(fd); fsync(fd);

View File

@ -255,11 +255,13 @@ babel_get_myid(void)
return; return;
} }
zlog_err("Warning: couldn't find router id -- using random value."); zlog_ferr(BABEL_ERR_CONFIG,
"Warning: couldn't find router id -- using random value.");
rc = read_random_bytes(myid, 8); rc = read_random_bytes(myid, 8);
if(rc < 0) { if(rc < 0) {
zlog_err("read(random): %s (cannot assign an ID)",safe_strerror(errno)); zlog_ferr(BABEL_ERR_CONFIG, "read(random): %s (cannot assign an ID)",
safe_strerror(errno));
exit(1); exit(1);
} }
/* Clear group and global bits */ /* Clear group and global bits */

View File

@ -35,6 +35,7 @@ THE SOFTWARE.
#include "message.h" #include "message.h"
#include "kernel.h" #include "kernel.h"
#include "babel_main.h" #include "babel_main.h"
#include "babel_errors.h"
static unsigned char packet_header[4] = {42, 2}; static unsigned char packet_header[4] = {42, 2};
@ -140,12 +141,12 @@ parse_update_subtlv(const unsigned char *a, int alen,
} }
if(i + 1 > alen) { if(i + 1 > alen) {
zlog_err("Received truncated attributes."); zlog_ferr(BABEL_ERR_PACKET, "Received truncated attributes.");
return; return;
} }
len = a[i + 1]; len = a[i + 1];
if(i + len > alen) { if(i + len > alen) {
zlog_err("Received truncated attributes."); zlog_ferr(BABEL_ERR_PACKET, "Received truncated attributes.");
return; return;
} }
@ -153,13 +154,14 @@ parse_update_subtlv(const unsigned char *a, int alen,
/* Nothing. */ /* Nothing. */
} else if(type == SUBTLV_DIVERSITY) { } else if(type == SUBTLV_DIVERSITY) {
if(len > DIVERSITY_HOPS) { if(len > DIVERSITY_HOPS) {
zlog_err("Received overlong channel information (%d > %d).n", zlog_ferr(BABEL_ERR_PACKET,
len, DIVERSITY_HOPS); "Received overlong channel information (%d > %d).n",
len, DIVERSITY_HOPS);
len = DIVERSITY_HOPS; len = DIVERSITY_HOPS;
} }
if(memchr(a + i + 2, 0, len) != NULL) { if(memchr(a + i + 2, 0, len) != NULL) {
/* 0 is reserved. */ /* 0 is reserved. */
zlog_err("Channel information contains 0!"); zlog_ferr(BABEL_ERR_PACKET, "Channel information contains 0!");
return; return;
} }
memset(channels, 0, DIVERSITY_HOPS); memset(channels, 0, DIVERSITY_HOPS);
@ -187,12 +189,14 @@ parse_hello_subtlv(const unsigned char *a, int alen,
} }
if(i + 1 > alen) { if(i + 1 > alen) {
zlog_err("Received truncated sub-TLV on Hello message."); zlog_ferr(BABEL_ERR_PACKET,
"Received truncated sub-TLV on Hello message.");
return -1; return -1;
} }
len = a[i + 1]; len = a[i + 1];
if(i + len > alen) { if(i + len > alen) {
zlog_err("Received truncated sub-TLV on Hello message."); zlog_ferr(BABEL_ERR_PACKET,
"Received truncated sub-TLV on Hello message.");
return -1; return -1;
} }
@ -203,7 +207,8 @@ parse_hello_subtlv(const unsigned char *a, int alen,
DO_NTOHL(*hello_send_us, a + i + 2); DO_NTOHL(*hello_send_us, a + i + 2);
ret = 1; ret = 1;
} else { } else {
zlog_err("Received incorrect RTT sub-TLV on Hello message."); zlog_ferr(BABEL_ERR_PACKET,
"Received incorrect RTT sub-TLV on Hello message.");
} }
} else { } else {
debugf(BABEL_DEBUG_COMMON, debugf(BABEL_DEBUG_COMMON,
@ -230,12 +235,14 @@ parse_ihu_subtlv(const unsigned char *a, int alen,
} }
if(i + 1 > alen) { if(i + 1 > alen) {
zlog_err("Received truncated sub-TLV on IHU message."); zlog_ferr(BABEL_ERR_PACKET,
"Received truncated sub-TLV on IHU message.");
return -1; return -1;
} }
len = a[i + 1]; len = a[i + 1];
if(i + len > alen) { if(i + len > alen) {
zlog_err("Received truncated sub-TLV on IHU message."); zlog_ferr(BABEL_ERR_PACKET,
"Received truncated sub-TLV on IHU message.");
return -1; return -1;
} }
@ -248,7 +255,8 @@ parse_ihu_subtlv(const unsigned char *a, int alen,
ret = 1; ret = 1;
} }
else { else {
zlog_err("Received incorrect RTT sub-TLV on IHU message."); zlog_ferr(BABEL_ERR_PACKET,
"Received incorrect RTT sub-TLV on IHU message.");
} }
} else { } else {
debugf(BABEL_DEBUG_COMMON, debugf(BABEL_DEBUG_COMMON,
@ -337,27 +345,29 @@ parse_packet(const unsigned char *from, struct interface *ifp,
} }
if(!linklocal(from)) { if(!linklocal(from)) {
zlog_err("Received packet from non-local address %s.", zlog_ferr(BABEL_ERR_PACKET,
format_address(from)); "Received packet from non-local address %s.",
format_address(from));
return; return;
} }
if (babel_packet_examin (packet, packetlen)) { if (babel_packet_examin (packet, packetlen)) {
zlog_err("Received malformed packet on %s from %s.", zlog_ferr(BABEL_ERR_PACKET,
ifp->name, format_address(from)); "Received malformed packet on %s from %s.",
ifp->name, format_address(from));
return; return;
} }
neigh = find_neighbour(from, ifp); neigh = find_neighbour(from, ifp);
if(neigh == NULL) { if(neigh == NULL) {
zlog_err("Couldn't allocate neighbour."); zlog_ferr(BABEL_ERR_PACKET, "Couldn't allocate neighbour.");
return; return;
} }
DO_NTOHS(bodylen, packet + 2); DO_NTOHS(bodylen, packet + 2);
if(bodylen + 4 > packetlen) { if(bodylen + 4 > packetlen) {
zlog_err("Received truncated packet (%d + 4 > %d).", zlog_ferr(BABEL_ERR_PACKET, "Received truncated packet (%d + 4 > %d).",
bodylen, packetlen); bodylen, packetlen);
bodylen = packetlen - 4; bodylen = packetlen - 4;
} }
@ -506,7 +516,8 @@ parse_packet(const unsigned char *from, struct interface *ifp,
have_router_id = 1; have_router_id = 1;
} }
if(!have_router_id && message[2] != 0) { if(!have_router_id && message[2] != 0) {
zlog_err("Received prefix with no router id."); zlog_ferr(BABEL_ERR_PACKET,
"Received prefix with no router id.");
goto fail; goto fail;
} }
debugf(BABEL_DEBUG_COMMON,"Received update%s%s for %s from %s on %s.", debugf(BABEL_DEBUG_COMMON,"Received update%s%s for %s from %s on %s.",
@ -517,7 +528,8 @@ parse_packet(const unsigned char *from, struct interface *ifp,
if(message[2] == 0) { if(message[2] == 0) {
if(metric < 0xFFFF) { if(metric < 0xFFFF) {
zlog_err("Received wildcard update with finite metric."); zlog_ferr(BABEL_ERR_PACKET,
"Received wildcard update with finite metric.");
goto done; goto done;
} }
retract_neighbour_routes(neigh); retract_neighbour_routes(neigh);
@ -609,8 +621,9 @@ parse_packet(const unsigned char *from, struct interface *ifp,
continue; continue;
fail: fail:
zlog_err("Couldn't parse packet (%d, %d) from %s on %s.", zlog_ferr(BABEL_ERR_PACKET,
message[0], message[1], format_address(from), ifp->name); "Couldn't parse packet (%d, %d) from %s on %s.",
message[0], message[1], format_address(from), ifp->name);
goto done; goto done;
} }
@ -697,7 +710,7 @@ fill_rtt_message(struct interface *ifp)
DO_HTONL(babel_ifp->sendbuf + babel_ifp->buffered_hello + 10, time); DO_HTONL(babel_ifp->sendbuf + babel_ifp->buffered_hello + 10, time);
return 1; return 1;
} else { } else {
zlog_err("No space left for timestamp sub-TLV " zlog_ferr(BABEL_ERR_PACKET, "No space left for timestamp sub-TLV "
"(this shouldn't happen)"); "(this shouldn't happen)");
return -1; return -1;
} }
@ -732,10 +745,11 @@ flushbuf(struct interface *ifp)
babel_ifp->sendbuf, babel_ifp->buffered, babel_ifp->sendbuf, babel_ifp->buffered,
(struct sockaddr*)&sin6, sizeof(sin6)); (struct sockaddr*)&sin6, sizeof(sin6));
if(rc < 0) if(rc < 0)
zlog_err("send: %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_PACKET, "send: %s", safe_strerror(errno));
} else { } else {
zlog_err("Warning: bucket full, dropping packet to %s.", zlog_ferr(BABEL_ERR_PACKET,
ifp->name); "Warning: bucket full, dropping packet to %s.",
ifp->name);
} }
} }
VALGRIND_MAKE_MEM_UNDEFINED(babel_ifp->sendbuf, babel_ifp->bufsize); VALGRIND_MAKE_MEM_UNDEFINED(babel_ifp->sendbuf, babel_ifp->bufsize);
@ -856,7 +870,8 @@ start_unicast_message(struct neighbour *neigh, int type, int len)
if(!unicast_buffer) if(!unicast_buffer)
unicast_buffer = malloc(UNICAST_BUFSIZE); unicast_buffer = malloc(UNICAST_BUFSIZE);
if(!unicast_buffer) { if(!unicast_buffer) {
zlog_err("malloc(unicast_buffer): %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_MEMORY, "malloc(unicast_buffer): %s",
safe_strerror(errno));
return -1; return -1;
} }
@ -992,11 +1007,13 @@ flush_unicast(int dofree)
unicast_buffer, unicast_buffered, unicast_buffer, unicast_buffered,
(struct sockaddr*)&sin6, sizeof(sin6)); (struct sockaddr*)&sin6, sizeof(sin6));
if(rc < 0) if(rc < 0)
zlog_err("send(unicast): %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_PACKET, "send(unicast): %s",
safe_strerror(errno));
} else { } else {
zlog_err("Warning: bucket full, dropping unicast packet to %s if %s.", zlog_ferr(BABEL_ERR_PACKET,
format_address(unicast_neighbour->address), "Warning: bucket full, dropping unicast packet to %s if %s.",
unicast_neighbour->ifp->name); format_address(unicast_neighbour->address),
unicast_neighbour->ifp->name);
} }
done: done:
@ -1301,7 +1318,8 @@ buffer_update(struct interface *ifp,
again: again:
babel_ifp->buffered_updates = malloc(n *sizeof(struct buffered_update)); babel_ifp->buffered_updates = malloc(n *sizeof(struct buffered_update));
if(babel_ifp->buffered_updates == NULL) { if(babel_ifp->buffered_updates == NULL) {
zlog_err("malloc(buffered_updates): %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_MEMORY, "malloc(buffered_updates): %s",
safe_strerror(errno));
if(n > 4) { if(n > 4) {
/* Try again with a tiny buffer. */ /* Try again with a tiny buffer. */
n = 4; n = 4;
@ -1364,7 +1382,7 @@ send_update(struct interface *ifp, int urgent,
} }
route_stream_done(routes); route_stream_done(routes);
} else { } else {
zlog_err("Couldn't allocate route stream."); zlog_ferr(BABEL_ERR_MEMORY, "Couldn't allocate route stream.");
} }
set_timeout(&babel_ifp->update_timeout, babel_ifp->update_interval); set_timeout(&babel_ifp->update_timeout, babel_ifp->update_interval);
babel_ifp->last_update_time = babel_now.tv_sec; babel_ifp->last_update_time = babel_now.tv_sec;
@ -1442,7 +1460,7 @@ send_self_update(struct interface *ifp)
} }
xroute_stream_done(xroutes); xroute_stream_done(xroutes);
} else { } else {
zlog_err("Couldn't allocate xroute stream."); zlog_ferr(BABEL_ERR_MEMORY, "Couldn't allocate xroute stream.");
} }
} }

View File

@ -38,6 +38,7 @@ THE SOFTWARE.
#include "route.h" #include "route.h"
#include "message.h" #include "message.h"
#include "resend.h" #include "resend.h"
#include "babel_errors.h"
struct neighbour *neighs = NULL; struct neighbour *neighs = NULL;
@ -89,7 +90,8 @@ find_neighbour(const unsigned char *address, struct interface *ifp)
neigh = malloc(sizeof(struct neighbour)); neigh = malloc(sizeof(struct neighbour));
if(neigh == NULL) { if(neigh == NULL) {
zlog_err("malloc(neighbour): %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_MEMORY, "malloc(neighbour): %s",
safe_strerror(errno));
return NULL; return NULL;
} }

View File

@ -34,13 +34,14 @@ THE SOFTWARE.
#include "xroute.h" #include "xroute.h"
#include "message.h" #include "message.h"
#include "resend.h" #include "resend.h"
#include "babel_errors.h"
static void consider_route(struct babel_route *route); static void consider_route(struct babel_route *route);
struct babel_route **routes = NULL; struct babel_route **routes = NULL;
static int route_slots = 0, max_route_slots = 0; static int route_slots = 0, max_route_slots = 0;
int kernel_metric = 0; int kernel_metric = 0;
int diversity_kind = DIVERSITY_NONE; enum babel_diversity diversity_kind = DIVERSITY_NONE;
int diversity_factor = BABEL_DEFAULT_DIVERSITY_FACTOR; int diversity_factor = BABEL_DEFAULT_DIVERSITY_FACTOR;
int keep_unfeasible = 0; int keep_unfeasible = 0;
@ -398,15 +399,16 @@ install_route(struct babel_route *route)
return; return;
if(!route_feasible(route)) if(!route_feasible(route))
zlog_err("WARNING: installing unfeasible route " zlog_ferr(BABEL_ERR_ROUTE, "WARNING: installing unfeasible route "
"(this shouldn't happen)."); "(this shouldn't happen).");
i = find_route_slot(route->src->prefix, route->src->plen, NULL); i = find_route_slot(route->src->prefix, route->src->plen, NULL);
assert(i >= 0 && i < route_slots); assert(i >= 0 && i < route_slots);
if(routes[i] != route && routes[i]->installed) { if(routes[i] != route && routes[i]->installed) {
zlog_err("WARNING: attempting to install duplicate route " zlog_ferr(BABEL_ERR_ROUTE,
"(this shouldn't happen)."); "WARNING: attempting to install duplicate route "
"(this shouldn't happen).");
return; return;
} }
@ -416,7 +418,8 @@ install_route(struct babel_route *route)
metric_to_kernel(route_metric(route)), NULL, 0, 0); metric_to_kernel(route_metric(route)), NULL, 0, 0);
if(rc < 0) { if(rc < 0) {
int save = errno; int save = errno;
zlog_err("kernel_route(ADD): %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_ROUTE, "kernel_route(ADD): %s",
safe_strerror(errno));
if(save != EEXIST) if(save != EEXIST)
return; return;
} }
@ -438,7 +441,8 @@ uninstall_route(struct babel_route *route)
route->neigh->ifp->ifindex, route->neigh->ifp->ifindex,
metric_to_kernel(route_metric(route)), NULL, 0, 0); metric_to_kernel(route_metric(route)), NULL, 0, 0);
if(rc < 0) if(rc < 0)
zlog_err("kernel_route(FLUSH): %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_ROUTE, "kernel_route(FLUSH): %s",
safe_strerror(errno));
route->installed = 0; route->installed = 0;
} }
@ -461,8 +465,8 @@ switch_routes(struct babel_route *old, struct babel_route *new)
return; return;
if(!route_feasible(new)) if(!route_feasible(new))
zlog_err("WARNING: switching to unfeasible route " zlog_ferr(BABEL_ERR_ROUTE, "WARNING: switching to unfeasible route "
"(this shouldn't happen)."); "(this shouldn't happen).");
rc = kernel_route(ROUTE_MODIFY, old->src->prefix, old->src->plen, rc = kernel_route(ROUTE_MODIFY, old->src->prefix, old->src->plen,
old->nexthop, old->neigh->ifp->ifindex, old->nexthop, old->neigh->ifp->ifindex,
@ -470,7 +474,8 @@ switch_routes(struct babel_route *old, struct babel_route *new)
new->nexthop, new->neigh->ifp->ifindex, new->nexthop, new->neigh->ifp->ifindex,
metric_to_kernel(route_metric(new))); metric_to_kernel(route_metric(new)));
if(rc < 0) { if(rc < 0) {
zlog_err("kernel_route(MODIFY): %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_ROUTE, "kernel_route(MODIFY): %s",
safe_strerror(errno));
return; return;
} }
@ -498,7 +503,8 @@ change_route_metric(struct babel_route *route,
route->nexthop, route->neigh->ifp->ifindex, route->nexthop, route->neigh->ifp->ifindex,
new); new);
if(rc < 0) { if(rc < 0) {
zlog_err("kernel_route(MODIFY metric): %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_ROUTE, "kernel_route(MODIFY metric): %s",
safe_strerror(errno));
return; return;
} }
} }
@ -581,10 +587,9 @@ route_interferes(struct babel_route *route, struct interface *ifp)
} }
} }
return 0; return 0;
default:
zlog_err("Unknown kind of diversity.");
return 1;
} }
return 1;
} }
int int
@ -793,7 +798,7 @@ update_route(const unsigned char *router_id,
return NULL; return NULL;
if(martian_prefix(prefix, plen)) { if(martian_prefix(prefix, plen)) {
zlog_err("Rejecting martian route to %s through %s.", zlog_ferr(BABEL_ERR_ROUTE, "Rejecting martian route to %s through %s.",
format_prefix(prefix, plen), format_address(nexthop)); format_prefix(prefix, plen), format_address(nexthop));
return NULL; return NULL;
} }
@ -901,7 +906,7 @@ update_route(const unsigned char *router_id,
route->next = NULL; route->next = NULL;
new_route = insert_route(route); new_route = insert_route(route);
if(new_route == NULL) { if(new_route == NULL) {
zlog_err("Couldn't insert route."); zlog_ferr(BABEL_ERR_ROUTE, "Couldn't insert route.");
free(route); free(route);
return NULL; return NULL;
} }

View File

@ -27,10 +27,12 @@ THE SOFTWARE.
#include "babel_interface.h" #include "babel_interface.h"
#include "source.h" #include "source.h"
#define DIVERSITY_NONE 0 enum babel_diversity {
#define DIVERSITY_INTERFACE_1 1 DIVERSITY_NONE,
#define DIVERSITY_CHANNEL_1 2 DIVERSITY_INTERFACE_1,
#define DIVERSITY_CHANNEL 3 DIVERSITY_CHANNEL_1,
DIVERSITY_CHANNEL,
};
#define DIVERSITY_HOPS 8 #define DIVERSITY_HOPS 8
@ -55,7 +57,8 @@ struct route_stream;
extern struct babel_route **routes; extern struct babel_route **routes;
extern int kernel_metric; extern int kernel_metric;
extern int diversity_kind, diversity_factor; extern enum babel_diversity diversity_kind;
extern int diversity_factor;
extern int keep_unfeasible; extern int keep_unfeasible;
extern int smoothing_half_life; extern int smoothing_half_life;

View File

@ -31,6 +31,7 @@ THE SOFTWARE.
#include "source.h" #include "source.h"
#include "babel_interface.h" #include "babel_interface.h"
#include "route.h" #include "route.h"
#include "babel_errors.h"
struct source *srcs = NULL; struct source *srcs = NULL;
@ -58,7 +59,7 @@ find_source(const unsigned char *id, const unsigned char *p, unsigned char plen,
src = malloc(sizeof(struct source)); src = malloc(sizeof(struct source));
if(src == NULL) { if(src == NULL) {
zlog_err("malloc(source): %s", safe_strerror(errno)); zlog_ferr(BABEL_ERR_MEMORY, "malloc(source): %s", safe_strerror(errno));
return NULL; return NULL;
} }