diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-20 13:28:22 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-20 13:28:22 +0000 |
| commit | e1a0d486e4804eae098571f1a6788394c2ee51ae (patch) | |
| tree | c6f3435738900c8d53832eb919b1b2c3d524f2e5 /networking | |
| parent | dd2982882bb192ea757f32514bc2ea0bc96f5ba0 (diff) | |
| download | busybox-w32-e1a0d486e4804eae098571f1a6788394c2ee51ae.tar.gz busybox-w32-e1a0d486e4804eae098571f1a6788394c2ee51ae.tar.bz2 busybox-w32-e1a0d486e4804eae098571f1a6788394c2ee51ae.zip | |
message string changes, mostly for consistency, also -32 bytes in .rodata
Diffstat (limited to 'networking')
| -rw-r--r-- | networking/arping.c | 2 | ||||
| -rw-r--r-- | networking/ether-wake.c | 2 | ||||
| -rw-r--r-- | networking/httpd.c | 2 | ||||
| -rw-r--r-- | networking/interface.c | 4 | ||||
| -rw-r--r-- | networking/libiproute/iplink.c | 10 | ||||
| -rw-r--r-- | networking/libiproute/utils.c | 14 | ||||
| -rw-r--r-- | networking/netstat.c | 2 | ||||
| -rw-r--r-- | networking/ping.c | 2 | ||||
| -rw-r--r-- | networking/ping6.c | 2 | ||||
| -rw-r--r-- | networking/udhcp/arpping.c | 2 | ||||
| -rw-r--r-- | networking/udhcp/clientpacket.c | 4 | ||||
| -rw-r--r-- | networking/udhcp/common.c | 2 | ||||
| -rw-r--r-- | networking/udhcp/files.c | 10 | ||||
| -rw-r--r-- | networking/udhcp/options.c | 8 | ||||
| -rw-r--r-- | networking/udhcp/packet.c | 4 | ||||
| -rw-r--r-- | networking/udhcp/pidfile.c | 9 | ||||
| -rw-r--r-- | networking/udhcp/serverpacket.c | 4 |
17 files changed, 40 insertions, 43 deletions
diff --git a/networking/arping.c b/networking/arping.c index b9605985c..e4c9b86a9 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
| @@ -392,7 +392,7 @@ int arping_main(int argc, char **argv) | |||
| 392 | } | 392 | } |
| 393 | } | 393 | } |
| 394 | if (me.sll_halen == 0) { | 394 | if (me.sll_halen == 0) { |
| 395 | bb_error_msg("Interface \"%s\" is not ARPable (no ll address)", device); | 395 | bb_error_msg("interface \"%s\" is not ARPable (no ll address)", device); |
| 396 | exit(cfg&dad ? 0 : 2); | 396 | exit(cfg&dad ? 0 : 2); |
| 397 | } | 397 | } |
| 398 | he = me; | 398 | he = me; |
diff --git a/networking/ether-wake.c b/networking/ether-wake.c index 294a9dd3c..9d616d561 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c | |||
| @@ -270,7 +270,7 @@ static inline int get_wol_pw(const char *ethoptarg, unsigned char *wol_passwd) | |||
| 270 | byte_cnt = sscanf(ethoptarg, "%d.%d.%d.%d", | 270 | byte_cnt = sscanf(ethoptarg, "%d.%d.%d.%d", |
| 271 | &passwd[0], &passwd[1], &passwd[2], &passwd[3]); | 271 | &passwd[0], &passwd[1], &passwd[2], &passwd[3]); |
| 272 | if (byte_cnt < 4) { | 272 | if (byte_cnt < 4) { |
| 273 | bb_error_msg("Unable to read the Wake-On-LAN pass"); | 273 | bb_error_msg("unable to read the Wake-On-LAN pass"); |
| 274 | return 0; | 274 | return 0; |
| 275 | } | 275 | } |
| 276 | 276 | ||
diff --git a/networking/httpd.c b/networking/httpd.c index bbb2dfe7f..803c45e6e 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
| @@ -1317,7 +1317,7 @@ static int sendFile(const char *url) | |||
| 1317 | close(f); | 1317 | close(f); |
| 1318 | } else { | 1318 | } else { |
| 1319 | #if DEBUG | 1319 | #if DEBUG |
| 1320 | bb_perror_msg("Unable to open '%s'", url); | 1320 | bb_perror_msg("unable to open '%s'", url); |
| 1321 | #endif | 1321 | #endif |
| 1322 | sendHeaders(HTTP_NOT_FOUND); | 1322 | sendHeaders(HTTP_NOT_FOUND); |
| 1323 | } | 1323 | } |
diff --git a/networking/interface.c b/networking/interface.c index 8e2498d27..4594293e4 100644 --- a/networking/interface.c +++ b/networking/interface.c | |||
| @@ -325,7 +325,7 @@ static int sockets_open(int family) | |||
| 325 | sfd = af->fd; | 325 | sfd = af->fd; |
| 326 | } | 326 | } |
| 327 | if (sfd < 0) { | 327 | if (sfd < 0) { |
| 328 | bb_error_msg("No usable address families found."); | 328 | bb_error_msg("no usable address families found"); |
| 329 | } | 329 | } |
| 330 | return sfd; | 330 | return sfd; |
| 331 | } | 331 | } |
| @@ -557,7 +557,7 @@ static int if_readlist_proc(char *target) | |||
| 557 | 557 | ||
| 558 | fh = fopen(_PATH_PROCNET_DEV, "r"); | 558 | fh = fopen(_PATH_PROCNET_DEV, "r"); |
| 559 | if (!fh) { | 559 | if (!fh) { |
| 560 | bb_perror_msg("Warning: cannot open %s. Limited output.", _PATH_PROCNET_DEV); | 560 | bb_perror_msg("warning: cannot open %s, limiting output", _PATH_PROCNET_DEV); |
| 561 | return if_readconf(); | 561 | return if_readconf(); |
| 562 | } | 562 | } |
| 563 | fgets(buf, sizeof buf, fh); /* eat line */ | 563 | fgets(buf, sizeof buf, fh); /* eat line */ |
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c index d9f28374b..f79dab402 100644 --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* | 2 | /* |
| 3 | * iplink.c "ip link". | 3 | * iplink.c "ip link". |
| 4 | * | 4 | * |
| 5 | * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> | 5 | * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> |
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
| 8 | */ | 8 | */ |
| @@ -31,7 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | static int on_off(char *msg) | 32 | static int on_off(char *msg) |
| 33 | { | 33 | { |
| 34 | bb_error_msg("Error: argument of \"%s\" must be \"on\" or \"off\"", msg); | 34 | bb_error_msg("error: argument of \"%s\" must be \"on\" or \"off\"", msg); |
| 35 | return -1; | 35 | return -1; |
| 36 | } | 36 | } |
| 37 | 37 | ||
| @@ -200,7 +200,7 @@ static int parse_address(char *dev, int hatype, int halen, char *lla, struct ifr | |||
| 200 | if (alen < 0) | 200 | if (alen < 0) |
| 201 | return -1; | 201 | return -1; |
| 202 | if (alen != halen) { | 202 | if (alen != halen) { |
| 203 | bb_error_msg("Wrong address (%s) length: expected %d bytes", lla, halen); | 203 | bb_error_msg("wrong address (%s) length: expected %d bytes", lla, halen); |
| 204 | return -1; | 204 | return -1; |
| 205 | } | 205 | } |
| 206 | return 0; | 206 | return 0; |
| @@ -349,6 +349,6 @@ int do_iplink(int argc, char **argv) | |||
| 349 | } else | 349 | } else |
| 350 | return ipaddr_list_link(0, NULL); | 350 | return ipaddr_list_link(0, NULL); |
| 351 | 351 | ||
| 352 | bb_error_msg("Command \"%s\" is unknown.", *argv); | 352 | bb_error_msg("command \"%s\" is unknown", *argv); |
| 353 | exit(-1); | 353 | exit(-1); |
| 354 | } | 354 | } |
diff --git a/networking/libiproute/utils.c b/networking/libiproute/utils.c index 094a3b0ac..552f4bf77 100644 --- a/networking/libiproute/utils.c +++ b/networking/libiproute/utils.c | |||
| @@ -206,10 +206,10 @@ int get_prefix_1(inet_prefix * dst, char *arg, int family) | |||
| 206 | int get_addr(inet_prefix * dst, char *arg, int family) | 206 | int get_addr(inet_prefix * dst, char *arg, int family) |
| 207 | { | 207 | { |
| 208 | if (family == AF_PACKET) { | 208 | if (family == AF_PACKET) { |
| 209 | bb_error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context.", arg); | 209 | bb_error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context", arg); |
| 210 | } | 210 | } |
| 211 | if (get_addr_1(dst, arg, family)) { | 211 | if (get_addr_1(dst, arg, family)) { |
| 212 | bb_error_msg_and_die("an inet address is expected rather than \"%s\".", arg); | 212 | bb_error_msg_and_die("an inet address is expected rather than \"%s\"", arg); |
| 213 | } | 213 | } |
| 214 | return 0; | 214 | return 0; |
| 215 | } | 215 | } |
| @@ -217,10 +217,10 @@ int get_addr(inet_prefix * dst, char *arg, int family) | |||
| 217 | int get_prefix(inet_prefix * dst, char *arg, int family) | 217 | int get_prefix(inet_prefix * dst, char *arg, int family) |
| 218 | { | 218 | { |
| 219 | if (family == AF_PACKET) { | 219 | if (family == AF_PACKET) { |
| 220 | bb_error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context.", arg); | 220 | bb_error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context", arg); |
| 221 | } | 221 | } |
| 222 | if (get_prefix_1(dst, arg, family)) { | 222 | if (get_prefix_1(dst, arg, family)) { |
| 223 | bb_error_msg_and_die("an inet address is expected rather than \"%s\".", arg); | 223 | bb_error_msg_and_die("an inet address is expected rather than \"%s\"", arg); |
| 224 | } | 224 | } |
| 225 | return 0; | 225 | return 0; |
| 226 | } | 226 | } |
| @@ -237,7 +237,7 @@ __u32 get_addr32(char *name) | |||
| 237 | 237 | ||
| 238 | void incomplete_command(void) | 238 | void incomplete_command(void) |
| 239 | { | 239 | { |
| 240 | bb_error_msg("Command line is not complete. Try option \"help\""); | 240 | bb_error_msg("command line is not complete, try option \"help\""); |
| 241 | exit(-1); | 241 | exit(-1); |
| 242 | } | 242 | } |
| 243 | 243 | ||
| @@ -249,13 +249,13 @@ void invarg(const char * const arg, const char * const opt) | |||
| 249 | 249 | ||
| 250 | void duparg(char *key, char *arg) | 250 | void duparg(char *key, char *arg) |
| 251 | { | 251 | { |
| 252 | bb_error_msg("duplicate \"%s\": \"%s\" is the second value.", key, arg); | 252 | bb_error_msg("duplicate \"%s\": \"%s\" is the second value", key, arg); |
| 253 | exit(-1); | 253 | exit(-1); |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | void duparg2(char *key, char *arg) | 256 | void duparg2(char *key, char *arg) |
| 257 | { | 257 | { |
| 258 | bb_error_msg("either \"%s\" is duplicate, or \"%s\" is a garbage.", key, arg); | 258 | bb_error_msg("either \"%s\" is duplicate, or \"%s\" is a garbage", key, arg); |
| 259 | exit(-1); | 259 | exit(-1); |
| 260 | } | 260 | } |
| 261 | 261 | ||
diff --git a/networking/netstat.c b/networking/netstat.c index 8e481f67b..3dad57a40 100644 --- a/networking/netstat.c +++ b/networking/netstat.c | |||
| @@ -575,7 +575,7 @@ int netstat_main(int argc, char **argv) | |||
| 575 | else | 575 | else |
| 576 | printf("(w/o servers)"); | 576 | printf("(w/o servers)"); |
| 577 | } | 577 | } |
| 578 | printf("\nProto Recv-Q Send-Q Local Address Foreign Address State \n"); | 578 | printf("\nProto Recv-Q Send-Q Local Address Foreign Address State\n"); |
| 579 | } | 579 | } |
| 580 | if (inet && flags&NETSTAT_TCP) | 580 | if (inet && flags&NETSTAT_TCP) |
| 581 | do_info(_PATH_PROCNET_TCP,"AF INET (tcp)",tcp_do_one); | 581 | do_info(_PATH_PROCNET_TCP,"AF INET (tcp)",tcp_do_one); |
diff --git a/networking/ping.c b/networking/ping.c index 8ca8be9b9..ebde007b6 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
| @@ -317,7 +317,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from) | |||
| 317 | printf("\n"); | 317 | printf("\n"); |
| 318 | } else | 318 | } else |
| 319 | if (icmppkt->icmp_type != ICMP_ECHO) | 319 | if (icmppkt->icmp_type != ICMP_ECHO) |
| 320 | bb_error_msg("Warning: Got ICMP %d (%s)", | 320 | bb_error_msg("warning: got ICMP %d (%s)", |
| 321 | icmppkt->icmp_type, icmp_type_name(icmppkt->icmp_type)); | 321 | icmppkt->icmp_type, icmp_type_name(icmppkt->icmp_type)); |
| 322 | fflush(stdout); | 322 | fflush(stdout); |
| 323 | } | 323 | } |
diff --git a/networking/ping6.c b/networking/ping6.c index 0d6a739bf..62dc4cc2d 100644 --- a/networking/ping6.c +++ b/networking/ping6.c | |||
| @@ -308,7 +308,7 @@ static void unpack(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit | |||
| 308 | printf("\n"); | 308 | printf("\n"); |
| 309 | } else | 309 | } else |
| 310 | if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST) | 310 | if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST) |
| 311 | bb_error_msg("Warning: Got ICMP %d (%s)", | 311 | bb_error_msg("warning: got ICMP %d (%s)", |
| 312 | icmppkt->icmp6_type, icmp6_type_name(icmppkt->icmp6_type)); | 312 | icmppkt->icmp6_type, icmp6_type_name(icmppkt->icmp6_type)); |
| 313 | } | 313 | } |
| 314 | 314 | ||
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) | |||
| 81 | FD_SET(s, &fdset); | 81 | FD_SET(s, &fdset); |
| 82 | tm.tv_sec = timeout; | 82 | tm.tv_sec = timeout; |
| 83 | if (select(s + 1, &fdset, (fd_set *) NULL, (fd_set *) NULL, &tm) < 0) { | 83 | if (select(s + 1, &fdset, (fd_set *) NULL, (fd_set *) NULL, &tm) < 0) { |
| 84 | bb_perror_msg("Error on ARPING request"); | 84 | bb_perror_msg("error on ARPING request"); |
| 85 | if (errno != EINTR) rv = 0; | 85 | if (errno != EINTR) rv = 0; |
| 86 | } else if (FD_ISSET(s, &fdset)) { | 86 | } else if (FD_ISSET(s, &fdset)) { |
| 87 | if (recv(s, &arp, sizeof(arp), 0) < 0 ) rv = 0; | 87 | 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) | |||
| 216 | packet.ip.daddr = dest; | 216 | packet.ip.daddr = dest; |
| 217 | packet.ip.tot_len = packet.udp.len; /* cheat on the psuedo-header */ | 217 | packet.ip.tot_len = packet.udp.len; /* cheat on the psuedo-header */ |
| 218 | if (check && check != udhcp_checksum(&packet, bytes)) { | 218 | if (check && check != udhcp_checksum(&packet, bytes)) { |
| 219 | bb_error_msg("Packet with bad UDP checksum received, ignoring"); | 219 | bb_error_msg("packet with bad UDP checksum received, ignoring"); |
| 220 | return -2; | 220 | return -2; |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | memcpy(payload, &(packet.data), bytes - (sizeof(packet.ip) + sizeof(packet.udp))); | 223 | memcpy(payload, &(packet.data), bytes - (sizeof(packet.ip) + sizeof(packet.udp))); |
| 224 | 224 | ||
| 225 | if (ntohl(payload->cookie) != DHCP_MAGIC) { | 225 | if (ntohl(payload->cookie) != DHCP_MAGIC) { |
| 226 | bb_error_msg("Received bogus message (bad magic) - ignoring"); | 226 | bb_error_msg("received bogus message (bad magic) - ignoring"); |
| 227 | return -2; | 227 | return -2; |
| 228 | } | 228 | } |
| 229 | DEBUG("oooooh!!! got some!"); | 229 | 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) | |||
| 53 | void udhcp_background(const char *pidfile) | 53 | void udhcp_background(const char *pidfile) |
| 54 | { | 54 | { |
| 55 | #ifdef __uClinux__ | 55 | #ifdef __uClinux__ |
| 56 | bb_error_msg("Cannot background in uclinux (yet)"); | 56 | bb_error_msg("cannot background in uclinux (yet)"); |
| 57 | #else /* __uClinux__ */ | 57 | #else /* __uClinux__ */ |
| 58 | int pid_fd; | 58 | int pid_fd; |
| 59 | 59 | ||
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) | |||
| 284 | keywords[i].handler(keywords[i].def, keywords[i].var); | 284 | keywords[i].handler(keywords[i].def, keywords[i].var); |
| 285 | 285 | ||
| 286 | if (!(in = fopen(file, "r"))) { | 286 | if (!(in = fopen(file, "r"))) { |
| 287 | bb_error_msg("Unable to open config file: %s", file); | 287 | bb_error_msg("unable to open config file: %s", file); |
| 288 | return 0; | 288 | return 0; |
| 289 | } | 289 | } |
| 290 | 290 | ||
| @@ -308,7 +308,7 @@ int read_config(const char *file) | |||
| 308 | for (i = 0; keywords[i].keyword[0]; i++) | 308 | for (i = 0; keywords[i].keyword[0]; i++) |
| 309 | if (!strcasecmp(token, keywords[i].keyword)) | 309 | if (!strcasecmp(token, keywords[i].keyword)) |
| 310 | if (!keywords[i].handler(line, keywords[i].var)) { | 310 | if (!keywords[i].handler(line, keywords[i].var)) { |
| 311 | bb_error_msg("Failure parsing line %d of %s", lm, file); | 311 | bb_error_msg("failure parsing line %d of %s", lm, file); |
| 312 | if (ENABLE_FEATURE_UDHCP_DEBUG) | 312 | if (ENABLE_FEATURE_UDHCP_DEBUG) |
| 313 | bb_error_msg("unable to parse '%s'", debug_orig); | 313 | bb_error_msg("unable to parse '%s'", debug_orig); |
| 314 | /* reset back to the default value */ | 314 | /* reset back to the default value */ |
| @@ -329,7 +329,7 @@ void write_leases(void) | |||
| 329 | unsigned long tmp_time; | 329 | unsigned long tmp_time; |
| 330 | 330 | ||
| 331 | if (!(fp = fopen(server_config.lease_file, "w"))) { | 331 | if (!(fp = fopen(server_config.lease_file, "w"))) { |
| 332 | bb_error_msg("Unable to open %s for writing", server_config.lease_file); | 332 | bb_error_msg("unable to open %s for writing", server_config.lease_file); |
| 333 | return; | 333 | return; |
| 334 | } | 334 | } |
| 335 | 335 | ||
| @@ -367,7 +367,7 @@ void read_leases(const char *file) | |||
| 367 | struct dhcpOfferedAddr lease; | 367 | struct dhcpOfferedAddr lease; |
| 368 | 368 | ||
| 369 | if (!(fp = fopen(file, "r"))) { | 369 | if (!(fp = fopen(file, "r"))) { |
| 370 | bb_error_msg("Unable to open %s for reading", file); | 370 | bb_error_msg("unable to open %s for reading", file); |
| 371 | return; | 371 | return; |
| 372 | } | 372 | } |
| 373 | 373 | ||
| @@ -377,7 +377,7 @@ void read_leases(const char *file) | |||
| 377 | lease.expires = ntohl(lease.expires); | 377 | lease.expires = ntohl(lease.expires); |
| 378 | if (!server_config.remaining) lease.expires -= time(0); | 378 | if (!server_config.remaining) lease.expires -= time(0); |
| 379 | if (!(add_lease(lease.chaddr, lease.yiaddr, lease.expires))) { | 379 | if (!(add_lease(lease.chaddr, lease.yiaddr, lease.expires))) { |
| 380 | bb_error_msg("Too many leases while loading %s", file); | 380 | bb_error_msg("too many leases while loading %s", file); |
| 381 | break; | 381 | break; |
| 382 | } | 382 | } |
| 383 | i++; | 383 | 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) | |||
| 76 | length = 308; | 76 | length = 308; |
| 77 | while (!done) { | 77 | while (!done) { |
| 78 | if (i >= length) { | 78 | if (i >= length) { |
| 79 | bb_error_msg("Bogus packet, option fields too long"); | 79 | bb_error_msg("bogus packet, option fields too long"); |
| 80 | return NULL; | 80 | return NULL; |
| 81 | } | 81 | } |
| 82 | if (optionptr[i + OPT_CODE] == code) { | 82 | if (optionptr[i + OPT_CODE] == code) { |
| 83 | if (i + 1 + optionptr[i + OPT_LEN] >= length) { | 83 | if (i + 1 + optionptr[i + OPT_LEN] >= length) { |
| 84 | bb_error_msg("Bogus packet, option fields too long"); | 84 | bb_error_msg("bogus packet, option fields too long"); |
| 85 | return NULL; | 85 | return NULL; |
| 86 | } | 86 | } |
| 87 | return optionptr + i + 2; | 87 | return optionptr + i + 2; |
| @@ -92,7 +92,7 @@ uint8_t *get_option(struct dhcpMessage *packet, int code) | |||
| 92 | break; | 92 | break; |
| 93 | case DHCP_OPTION_OVER: | 93 | case DHCP_OPTION_OVER: |
| 94 | if (i + 1 + optionptr[i + OPT_LEN] >= length) { | 94 | if (i + 1 + optionptr[i + OPT_LEN] >= length) { |
| 95 | bb_error_msg("Bogus packet, option fields too long"); | 95 | bb_error_msg("bogus packet, option fields too long"); |
| 96 | return NULL; | 96 | return NULL; |
| 97 | } | 97 | } |
| 98 | over = optionptr[i + 3]; | 98 | over = optionptr[i + 3]; |
| @@ -140,7 +140,7 @@ int add_option_string(uint8_t *optionptr, uint8_t *string) | |||
| 140 | 140 | ||
| 141 | /* end position + string length + option code/length + end option */ | 141 | /* end position + string length + option code/length + end option */ |
| 142 | if (end + string[OPT_LEN] + 2 + 1 >= 308) { | 142 | if (end + string[OPT_LEN] + 2 + 1 >= 308) { |
| 143 | bb_error_msg("Option 0x%02x did not fit into the packet", | 143 | bb_error_msg("option 0x%02x did not fit into the packet", |
| 144 | string[OPT_CODE]); | 144 | string[OPT_CODE]); |
| 145 | return 0; | 145 | return 0; |
| 146 | } | 146 | } |
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) | |||
| 58 | memset(packet, 0, sizeof(struct dhcpMessage)); | 58 | memset(packet, 0, sizeof(struct dhcpMessage)); |
| 59 | bytes = read(fd, packet, sizeof(struct dhcpMessage)); | 59 | bytes = read(fd, packet, sizeof(struct dhcpMessage)); |
| 60 | if (bytes < 0) { | 60 | if (bytes < 0) { |
| 61 | DEBUG("couldn't read on listening socket, ignoring"); | 61 | DEBUG("cannot read on listening socket, ignoring"); |
| 62 | return -1; | 62 | return -1; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | if (ntohl(packet->cookie) != DHCP_MAGIC) { | 65 | if (ntohl(packet->cookie) != DHCP_MAGIC) { |
| 66 | bb_error_msg("Received bogus message, ignoring"); | 66 | bb_error_msg("received bogus message, ignoring"); |
| 67 | return -2; | 67 | return -2; |
| 68 | } | 68 | } |
| 69 | DEBUG("Received a packet"); | 69 | 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) | |||
| 45 | 45 | ||
| 46 | pid_fd = open(pidfile, O_CREAT | O_WRONLY, 0644); | 46 | pid_fd = open(pidfile, O_CREAT | O_WRONLY, 0644); |
| 47 | if (pid_fd < 0) { | 47 | if (pid_fd < 0) { |
| 48 | bb_perror_msg("Unable to open pidfile %s", pidfile); | 48 | bb_perror_msg("unable to open pidfile %s", pidfile); |
| 49 | } else { | 49 | } else { |
| 50 | lockf(pid_fd, F_LOCK, 0); | 50 | lockf(pid_fd, F_LOCK, 0); |
| 51 | if (!saved_pidfile) | 51 | if (!saved_pidfile) |
| @@ -63,14 +63,11 @@ void pidfile_write_release(int pid_fd) | |||
| 63 | 63 | ||
| 64 | if (pid_fd < 0) return; | 64 | if (pid_fd < 0) return; |
| 65 | 65 | ||
| 66 | if ((out = fdopen(pid_fd, "w")) != NULL) { | 66 | out = fdopen(pid_fd, "w"); |
| 67 | if (out) { | ||
| 67 | fprintf(out, "%d\n", getpid()); | 68 | fprintf(out, "%d\n", getpid()); |
| 68 | fclose(out); | 69 | fclose(out); |
| 69 | } | 70 | } |
| 70 | lockf(pid_fd, F_UNLCK, 0); | 71 | lockf(pid_fd, F_UNLCK, 0); |
| 71 | close(pid_fd); | 72 | close(pid_fd); |
| 72 | } | 73 | } |
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | |||
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) | |||
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | if(!packet.yiaddr) { | 160 | if(!packet.yiaddr) { |
| 161 | bb_error_msg("No IP addresses to give - OFFER abandoned"); | 161 | bb_error_msg("no IP addresses to give - OFFER abandoned"); |
| 162 | return -1; | 162 | return -1; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | if (!add_lease(packet.chaddr, packet.yiaddr, server_config.offer_time)) { | 165 | if (!add_lease(packet.chaddr, packet.yiaddr, server_config.offer_time)) { |
| 166 | bb_error_msg("Lease pool is full - OFFER abandoned"); | 166 | bb_error_msg("lease pool is full - OFFER abandoned"); |
| 167 | return -1; | 167 | return -1; |
| 168 | } | 168 | } |
| 169 | 169 | ||
