aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-20 13:28:22 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-20 13:28:22 +0000
commite1a0d486e4804eae098571f1a6788394c2ee51ae (patch)
treec6f3435738900c8d53832eb919b1b2c3d524f2e5 /networking/udhcp
parentdd2982882bb192ea757f32514bc2ea0bc96f5ba0 (diff)
downloadbusybox-e1a0d486e4804eae098571f1a6788394c2ee51ae.tar.gz
message string changes, mostly for consistency, also -32 bytes in .rodata
Diffstat (limited to 'networking/udhcp')
-rw-r--r--networking/udhcp/arpping.c2
-rw-r--r--networking/udhcp/clientpacket.c4
-rw-r--r--networking/udhcp/common.c2
-rw-r--r--networking/udhcp/files.c10
-rw-r--r--networking/udhcp/options.c8
-rw-r--r--networking/udhcp/packet.c4
-rw-r--r--networking/udhcp/pidfile.c9
-rw-r--r--networking/udhcp/serverpacket.c4
8 files changed, 20 insertions, 23 deletions
diff --git a/networking/udhcp/arpping.c b/networking/udhcp/arpping.c
index 086692082..2716a28c6 100644
--- a/networking/udhcp/arpping.c
+++ b/networking/udhcp/arpping.c
@@ -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;
diff --git a/networking/udhcp/clientpacket.c b/networking/udhcp/clientpacket.c
index 439aa0250..58b26c171 100644
--- a/networking/udhcp/clientpacket.c
+++ b/networking/udhcp/clientpacket.c
@@ -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!");
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index ca0c79b95..a0a21fdce 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -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;
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c
index 52d383869..36bcc31d9 100644
--- a/networking/udhcp/files.c
+++ b/networking/udhcp/files.c
@@ -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++;
diff --git a/networking/udhcp/options.c b/networking/udhcp/options.c
index 8dba2ef69..5cc08cca0 100644
--- a/networking/udhcp/options.c
+++ b/networking/udhcp/options.c
@@ -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;
}
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 30675eaab..f12ecd6ec 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -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");
diff --git a/networking/udhcp/pidfile.c b/networking/udhcp/pidfile.c
index 148b07b34..6673c9502 100644
--- a/networking/udhcp/pidfile.c
+++ b/networking/udhcp/pidfile.c
@@ -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);
}
-
-
-
-
diff --git a/networking/udhcp/serverpacket.c b/networking/udhcp/serverpacket.c
index cfead413c..b5cfcf405 100644
--- a/networking/udhcp/serverpacket.c
+++ b/networking/udhcp/serverpacket.c
@@ -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;
}