Even more cosmetic log message changes.
This commit is contained in:
parent
0a0c74efcc
commit
efe50a30a6
@ -169,7 +169,7 @@ void ifchange_deconfig(void)
|
|||||||
|
|
||||||
snprintf(buf, sizeof buf, "interface:%s:ip:0.0.0.0:",
|
snprintf(buf, sizeof buf, "interface:%s:ip:0.0.0.0:",
|
||||||
client_config.interface);
|
client_config.interface);
|
||||||
log_line("sent to ifchd: ip:0.0.0.0:");
|
log_line("Sent to ifchd: ip:0.0.0.0:");
|
||||||
sockwrite(sockfd, buf, strlen(buf));
|
sockwrite(sockfd, buf, strlen(buf));
|
||||||
|
|
||||||
cfg_deconfig = 1;
|
cfg_deconfig = 1;
|
||||||
@ -186,7 +186,7 @@ static size_t send_client_ip(char *out, size_t olen, struct dhcpmsg *packet)
|
|||||||
inet_ntop(AF_INET, &packet->yiaddr, ip, sizeof ip);
|
inet_ntop(AF_INET, &packet->yiaddr, ip, sizeof ip);
|
||||||
snprintf(ipb, sizeof ipb, "ip:%s:", ip);
|
snprintf(ipb, sizeof ipb, "ip:%s:", ip);
|
||||||
strlcat(out, ipb, olen);
|
strlcat(out, ipb, olen);
|
||||||
log_line("sent to ifchd: %s", ipb);
|
log_line("Sent to ifchd: %s", ipb);
|
||||||
return strlen(ipb);
|
return strlen(ipb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ static size_t send_cmd(char *out, size_t olen, struct dhcpmsg *packet,
|
|||||||
if (ifchd_cmd(buf, sizeof buf, optdata, optlen, code) == -1)
|
if (ifchd_cmd(buf, sizeof buf, optdata, optlen, code) == -1)
|
||||||
return 0;
|
return 0;
|
||||||
strlcat(out, buf, olen);
|
strlcat(out, buf, olen);
|
||||||
log_line("sent to ifchd: %s", buf);
|
log_line("Sent to ifchd: %s", buf);
|
||||||
return strlen(buf);
|
return strlen(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ void open_leasefile()
|
|||||||
if (strlen(leasefile) > 0) {
|
if (strlen(leasefile) > 0) {
|
||||||
leasefilefd = open(leasefile, O_WRONLY|O_TRUNC|O_CREAT, 0644);
|
leasefilefd = open(leasefile, O_WRONLY|O_TRUNC|O_CREAT, 0644);
|
||||||
if (leasefilefd < 0) {
|
if (leasefilefd < 0) {
|
||||||
log_line("Failed to create lease file (%s)\n", leasefile);
|
log_line("Failed to create lease file (%s).", leasefile);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -67,13 +67,13 @@ void write_leasefile(struct in_addr ipnum)
|
|||||||
case -1:
|
case -1:
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
goto retry_trunc;
|
goto retry_trunc;
|
||||||
log_warning("Failed to truncate lease file.\n");
|
log_warning("Failed to truncate lease file.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lseek(leasefilefd, 0, SEEK_SET);
|
lseek(leasefilefd, 0, SEEK_SET);
|
||||||
ret = safe_write(leasefilefd, ip, strlen(ip));
|
ret = safe_write(leasefilefd, ip, strlen(ip));
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
log_warning("Failed to write ip to lease file.\n");
|
log_warning("Failed to write ip to lease file.");
|
||||||
else
|
else
|
||||||
fsync(leasefilefd);
|
fsync(leasefilefd);
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ uint8_t option_length(uint8_t code)
|
|||||||
for (int i = 0; options[i].code; i++)
|
for (int i = 0; options[i].code; i++)
|
||||||
if (options[i].code == code)
|
if (options[i].code == code)
|
||||||
return option_type_length(options[i].type & 0xf);
|
return option_type_length(options[i].type & 0xf);
|
||||||
log_warning("option_length: unknown length for code 0x%02x", code);
|
log_warning("option_length: Unknown length for code 0x%02x.", code);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ static uint8_t *do_get_option_data(uint8_t *buf, ssize_t buflen, int code,
|
|||||||
|
|
||||||
buflen -= buf[1] + 2;
|
buflen -= buf[1] + 2;
|
||||||
if (buflen < 0) {
|
if (buflen < 0) {
|
||||||
log_warning("Bad dhcp data: option length would exceed options field length");
|
log_warning("Bad option data: length would exceed options field size.");
|
||||||
*optlen = 0;
|
*optlen = 0;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ ssize_t get_end_option_idx(struct dhcpmsg *packet)
|
|||||||
if (packet->options[i] != DHCP_PADDING)
|
if (packet->options[i] != DHCP_PADDING)
|
||||||
i += packet->options[i+1] + 1;
|
i += packet->options[i+1] + 1;
|
||||||
}
|
}
|
||||||
log_warning("get_end_option_idx(): did not find DHCP_END marker");
|
log_warning("get_end_option_idx: Did not find DHCP_END marker.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,11 +230,11 @@ size_t add_option_string(struct dhcpmsg *packet, uint8_t code, char *str,
|
|||||||
|
|
||||||
ssize_t end = get_end_option_idx(packet);
|
ssize_t end = get_end_option_idx(packet);
|
||||||
if (end == -1) {
|
if (end == -1) {
|
||||||
log_warning("add_option_string: Buffer has no DHCP_END marker");
|
log_warning("add_option_string: Buffer has no DHCP_END marker.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (end + len >= sizeof packet->options) {
|
if (end + len >= sizeof packet->options) {
|
||||||
log_warning("add_option_string: No space for option 0x%02x", code);
|
log_warning("add_option_string: No space for option 0x%02x.", code);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
packet->options[end] = code;
|
packet->options[end] = code;
|
||||||
@ -249,17 +249,17 @@ static ssize_t add_option_check(struct dhcpmsg *packet, uint8_t code,
|
|||||||
{
|
{
|
||||||
size_t length = option_length(code);
|
size_t length = option_length(code);
|
||||||
if (length != rlen) {
|
if (length != rlen) {
|
||||||
log_warning("add_u%01u_option: length mismatch code=0x%02x len=%01u",
|
log_warning("add_u%01u_option: Length mismatch: code=0x%02x len=%01u.",
|
||||||
rlen*8, code, length);
|
rlen*8, code, length);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ssize_t end = get_end_option_idx(packet);
|
ssize_t end = get_end_option_idx(packet);
|
||||||
if (end == -1) {
|
if (end == -1) {
|
||||||
log_warning("add_u%01u_option: Buffer has no DHCP_END marker", rlen*8);
|
log_warning("add_u%01u_option: Buffer has no DHCP_END marker.", rlen*8);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (end + 2 + rlen >= sizeof packet->options) {
|
if (end + 2 + rlen >= sizeof packet->options) {
|
||||||
log_warning("add_u%01u_option: No space for option 0x%02x",
|
log_warning("add_u%01u_option: No space for option 0x%02x.",
|
||||||
rlen*8, code);
|
rlen*8, code);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ void background(struct client_state_t *cs)
|
|||||||
setup_signals(cs);
|
setup_signals(cs);
|
||||||
}
|
}
|
||||||
if (file_exists(pidfile, "w") == -1) {
|
if (file_exists(pidfile, "w") == -1) {
|
||||||
log_line("cannot open pidfile for write!");
|
log_line("Cannot open pidfile for write!");
|
||||||
} else
|
} else
|
||||||
write_pid(pidfile);
|
write_pid(pidfile);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user