send_notify(struct client *client, void *arg)
{
serial_t *serial = arg;
- int error;
/* Send Serial Notify PDU */
- error = send_serial_notify_pdu(client->fd, client->rtr_version,
+ send_serial_notify_pdu(client->fd, client->rtr_version,
*serial);
- /* Error? Log it... */
- if (error)
- pr_warn("Error code %d sending notify PDU to client.", error);
-
- return 0; /* ...but do not interrupt notify to other clients */
+ /* Errors already logged, do not interrupt notify to other clients */
+ return 0;
}
int
{
switch (type) {
case PDU_TYPE_SERIAL_NOTIFY:
- return "Serial Notify";
+ return "Serial Notify PDU";
case PDU_TYPE_SERIAL_QUERY:
- return "Serial Query";
+ return "Serial Query PDU";
case PDU_TYPE_RESET_QUERY:
- return "Reset Query";
+ return "Reset Query PDU";
case PDU_TYPE_CACHE_RESPONSE:
- return "Cache Response";
+ return "Cache Response PDU";
case PDU_TYPE_IPV4_PREFIX:
- return "IPv4 Prefix";
+ return "IPv4 Prefix PDU";
case PDU_TYPE_IPV6_PREFIX:
- return "IPv6 Prefix";
+ return "IPv6 Prefix PDU";
case PDU_TYPE_END_OF_DATA:
- return "End of Data";
+ return "End of Data PDU";
case PDU_TYPE_CACHE_RESET:
- return "Cache Reset";
+ return "Cache Reset PDU";
case PDU_TYPE_ROUTER_KEY:
- return "Router Key";
+ return "Router Key PDU";
case PDU_TYPE_ERROR_REPORT:
- return "Error Report";
+ return "Error Report PDU";
}
- return "(unknown)";
+ return "unknown PDU";
}
static int
if (log_debug_enabled()) {
char buffer[INET6_ADDRSTRLEN];
- pr_debug("Received a %s PDU from %s.",
+ pr_debug("Received a %s from %s.",
pdutype2str(header.pdu_type),
sockaddr2str(client_addr, buffer));
}
{
int error;
- pr_debug("Sending %s PDU to client.", pdutype2str(pdu_type));
+ pr_debug("Sending %s to client.", pdutype2str(pdu_type));
error = write(fd, data, data_len);
if (error < 0)
- return pr_errno(errno, "Error sending response");
+ return pr_errno(errno, "Error sending %s to client.",
+ pdutype2str(pdu_type));
return 0;
}