message string changes, mostly for consistency, also -32 bytes in .rodata
This commit is contained in:
@@ -81,7 +81,7 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface)
|
||||
FD_SET(s, &fdset);
|
||||
tm.tv_sec = timeout;
|
||||
if (select(s + 1, &fdset, (fd_set *) NULL, (fd_set *) NULL, &tm) < 0) {
|
||||
bb_perror_msg("Error on ARPING request");
|
||||
bb_perror_msg("error on ARPING request");
|
||||
if (errno != EINTR) rv = 0;
|
||||
} else if (FD_ISSET(s, &fdset)) {
|
||||
if (recv(s, &arp, sizeof(arp), 0) < 0 ) rv = 0;
|
||||
|
@@ -216,14 +216,14 @@ int get_raw_packet(struct dhcpMessage *payload, int fd)
|
||||
packet.ip.daddr = dest;
|
||||
packet.ip.tot_len = packet.udp.len; /* cheat on the psuedo-header */
|
||||
if (check && check != udhcp_checksum(&packet, bytes)) {
|
||||
bb_error_msg("Packet with bad UDP checksum received, ignoring");
|
||||
bb_error_msg("packet with bad UDP checksum received, ignoring");
|
||||
return -2;
|
||||
}
|
||||
|
||||
memcpy(payload, &(packet.data), bytes - (sizeof(packet.ip) + sizeof(packet.udp)));
|
||||
|
||||
if (ntohl(payload->cookie) != DHCP_MAGIC) {
|
||||
bb_error_msg("Received bogus message (bad magic) - ignoring");
|
||||
bb_error_msg("received bogus message (bad magic) - ignoring");
|
||||
return -2;
|
||||
}
|
||||
DEBUG("oooooh!!! got some!");
|
||||
|
@@ -53,7 +53,7 @@ static inline void sanitize_fds(void)
|
||||
void udhcp_background(const char *pidfile)
|
||||
{
|
||||
#ifdef __uClinux__
|
||||
bb_error_msg("Cannot background in uclinux (yet)");
|
||||
bb_error_msg("cannot background in uclinux (yet)");
|
||||
#else /* __uClinux__ */
|
||||
int pid_fd;
|
||||
|
||||
|
@@ -284,7 +284,7 @@ int read_config(const char *file)
|
||||
keywords[i].handler(keywords[i].def, keywords[i].var);
|
||||
|
||||
if (!(in = fopen(file, "r"))) {
|
||||
bb_error_msg("Unable to open config file: %s", file);
|
||||
bb_error_msg("unable to open config file: %s", file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ int read_config(const char *file)
|
||||
for (i = 0; keywords[i].keyword[0]; i++)
|
||||
if (!strcasecmp(token, keywords[i].keyword))
|
||||
if (!keywords[i].handler(line, keywords[i].var)) {
|
||||
bb_error_msg("Failure parsing line %d of %s", lm, file);
|
||||
bb_error_msg("failure parsing line %d of %s", lm, file);
|
||||
if (ENABLE_FEATURE_UDHCP_DEBUG)
|
||||
bb_error_msg("unable to parse '%s'", debug_orig);
|
||||
/* reset back to the default value */
|
||||
@@ -329,7 +329,7 @@ void write_leases(void)
|
||||
unsigned long tmp_time;
|
||||
|
||||
if (!(fp = fopen(server_config.lease_file, "w"))) {
|
||||
bb_error_msg("Unable to open %s for writing", server_config.lease_file);
|
||||
bb_error_msg("unable to open %s for writing", server_config.lease_file);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ void read_leases(const char *file)
|
||||
struct dhcpOfferedAddr lease;
|
||||
|
||||
if (!(fp = fopen(file, "r"))) {
|
||||
bb_error_msg("Unable to open %s for reading", file);
|
||||
bb_error_msg("unable to open %s for reading", file);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ void read_leases(const char *file)
|
||||
lease.expires = ntohl(lease.expires);
|
||||
if (!server_config.remaining) lease.expires -= time(0);
|
||||
if (!(add_lease(lease.chaddr, lease.yiaddr, lease.expires))) {
|
||||
bb_error_msg("Too many leases while loading %s", file);
|
||||
bb_error_msg("too many leases while loading %s", file);
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
|
@@ -76,12 +76,12 @@ uint8_t *get_option(struct dhcpMessage *packet, int code)
|
||||
length = 308;
|
||||
while (!done) {
|
||||
if (i >= length) {
|
||||
bb_error_msg("Bogus packet, option fields too long");
|
||||
bb_error_msg("bogus packet, option fields too long");
|
||||
return NULL;
|
||||
}
|
||||
if (optionptr[i + OPT_CODE] == code) {
|
||||
if (i + 1 + optionptr[i + OPT_LEN] >= length) {
|
||||
bb_error_msg("Bogus packet, option fields too long");
|
||||
bb_error_msg("bogus packet, option fields too long");
|
||||
return NULL;
|
||||
}
|
||||
return optionptr + i + 2;
|
||||
@@ -92,7 +92,7 @@ uint8_t *get_option(struct dhcpMessage *packet, int code)
|
||||
break;
|
||||
case DHCP_OPTION_OVER:
|
||||
if (i + 1 + optionptr[i + OPT_LEN] >= length) {
|
||||
bb_error_msg("Bogus packet, option fields too long");
|
||||
bb_error_msg("bogus packet, option fields too long");
|
||||
return NULL;
|
||||
}
|
||||
over = optionptr[i + 3];
|
||||
@@ -140,7 +140,7 @@ int add_option_string(uint8_t *optionptr, uint8_t *string)
|
||||
|
||||
/* end position + string length + option code/length + end option */
|
||||
if (end + string[OPT_LEN] + 2 + 1 >= 308) {
|
||||
bb_error_msg("Option 0x%02x did not fit into the packet",
|
||||
bb_error_msg("option 0x%02x did not fit into the packet",
|
||||
string[OPT_CODE]);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -58,12 +58,12 @@ int udhcp_get_packet(struct dhcpMessage *packet, int fd)
|
||||
memset(packet, 0, sizeof(struct dhcpMessage));
|
||||
bytes = read(fd, packet, sizeof(struct dhcpMessage));
|
||||
if (bytes < 0) {
|
||||
DEBUG("couldn't read on listening socket, ignoring");
|
||||
DEBUG("cannot read on listening socket, ignoring");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ntohl(packet->cookie) != DHCP_MAGIC) {
|
||||
bb_error_msg("Received bogus message, ignoring");
|
||||
bb_error_msg("received bogus message, ignoring");
|
||||
return -2;
|
||||
}
|
||||
DEBUG("Received a packet");
|
||||
|
@@ -45,7 +45,7 @@ int pidfile_acquire(const char *pidfile)
|
||||
|
||||
pid_fd = open(pidfile, O_CREAT | O_WRONLY, 0644);
|
||||
if (pid_fd < 0) {
|
||||
bb_perror_msg("Unable to open pidfile %s", pidfile);
|
||||
bb_perror_msg("unable to open pidfile %s", pidfile);
|
||||
} else {
|
||||
lockf(pid_fd, F_LOCK, 0);
|
||||
if (!saved_pidfile)
|
||||
@@ -63,14 +63,11 @@ void pidfile_write_release(int pid_fd)
|
||||
|
||||
if (pid_fd < 0) return;
|
||||
|
||||
if ((out = fdopen(pid_fd, "w")) != NULL) {
|
||||
out = fdopen(pid_fd, "w");
|
||||
if (out) {
|
||||
fprintf(out, "%d\n", getpid());
|
||||
fclose(out);
|
||||
}
|
||||
lockf(pid_fd, F_UNLCK, 0);
|
||||
close(pid_fd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -158,12 +158,12 @@ int sendOffer(struct dhcpMessage *oldpacket)
|
||||
}
|
||||
|
||||
if(!packet.yiaddr) {
|
||||
bb_error_msg("No IP addresses to give - OFFER abandoned");
|
||||
bb_error_msg("no IP addresses to give - OFFER abandoned");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!add_lease(packet.chaddr, packet.yiaddr, server_config.offer_time)) {
|
||||
bb_error_msg("Lease pool is full - OFFER abandoned");
|
||||
bb_error_msg("lease pool is full - OFFER abandoned");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user