aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
Diffstat (limited to 'networking')
-rw-r--r--networking/arp.c36
-rw-r--r--networking/arping.c4
-rw-r--r--networking/dnsd.c8
-rw-r--r--networking/ether-wake.c4
-rw-r--r--networking/ftpgetput.c2
-rw-r--r--networking/hostname.c2
-rw-r--r--networking/httpd.c10
-rw-r--r--networking/ifconfig.c2
-rw-r--r--networking/ifplugd.c16
-rw-r--r--networking/ifupdown.c4
-rw-r--r--networking/inetd.c20
-rw-r--r--networking/ipcalc.c2
-rw-r--r--networking/isrv.c4
-rw-r--r--networking/libiproute/ipaddress.c10
-rw-r--r--networking/libiproute/ipneigh.c8
-rw-r--r--networking/libiproute/iproute.c12
-rw-r--r--networking/libiproute/iptunnel.c10
-rw-r--r--networking/libiproute/libnetlink.c30
-rw-r--r--networking/libiproute/utils.c2
-rw-r--r--networking/nbd-client.c10
-rw-r--r--networking/nc.c6
-rw-r--r--networking/nc_bloaty.c18
-rw-r--r--networking/netstat.c4
-rw-r--r--networking/nslookup.c2
-rw-r--r--networking/ntpd.c20
-rw-r--r--networking/ping.c16
-rw-r--r--networking/route.c6
-rw-r--r--networking/slattach.c4
-rw-r--r--networking/tcpudp.c6
-rw-r--r--networking/telnetd.c2
-rw-r--r--networking/tftp.c10
-rw-r--r--networking/tls.c14
-rw-r--r--networking/tls.h2
-rw-r--r--networking/traceroute.c6
-rw-r--r--networking/udhcp/arpping.c4
-rw-r--r--networking/udhcp/common.c2
-rw-r--r--networking/udhcp/common.h19
-rw-r--r--networking/udhcp/d6_dhcpc.c34
-rw-r--r--networking/udhcp/d6_packet.c4
-rw-r--r--networking/udhcp/d6_socket.c2
-rw-r--r--networking/udhcp/dhcpc.c50
-rw-r--r--networking/udhcp/dhcpd.c24
-rw-r--r--networking/udhcp/dhcprelay.c4
-rw-r--r--networking/udhcp/packet.c4
-rw-r--r--networking/udhcp/signalpipe.c2
-rw-r--r--networking/udhcp/socket.c2
-rw-r--r--networking/wget.c22
-rw-r--r--networking/zcip.c6
48 files changed, 255 insertions, 236 deletions
diff --git a/networking/arp.c b/networking/arp.c
index 71bfe3cbf..6519f8156 100644
--- a/networking/arp.c
+++ b/networking/arp.c
@@ -116,7 +116,7 @@ static int arp_del(char **args)
116 /* Resolve the host name. */ 116 /* Resolve the host name. */
117 host = *args; 117 host = *args;
118 if (ap->input(host, &sa) < 0) { 118 if (ap->input(host, &sa) < 0) {
119 bb_herror_msg_and_die("%s", host); 119 bb_simple_herror_msg_and_die(host);
120 } 120 }
121 121
122 /* If a host has more than one address, use the correct one! */ 122 /* If a host has more than one address, use the correct one! */
@@ -149,7 +149,7 @@ static int arp_del(char **args)
149#ifdef HAVE_ATF_DONTPUB 149#ifdef HAVE_ATF_DONTPUB
150 req.arp_flags |= ATF_DONTPUB; 150 req.arp_flags |= ATF_DONTPUB;
151#else 151#else
152 bb_error_msg("feature ATF_DONTPUB is not supported"); 152 bb_simple_error_msg("feature ATF_DONTPUB is not supported");
153#endif 153#endif
154 args++; 154 args++;
155 break; 155 break;
@@ -157,7 +157,7 @@ static int arp_del(char **args)
157#ifdef HAVE_ATF_MAGIC 157#ifdef HAVE_ATF_MAGIC
158 req.arp_flags |= ATF_MAGIC; 158 req.arp_flags |= ATF_MAGIC;
159#else 159#else
160 bb_error_msg("feature ATF_MAGIC is not supported"); 160 bb_simple_error_msg("feature ATF_MAGIC is not supported");
161#endif 161#endif
162 args++; 162 args++;
163 break; 163 break;
@@ -173,7 +173,7 @@ static int arp_del(char **args)
173 if (strcmp(*args, "255.255.255.255") != 0) { 173 if (strcmp(*args, "255.255.255.255") != 0) {
174 host = *args; 174 host = *args;
175 if (ap->input(host, &sa) < 0) { 175 if (ap->input(host, &sa) < 0) {
176 bb_herror_msg_and_die("%s", host); 176 bb_simple_herror_msg_and_die(host);
177 } 177 }
178 memcpy(&req.arp_netmask, &sa, sizeof(struct sockaddr)); 178 memcpy(&req.arp_netmask, &sa, sizeof(struct sockaddr));
179 req.arp_flags |= ATF_NETMASK; 179 req.arp_flags |= ATF_NETMASK;
@@ -195,7 +195,7 @@ static int arp_del(char **args)
195 /* Call the kernel. */ 195 /* Call the kernel. */
196 if (flags & 2) { 196 if (flags & 2) {
197 if (option_mask32 & ARP_OPT_v) 197 if (option_mask32 & ARP_OPT_v)
198 bb_error_msg("SIOCDARP(nopub)"); 198 bb_simple_error_msg("SIOCDARP(nopub)");
199 err = ioctl(sockfd, SIOCDARP, &req); 199 err = ioctl(sockfd, SIOCDARP, &req);
200 if (err < 0) { 200 if (err < 0) {
201 if (errno == ENXIO) { 201 if (errno == ENXIO) {
@@ -204,20 +204,20 @@ static int arp_del(char **args)
204 printf("No ARP entry for %s\n", host); 204 printf("No ARP entry for %s\n", host);
205 return -1; 205 return -1;
206 } 206 }
207 bb_perror_msg_and_die("SIOCDARP(priv)"); 207 bb_simple_perror_msg_and_die("SIOCDARP(priv)");
208 } 208 }
209 } 209 }
210 if ((flags & 1) && err) { 210 if ((flags & 1) && err) {
211 nopub: 211 nopub:
212 req.arp_flags |= ATF_PUBL; 212 req.arp_flags |= ATF_PUBL;
213 if (option_mask32 & ARP_OPT_v) 213 if (option_mask32 & ARP_OPT_v)
214 bb_error_msg("SIOCDARP(pub)"); 214 bb_simple_error_msg("SIOCDARP(pub)");
215 if (ioctl(sockfd, SIOCDARP, &req) < 0) { 215 if (ioctl(sockfd, SIOCDARP, &req) < 0) {
216 if (errno == ENXIO) { 216 if (errno == ENXIO) {
217 printf("No ARP entry for %s\n", host); 217 printf("No ARP entry for %s\n", host);
218 return -1; 218 return -1;
219 } 219 }
220 bb_perror_msg_and_die("SIOCDARP(pub)"); 220 bb_simple_perror_msg_and_die("SIOCDARP(pub)");
221 } 221 }
222 } 222 }
223 return 0; 223 return 0;
@@ -233,7 +233,7 @@ static void arp_getdevhw(char *ifname, struct sockaddr *sa)
233 ioctl_or_perror_and_die(sockfd, SIOCGIFHWADDR, &ifr, 233 ioctl_or_perror_and_die(sockfd, SIOCGIFHWADDR, &ifr,
234 "can't get HW-Address for '%s'", ifname); 234 "can't get HW-Address for '%s'", ifname);
235 if (hw_set && (ifr.ifr_hwaddr.sa_family != hw->type)) { 235 if (hw_set && (ifr.ifr_hwaddr.sa_family != hw->type)) {
236 bb_error_msg_and_die("protocol type mismatch"); 236 bb_simple_error_msg_and_die("protocol type mismatch");
237 } 237 }
238 memcpy(sa, &(ifr.ifr_hwaddr), sizeof(struct sockaddr)); 238 memcpy(sa, &(ifr.ifr_hwaddr), sizeof(struct sockaddr));
239 239
@@ -261,20 +261,20 @@ static int arp_set(char **args)
261 261
262 host = *args++; 262 host = *args++;
263 if (ap->input(host, &sa) < 0) { 263 if (ap->input(host, &sa) < 0) {
264 bb_herror_msg_and_die("%s", host); 264 bb_simple_herror_msg_and_die(host);
265 } 265 }
266 /* If a host has more than one address, use the correct one! */ 266 /* If a host has more than one address, use the correct one! */
267 memcpy(&req.arp_pa, &sa, sizeof(struct sockaddr)); 267 memcpy(&req.arp_pa, &sa, sizeof(struct sockaddr));
268 268
269 /* Fetch the hardware address. */ 269 /* Fetch the hardware address. */
270 if (*args == NULL) { 270 if (*args == NULL) {
271 bb_error_msg_and_die("need hardware address"); 271 bb_simple_error_msg_and_die("need hardware address");
272 } 272 }
273 if (option_mask32 & ARP_OPT_D) { 273 if (option_mask32 & ARP_OPT_D) {
274 arp_getdevhw(*args++, &req.arp_ha); 274 arp_getdevhw(*args++, &req.arp_ha);
275 } else { 275 } else {
276 if (hw->input(*args++, &req.arp_ha) < 0) { 276 if (hw->input(*args++, &req.arp_ha) < 0) {
277 bb_error_msg_and_die("invalid hardware address"); 277 bb_simple_error_msg_and_die("invalid hardware address");
278 } 278 }
279 } 279 }
280 280
@@ -302,7 +302,7 @@ static int arp_set(char **args)
302#ifdef HAVE_ATF_DONTPUB 302#ifdef HAVE_ATF_DONTPUB
303 flags |= ATF_DONTPUB; 303 flags |= ATF_DONTPUB;
304#else 304#else
305 bb_error_msg("feature ATF_DONTPUB is not supported"); 305 bb_simple_error_msg("feature ATF_DONTPUB is not supported");
306#endif 306#endif
307 args++; 307 args++;
308 break; 308 break;
@@ -310,7 +310,7 @@ static int arp_set(char **args)
310#ifdef HAVE_ATF_MAGIC 310#ifdef HAVE_ATF_MAGIC
311 flags |= ATF_MAGIC; 311 flags |= ATF_MAGIC;
312#else 312#else
313 bb_error_msg("feature ATF_MAGIC is not supported"); 313 bb_simple_error_msg("feature ATF_MAGIC is not supported");
314#endif 314#endif
315 args++; 315 args++;
316 break; 316 break;
@@ -326,7 +326,7 @@ static int arp_set(char **args)
326 if (strcmp(*args, "255.255.255.255") != 0) { 326 if (strcmp(*args, "255.255.255.255") != 0) {
327 host = *args; 327 host = *args;
328 if (ap->input(host, &sa) < 0) { 328 if (ap->input(host, &sa) < 0) {
329 bb_herror_msg_and_die("%s", host); 329 bb_simple_herror_msg_and_die(host);
330 } 330 }
331 memcpy(&req.arp_netmask, &sa, sizeof(struct sockaddr)); 331 memcpy(&req.arp_netmask, &sa, sizeof(struct sockaddr));
332 flags |= ATF_NETMASK; 332 flags |= ATF_NETMASK;
@@ -346,7 +346,7 @@ static int arp_set(char **args)
346 346
347 /* Call the kernel. */ 347 /* Call the kernel. */
348 if (option_mask32 & ARP_OPT_v) 348 if (option_mask32 & ARP_OPT_v)
349 bb_error_msg("SIOCSARP()"); 349 bb_simple_error_msg("SIOCSARP()");
350 xioctl(sockfd, SIOCSARP, &req); 350 xioctl(sockfd, SIOCSARP, &req);
351 return 0; 351 return 0;
352} 352}
@@ -422,7 +422,7 @@ static int arp_show(char *name)
422 if (name != NULL) { 422 if (name != NULL) {
423 /* Resolve the host name. */ 423 /* Resolve the host name. */
424 if (ap->input(name, &sa) < 0) { 424 if (ap->input(name, &sa) < 0) {
425 bb_herror_msg_and_die("%s", name); 425 bb_simple_herror_msg_and_die(name);
426 } 426 }
427 host = xstrdup(ap->sprint(&sa, 1)); 427 host = xstrdup(ap->sprint(&sa, 1));
428 } 428 }
@@ -530,7 +530,7 @@ int arp_main(int argc UNUSED_PARAM, char **argv)
530 /* Now see what we have to do here... */ 530 /* Now see what we have to do here... */
531 if (opts & (ARP_OPT_d | ARP_OPT_s)) { 531 if (opts & (ARP_OPT_d | ARP_OPT_s)) {
532 if (argv[0] == NULL) 532 if (argv[0] == NULL)
533 bb_error_msg_and_die("need host name"); 533 bb_simple_error_msg_and_die("need host name");
534 if (opts & ARP_OPT_s) 534 if (opts & ARP_OPT_s)
535 return arp_set(argv); 535 return arp_set(argv);
536 return arp_del(argv); 536 return arp_del(argv);
diff --git a/networking/arping.c b/networking/arping.c
index 901578b68..2a256aaa0 100644
--- a/networking/arping.c
+++ b/networking/arping.c
@@ -375,7 +375,7 @@ int arping_main(int argc UNUSED_PARAM, char **argv)
375 xconnect(probe_fd, (struct sockaddr *) &G.probe_saddr, sizeof(G.probe_saddr)); 375 xconnect(probe_fd, (struct sockaddr *) &G.probe_saddr, sizeof(G.probe_saddr));
376 bb_getsockname(probe_fd, (struct sockaddr *) &G.probe_saddr, sizeof(G.probe_saddr)); 376 bb_getsockname(probe_fd, (struct sockaddr *) &G.probe_saddr, sizeof(G.probe_saddr));
377 if (G.probe_saddr.sin_family != AF_INET) 377 if (G.probe_saddr.sin_family != AF_INET)
378 bb_error_msg_and_die("no IP address configured"); 378 bb_simple_error_msg_and_die("no IP address configured");
379 src = G.probe_saddr.sin_addr; 379 src = G.probe_saddr.sin_addr;
380 } 380 }
381 close(probe_fd); 381 close(probe_fd);
@@ -430,7 +430,7 @@ int arping_main(int argc UNUSED_PARAM, char **argv)
430 /* Don't allow SIGALRMs while we process the reply */ 430 /* Don't allow SIGALRMs while we process the reply */
431 sigprocmask(SIG_BLOCK, &G.sset, NULL); 431 sigprocmask(SIG_BLOCK, &G.sset, NULL);
432 if (cc < 0) { 432 if (cc < 0) {
433 bb_perror_msg("recvfrom"); 433 bb_simple_perror_msg("recvfrom");
434 continue; 434 continue;
435 } 435 }
436 recv_pack(G.packet, cc, &from); 436 recv_pack(G.packet, cc, &from);
diff --git a/networking/dnsd.c b/networking/dnsd.c
index f2c6bddc6..0ff0290fb 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -395,11 +395,11 @@ static int process_packet(struct dns_entry *conf_data,
395 395
396 head = (struct dns_head *)buf; 396 head = (struct dns_head *)buf;
397 if (head->nquer == 0) { 397 if (head->nquer == 0) {
398 bb_error_msg("packet has 0 queries, ignored"); 398 bb_simple_error_msg("packet has 0 queries, ignored");
399 return 0; /* don't reply */ 399 return 0; /* don't reply */
400 } 400 }
401 if (head->flags & htons(0x8000)) { /* QR bit */ 401 if (head->flags & htons(0x8000)) { /* QR bit */
402 bb_error_msg("response packet, ignored"); 402 bb_simple_error_msg("response packet, ignored");
403 return 0; /* don't reply */ 403 return 0; /* don't reply */
404 } 404 }
405 /* QR = 1 "response", RCODE = 4 "Not Implemented" */ 405 /* QR = 1 "response", RCODE = 4 "Not Implemented" */
@@ -474,7 +474,7 @@ static int process_packet(struct dns_entry *conf_data,
474 * RCODE = 0 "success" 474 * RCODE = 0 "success"
475 */ 475 */
476 if (OPT_verbose) 476 if (OPT_verbose)
477 bb_info_msg("returning positive reply"); 477 bb_simple_info_msg("returning positive reply");
478 outr_flags = htons(0x8000 | 0x0400 | 0); 478 outr_flags = htons(0x8000 | 0x0400 | 0);
479 /* we have one answer */ 479 /* we have one answer */
480 head->nansw = htons(1); 480 head->nansw = htons(1);
@@ -557,7 +557,7 @@ int dnsd_main(int argc UNUSED_PARAM, char **argv)
557 continue; 557 continue;
558 } 558 }
559 if (OPT_verbose) 559 if (OPT_verbose)
560 bb_info_msg("got UDP packet"); 560 bb_simple_info_msg("got UDP packet");
561 buf[r] = '\0'; /* paranoia */ 561 buf[r] = '\0'; /* paranoia */
562 r = process_packet(conf_data, conf_ttl, buf); 562 r = process_packet(conf_data, conf_ttl, buf);
563 if (r <= 0) 563 if (r <= 0)
diff --git a/networking/ether-wake.c b/networking/ether-wake.c
index acaac16f8..f45d43609 100644
--- a/networking/ether-wake.c
+++ b/networking/ether-wake.c
@@ -182,7 +182,7 @@ static int get_wol_pw(const char *ethoptarg, unsigned char *wol_passwd)
182 byte_cnt = sscanf(ethoptarg, "%u.%u.%u.%u", 182 byte_cnt = sscanf(ethoptarg, "%u.%u.%u.%u",
183 &passwd[0], &passwd[1], &passwd[2], &passwd[3]); 183 &passwd[0], &passwd[1], &passwd[2], &passwd[3]);
184 if (byte_cnt < 4) { 184 if (byte_cnt < 4) {
185 bb_error_msg("can't read Wake-On-LAN pass"); 185 bb_simple_error_msg("can't read Wake-On-LAN pass");
186 return 0; 186 return 0;
187 } 187 }
188// TODO: check invalid numbers >255?? 188// TODO: check invalid numbers >255??
@@ -266,7 +266,7 @@ int ether_wake_main(int argc UNUSED_PARAM, char **argv)
266 /* This is necessary for broadcasts to work */ 266 /* This is necessary for broadcasts to work */
267 if (flags /* & 1 OPT_BROADCAST */) { 267 if (flags /* & 1 OPT_BROADCAST */) {
268 if (setsockopt_broadcast(s) != 0) 268 if (setsockopt_broadcast(s) != 0)
269 bb_perror_msg("SO_BROADCAST"); 269 bb_simple_perror_msg("SO_BROADCAST");
270 } 270 }
271 271
272#if defined(PF_PACKET) 272#if defined(PF_PACKET)
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index cb6910fb0..6f7f7e9ca 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -214,7 +214,7 @@ int ftp_receive(const char *local_path, char *server_path)
214 struct stat sbuf; 214 struct stat sbuf;
215 /* lstat would be wrong here! */ 215 /* lstat would be wrong here! */
216 if (stat(local_path, &sbuf) < 0) { 216 if (stat(local_path, &sbuf) < 0) {
217 bb_perror_msg_and_die("stat"); 217 bb_simple_perror_msg_and_die("stat");
218 } 218 }
219 if (sbuf.st_size > 0) { 219 if (sbuf.st_size > 0) {
220 beg_range = sbuf.st_size; 220 beg_range = sbuf.st_size;
diff --git a/networking/hostname.c b/networking/hostname.c
index 248d8b65a..f96daed95 100644
--- a/networking/hostname.c
+++ b/networking/hostname.c
@@ -61,7 +61,7 @@ static void do_sethostname(char *s, int isfile)
61 } else if (sethostname(s, strlen(s))) { 61 } else if (sethostname(s, strlen(s))) {
62// if (errno == EPERM) 62// if (errno == EPERM)
63// bb_error_msg_and_die(bb_msg_perm_denied_are_you_root); 63// bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
64 bb_perror_msg_and_die("sethostname"); 64 bb_simple_perror_msg_and_die("sethostname");
65 } 65 }
66} 66}
67 67
diff --git a/networking/httpd.c b/networking/httpd.c
index a0a4abc10..1757e09c9 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1025,7 +1025,7 @@ static void log_and_exit(void)
1025 */ 1025 */
1026 1026
1027 if (verbose > 2) 1027 if (verbose > 2)
1028 bb_error_msg("closed"); 1028 bb_simple_error_msg("closed");
1029 _exit(xfunc_error_retval); 1029 _exit(xfunc_error_retval);
1030} 1030}
1031 1031
@@ -1220,7 +1220,7 @@ static void send_headers(unsigned responseNum)
1220 } 1220 }
1221 if (full_write(STDOUT_FILENO, iobuf, len) != len) { 1221 if (full_write(STDOUT_FILENO, iobuf, len) != len) {
1222 if (verbose > 1) 1222 if (verbose > 1)
1223 bb_perror_msg("error"); 1223 bb_simple_perror_msg("error");
1224 log_and_exit(); 1224 log_and_exit();
1225 } 1225 }
1226} 1226}
@@ -1838,7 +1838,7 @@ static NOINLINE void send_file_and_exit(const char *url, int what)
1838 if (count < 0) { 1838 if (count < 0) {
1839 IF_FEATURE_USE_SENDFILE(fin:) 1839 IF_FEATURE_USE_SENDFILE(fin:)
1840 if (verbose > 1) 1840 if (verbose > 1)
1841 bb_perror_msg("error"); 1841 bb_simple_perror_msg("error");
1842 } 1842 }
1843 log_and_exit(); 1843 log_and_exit();
1844} 1844}
@@ -2149,7 +2149,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
2149 if (rmt_ip_str) 2149 if (rmt_ip_str)
2150 applet_name = rmt_ip_str; 2150 applet_name = rmt_ip_str;
2151 if (verbose > 2) 2151 if (verbose > 2)
2152 bb_error_msg("connected"); 2152 bb_simple_error_msg("connected");
2153 } 2153 }
2154 if_ip_denied_send_HTTP_FORBIDDEN_and_exit(remote_ip); 2154 if_ip_denied_send_HTTP_FORBIDDEN_and_exit(remote_ip);
2155 2155
@@ -2746,7 +2746,7 @@ int httpd_main(int argc UNUSED_PARAM, char **argv)
2746 if (opt & OPT_SETUID) { 2746 if (opt & OPT_SETUID) {
2747 if (ugid.gid != (gid_t)-1) { 2747 if (ugid.gid != (gid_t)-1) {
2748 if (setgroups(1, &ugid.gid) == -1) 2748 if (setgroups(1, &ugid.gid) == -1)
2749 bb_perror_msg_and_die("setgroups"); 2749 bb_simple_perror_msg_and_die("setgroups");
2750 xsetgid(ugid.gid); 2750 xsetgid(ugid.gid);
2751 } 2751 }
2752 xsetuid(ugid.uid); 2752 xsetuid(ugid.uid);
diff --git a/networking/ifconfig.c b/networking/ifconfig.c
index 5c47abc16..b566d91a9 100644
--- a/networking/ifconfig.c
+++ b/networking/ifconfig.c
@@ -361,7 +361,7 @@ int ifconfig_main(int argc UNUSED_PARAM, char **argv)
361#if ENABLE_FEATURE_IFCONFIG_STATUS 361#if ENABLE_FEATURE_IFCONFIG_STATUS
362 return display_interfaces(argv[0] ? argv[0] : show_all_param); 362 return display_interfaces(argv[0] ? argv[0] : show_all_param);
363#else 363#else
364 bb_error_msg_and_die("no support for status display"); 364 bb_simple_error_msg_and_die("no support for status display");
365#endif 365#endif
366 } 366 }
367 367
diff --git a/networking/ifplugd.c b/networking/ifplugd.c
index b7b26c113..fa18edd57 100644
--- a/networking/ifplugd.c
+++ b/networking/ifplugd.c
@@ -365,7 +365,7 @@ static void up_iface(void)
365 if (!(ifrequest.ifr_flags & IFF_UP)) { 365 if (!(ifrequest.ifr_flags & IFF_UP)) {
366 ifrequest.ifr_flags |= IFF_UP; 366 ifrequest.ifr_flags |= IFF_UP;
367 /* Let user know we mess up with interface */ 367 /* Let user know we mess up with interface */
368 bb_info_msg("upping interface"); 368 bb_simple_info_msg("upping interface");
369 if (network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting interface flags") < 0) { 369 if (network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting interface flags") < 0) {
370 if (errno != ENODEV && errno != EADDRNOTAVAIL) 370 if (errno != ENODEV && errno != EADDRNOTAVAIL)
371 xfunc_die(); 371 xfunc_die();
@@ -461,7 +461,7 @@ static smallint detect_link(void)
461 else if (option_mask32 & FLAG_IGNORE_FAIL_POSITIVE) 461 else if (option_mask32 & FLAG_IGNORE_FAIL_POSITIVE)
462 status = IFSTATUS_UP; 462 status = IFSTATUS_UP;
463 else if (G.api_mode[0] == 'a') 463 else if (G.api_mode[0] == 'a')
464 bb_error_msg("can't detect link status"); 464 bb_simple_error_msg("can't detect link status");
465 } 465 }
466 466
467 if (status != G.iface_last_status) { 467 if (status != G.iface_last_status) {
@@ -493,14 +493,14 @@ static NOINLINE int check_existence_through_netlink(void)
493 goto ret; 493 goto ret;
494 if (errno == EINTR) 494 if (errno == EINTR)
495 continue; 495 continue;
496 bb_perror_msg("netlink: recv"); 496 bb_simple_perror_msg("netlink: recv");
497 return -1; 497 return -1;
498 } 498 }
499 499
500 mhdr = (struct nlmsghdr*)replybuf; 500 mhdr = (struct nlmsghdr*)replybuf;
501 while (bytes > 0) { 501 while (bytes > 0) {
502 if (!NLMSG_OK(mhdr, bytes)) { 502 if (!NLMSG_OK(mhdr, bytes)) {
503 bb_error_msg("netlink packet too small or truncated"); 503 bb_simple_error_msg("netlink packet too small or truncated");
504 return -1; 504 return -1;
505 } 505 }
506 506
@@ -509,7 +509,7 @@ static NOINLINE int check_existence_through_netlink(void)
509 int attr_len; 509 int attr_len;
510 510
511 if (mhdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifinfomsg))) { 511 if (mhdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifinfomsg))) {
512 bb_error_msg("netlink packet too small or truncated"); 512 bb_simple_error_msg("netlink packet too small or truncated");
513 return -1; 513 return -1;
514 } 514 }
515 515
@@ -591,7 +591,7 @@ int ifplugd_main(int argc UNUSED_PARAM, char **argv)
591 } 591 }
592 592
593 if (pid_from_pidfile > 0 && kill(pid_from_pidfile, 0) == 0) 593 if (pid_from_pidfile > 0 && kill(pid_from_pidfile, 0) == 0)
594 bb_error_msg_and_die("daemon already running"); 594 bb_simple_error_msg_and_die("daemon already running");
595#endif 595#endif
596 596
597 api_mode_found = strchr(api_modes, G.api_mode[0]); 597 api_mode_found = strchr(api_modes, G.api_mode[0]);
@@ -690,7 +690,7 @@ int ifplugd_main(int argc UNUSED_PARAM, char **argv)
690 ) { 690 ) {
691 if (errno == EINTR) 691 if (errno == EINTR)
692 continue; 692 continue;
693 bb_perror_msg("poll"); 693 bb_simple_perror_msg("poll");
694 goto exiting; 694 goto exiting;
695 } 695 }
696 696
@@ -763,5 +763,5 @@ int ifplugd_main(int argc UNUSED_PARAM, char **argv)
763 763
764 exiting: 764 exiting:
765 remove_pidfile(pidfile_name); 765 remove_pidfile(pidfile_name);
766 bb_error_msg_and_die("exiting"); 766 bb_simple_error_msg_and_die("exiting");
767} 767}
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 5327b0979..60ceb5a1f 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -665,7 +665,7 @@ static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec)
665 if (executable_exists(ext_dhcp_clients[i].name)) 665 if (executable_exists(ext_dhcp_clients[i].name))
666 return execute(ext_dhcp_clients[i].startcmd, ifd, exec); 666 return execute(ext_dhcp_clients[i].startcmd, ifd, exec);
667 } 667 }
668 bb_error_msg("no dhcp clients found"); 668 bb_simple_error_msg("no dhcp clients found");
669 return 0; 669 return 0;
670} 670}
671# elif ENABLE_UDHCPC 671# elif ENABLE_UDHCPC
@@ -707,7 +707,7 @@ static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec)
707 } 707 }
708 708
709 if (!result) 709 if (!result)
710 bb_error_msg("warning: no dhcp clients found and stopped"); 710 bb_simple_error_msg("warning: no dhcp clients found and stopped");
711 711
712 /* Sleep a bit, otherwise static_down tries to bring down interface too soon, 712 /* Sleep a bit, otherwise static_down tries to bring down interface too soon,
713 and it may come back up because udhcpc is still shutting down */ 713 and it may come back up because udhcpc is still shutting down */
diff --git a/networking/inetd.c b/networking/inetd.c
index da6551174..3cd2b11f0 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -504,7 +504,7 @@ static void register_rpc(servtab_t *sep)
504 504
505 if (bb_getsockname(sep->se_fd, (struct sockaddr *) &ir_sin, sizeof(ir_sin)) < 0) { 505 if (bb_getsockname(sep->se_fd, (struct sockaddr *) &ir_sin, sizeof(ir_sin)) < 0) {
506//TODO: verify that such failure is even possible in Linux kernel 506//TODO: verify that such failure is even possible in Linux kernel
507 bb_perror_msg("getsockname"); 507 bb_simple_perror_msg("getsockname");
508 return; 508 return;
509 } 509 }
510 510
@@ -544,7 +544,7 @@ static void bump_nofile(void)
544 } 544 }
545 545
546 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) { 546 if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
547 bb_perror_msg("setrlimit"); 547 bb_simple_perror_msg("setrlimit");
548 return; 548 return;
549 } 549 }
550 550
@@ -599,7 +599,7 @@ static void prepare_socket_fd(servtab_t *sep)
599 599
600 fd = socket(sep->se_family, sep->se_socktype, 0); 600 fd = socket(sep->se_family, sep->se_socktype, 0);
601 if (fd < 0) { 601 if (fd < 0) {
602 bb_perror_msg("socket"); 602 bb_simple_perror_msg("socket");
603 return; 603 return;
604 } 604 }
605 setsockopt_reuseaddr(fd); 605 setsockopt_reuseaddr(fd);
@@ -815,7 +815,7 @@ static NOINLINE servtab_t *parse_one_line(void)
815 n = bb_strtou(p, &p, 10); 815 n = bb_strtou(p, &p, 10);
816 if (n > INT_MAX) { 816 if (n > INT_MAX) {
817 bad_ver_spec: 817 bad_ver_spec:
818 bb_error_msg("bad rpc version"); 818 bb_simple_error_msg("bad rpc version");
819 goto parse_err; 819 goto parse_err;
820 } 820 }
821 sep->se_rpcver_lo = sep->se_rpcver_hi = n; 821 sep->se_rpcver_lo = sep->se_rpcver_hi = n;
@@ -829,7 +829,7 @@ static NOINLINE servtab_t *parse_one_line(void)
829 if (*p != '\0') 829 if (*p != '\0')
830 goto bad_ver_spec; 830 goto bad_ver_spec;
831#else 831#else
832 bb_error_msg("no support for rpc services"); 832 bb_simple_error_msg("no support for rpc services");
833 goto parse_err; 833 goto parse_err;
834#endif 834#endif
835 } 835 }
@@ -1235,7 +1235,7 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
1235 if (argv[0]) 1235 if (argv[0])
1236 config_filename = argv[0]; 1236 config_filename = argv[0];
1237 if (config_filename == NULL) 1237 if (config_filename == NULL)
1238 bb_error_msg_and_die("non-root must specify config file"); 1238 bb_simple_error_msg_and_die("non-root must specify config file");
1239 if (!(opt & 2)) 1239 if (!(opt & 2))
1240 bb_daemonize_or_rexec(0, argv - optind); 1240 bb_daemonize_or_rexec(0, argv - optind);
1241 else 1241 else
@@ -1304,7 +1304,7 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
1304 ready_fd_cnt = select(maxsock + 1, &readable, NULL, NULL, NULL); 1304 ready_fd_cnt = select(maxsock + 1, &readable, NULL, NULL, NULL);
1305 if (ready_fd_cnt < 0) { 1305 if (ready_fd_cnt < 0) {
1306 if (errno != EINTR) { 1306 if (errno != EINTR) {
1307 bb_perror_msg("select"); 1307 bb_simple_perror_msg("select");
1308 sleep(1); 1308 sleep(1);
1309 } 1309 }
1310 continue; 1310 continue;
@@ -1405,7 +1405,7 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
1405 pid = vfork(); 1405 pid = vfork();
1406 1406
1407 if (pid < 0) { /* fork error */ 1407 if (pid < 0) { /* fork error */
1408 bb_perror_msg("vfork"+1); 1408 bb_simple_perror_msg("vfork"+1);
1409 sleep(1); 1409 sleep(1);
1410 restore_sigmask(&omask); 1410 restore_sigmask(&omask);
1411 maybe_close(new_udp_fd); 1411 maybe_close(new_udp_fd);
@@ -1488,7 +1488,7 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
1488 } 1488 }
1489 if (real_uid != 0 && real_uid != pwd->pw_uid) { 1489 if (real_uid != 0 && real_uid != pwd->pw_uid) {
1490 /* a user running private inetd */ 1490 /* a user running private inetd */
1491 bb_error_msg("non-root must run services as himself"); 1491 bb_simple_error_msg("non-root must run services as himself");
1492 goto do_exit1; 1492 goto do_exit1;
1493 } 1493 }
1494 if (pwd->pw_uid != real_uid) { 1494 if (pwd->pw_uid != real_uid) {
@@ -1502,7 +1502,7 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
1502 } 1502 }
1503 if (rlim_ofile.rlim_cur != rlim_ofile_cur) 1503 if (rlim_ofile.rlim_cur != rlim_ofile_cur)
1504 if (setrlimit(RLIMIT_NOFILE, &rlim_ofile) < 0) 1504 if (setrlimit(RLIMIT_NOFILE, &rlim_ofile) < 0)
1505 bb_perror_msg("setrlimit"); 1505 bb_simple_perror_msg("setrlimit");
1506 1506
1507 /* closelog(); - WRONG. we are after vfork, 1507 /* closelog(); - WRONG. we are after vfork,
1508 * this may confuse syslog() internal state. 1508 * this may confuse syslog() internal state.
diff --git a/networking/ipcalc.c b/networking/ipcalc.c
index 67f768836..09b146872 100644
--- a/networking/ipcalc.c
+++ b/networking/ipcalc.c
@@ -183,7 +183,7 @@ int ipcalc_main(int argc UNUSED_PARAM, char **argv)
183 183
184 if (argv[1]) { 184 if (argv[1]) {
185 if (ENABLE_FEATURE_IPCALC_FANCY && have_netmask) { 185 if (ENABLE_FEATURE_IPCALC_FANCY && have_netmask) {
186 bb_error_msg_and_die("use prefix or netmask, not both"); 186 bb_simple_error_msg_and_die("use prefix or netmask, not both");
187 } 187 }
188 if (inet_aton(argv[1], &s_netmask) == 0) { 188 if (inet_aton(argv[1], &s_netmask) == 0) {
189 bb_error_msg_and_die("bad netmask: %s", argv[1]); 189 bb_error_msg_and_die("bad netmask: %s", argv[1]);
diff --git a/networking/isrv.c b/networking/isrv.c
index 97f5c6d4e..0e3f10f9a 100644
--- a/networking/isrv.c
+++ b/networking/isrv.c
@@ -185,7 +185,7 @@ static void handle_accept(isrv_state_t *state, int fd)
185 /* Most probably someone gave us wrong fd type 185 /* Most probably someone gave us wrong fd type
186 * (for example, non-socket). Don't want 186 * (for example, non-socket). Don't want
187 * to loop forever. */ 187 * to loop forever. */
188 bb_perror_msg_and_die("accept"); 188 bb_simple_perror_msg_and_die("accept");
189 } 189 }
190 190
191 DPRINTF("new_peer(%d)", newfd); 191 DPRINTF("new_peer(%d)", newfd);
@@ -311,7 +311,7 @@ void isrv_run(
311 311
312 if (n < 0) { 312 if (n < 0) {
313 if (errno != EINTR) 313 if (errno != EINTR)
314 bb_perror_msg("select"); 314 bb_simple_perror_msg("select");
315 continue; 315 continue;
316 } 316 }
317 317
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 7b7e0154b..86cf3beea 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -119,7 +119,7 @@ static NOINLINE int print_linkinfo(const struct nlmsghdr *n)
119 //memset(tb, 0, sizeof(tb)); - parse_rtattr does this 119 //memset(tb, 0, sizeof(tb)); - parse_rtattr does this
120 parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len); 120 parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len);
121 if (tb[IFLA_IFNAME] == NULL) { 121 if (tb[IFLA_IFNAME] == NULL) {
122 bb_error_msg("nil ifname"); 122 bb_simple_error_msg("nil ifname");
123 return -1; 123 return -1;
124 } 124 }
125 if (G_filter.label 125 if (G_filter.label
@@ -205,7 +205,7 @@ static NOINLINE int print_linkinfo(const struct nlmsghdr *n)
205static int flush_update(void) 205static int flush_update(void)
206{ 206{
207 if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) { 207 if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) {
208 bb_perror_msg("can't send flush request"); 208 bb_simple_perror_msg("can't send flush request");
209 return -1; 209 return -1;
210 } 210 }
211 G_filter.flushp = 0; 211 G_filter.flushp = 0;
@@ -439,7 +439,7 @@ int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush)
439 bb_error_msg_and_die(bb_msg_requires_arg, "flush"); 439 bb_error_msg_and_die(bb_msg_requires_arg, "flush");
440 } 440 }
441 if (G_filter.family == AF_PACKET) { 441 if (G_filter.family == AF_PACKET) {
442 bb_error_msg_and_die("can't flush link addresses"); 442 bb_simple_error_msg_and_die("can't flush link addresses");
443 } 443 }
444 } 444 }
445 445
@@ -700,7 +700,7 @@ static int ipaddr_modify(int cmd, int flags, char **argv)
700 700
701 if (!d) { 701 if (!d) {
702 /* There was no "dev IFACE", but we need that */ 702 /* There was no "dev IFACE", but we need that */
703 bb_error_msg_and_die("need \"dev IFACE\""); 703 bb_simple_error_msg_and_die("need \"dev IFACE\"");
704 } 704 }
705 if (l && !is_prefixed_with(l, d)) { 705 if (l && !is_prefixed_with(l, d)) {
706 bb_error_msg_and_die("\"dev\" (%s) must match \"label\" (%s)", d, l); 706 bb_error_msg_and_die("\"dev\" (%s) must match \"label\" (%s)", d, l);
@@ -717,7 +717,7 @@ static int ipaddr_modify(int cmd, int flags, char **argv)
717 inet_prefix brd; 717 inet_prefix brd;
718 int i; 718 int i;
719 if (req.ifa.ifa_family != AF_INET) { 719 if (req.ifa.ifa_family != AF_INET) {
720 bb_error_msg_and_die("broadcast can be set only for IPv4 addresses"); 720 bb_simple_error_msg_and_die("broadcast can be set only for IPv4 addresses");
721 } 721 }
722 brd = peer; 722 brd = peer;
723 if (brd.bitlen <= 30) { 723 if (brd.bitlen <= 30) {
diff --git a/networking/libiproute/ipneigh.c b/networking/libiproute/ipneigh.c
index 984dd4bdd..b9b4f4b31 100644
--- a/networking/libiproute/ipneigh.c
+++ b/networking/libiproute/ipneigh.c
@@ -49,7 +49,7 @@ typedef struct filter_t filter_t;
49static int flush_update(void) 49static int flush_update(void)
50{ 50{
51 if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) { 51 if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) {
52 bb_perror_msg("can't send flush request"); 52 bb_simple_perror_msg("can't send flush request");
53 return -1; 53 return -1;
54 } 54 }
55 G_filter.flushp = 0; 55 G_filter.flushp = 0;
@@ -305,7 +305,7 @@ static int FAST_FUNC ipneigh_list_or_flush(char **argv, int flush)
305 xrtnl_wilddump_request(&rth, G_filter.family, RTM_GETNEIGH); 305 xrtnl_wilddump_request(&rth, G_filter.family, RTM_GETNEIGH);
306 G_filter.flushed = 0; 306 G_filter.flushed = 0;
307 if (xrtnl_dump_filter(&rth, print_neigh, NULL) < 0) { 307 if (xrtnl_dump_filter(&rth, print_neigh, NULL) < 0) {
308 bb_perror_msg_and_die("flush terminated"); 308 bb_simple_perror_msg_and_die("flush terminated");
309 } 309 }
310 if (G_filter.flushed == 0) { 310 if (G_filter.flushed == 0) {
311 if (round == 0) 311 if (round == 0)
@@ -325,11 +325,11 @@ static int FAST_FUNC ipneigh_list_or_flush(char **argv, int flush)
325 ndm.ndm_family = G_filter.family; 325 ndm.ndm_family = G_filter.family;
326 326
327 if (rtnl_dump_request(&rth, RTM_GETNEIGH, &ndm, sizeof(struct ndmsg)) < 0) { 327 if (rtnl_dump_request(&rth, RTM_GETNEIGH, &ndm, sizeof(struct ndmsg)) < 0) {
328 bb_perror_msg_and_die("can't send dump request"); 328 bb_simple_perror_msg_and_die("can't send dump request");
329 } 329 }
330 330
331 if (xrtnl_dump_filter(&rth, print_neigh, NULL) < 0) { 331 if (xrtnl_dump_filter(&rth, print_neigh, NULL) < 0) {
332 bb_error_msg_and_die("dump terminated"); 332 bb_simple_error_msg_and_die("dump terminated");
333 } 333 }
334 334
335 return 0; 335 return 0;
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index b11078ed5..5a972f8b2 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -57,7 +57,7 @@ typedef struct filter_t filter_t;
57static int flush_update(void) 57static int flush_update(void)
58{ 58{
59 if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) { 59 if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) {
60 bb_perror_msg("can't send flush request"); 60 bb_simple_perror_msg("can't send flush request");
61 return -1; 61 return -1;
62 } 62 }
63 G_filter.flushp = 0; 63 G_filter.flushp = 0;
@@ -756,7 +756,7 @@ static void iproute_flush_cache(void)
756 } 756 }
757 757
758 if (write(flush_fd, "-1", 2) < 2) { 758 if (write(flush_fd, "-1", 2) < 2) {
759 bb_perror_msg("can't flush routing cache"); 759 bb_simple_perror_msg("can't flush routing cache");
760 return; 760 return;
761 } 761 }
762 close(flush_fd); 762 close(flush_fd);
@@ -948,7 +948,7 @@ static int iproute_list_or_flush(char **argv, int flush)
948 if (G_filter.tb != -1) { 948 if (G_filter.tb != -1) {
949 xrtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE); 949 xrtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE);
950 } else if (rtnl_rtcache_request(&rth, do_ipv6) < 0) { 950 } else if (rtnl_rtcache_request(&rth, do_ipv6) < 0) {
951 bb_perror_msg_and_die("can't send dump request"); 951 bb_simple_perror_msg_and_die("can't send dump request");
952 } 952 }
953 xrtnl_dump_filter(&rth, print_route, NULL); 953 xrtnl_dump_filter(&rth, print_route, NULL);
954 954
@@ -1041,7 +1041,7 @@ static int iproute_get(char **argv)
1041 } 1041 }
1042 1042
1043 if (req.r.rtm_dst_len == 0) { 1043 if (req.r.rtm_dst_len == 0) {
1044 bb_error_msg_and_die("need at least destination address"); 1044 bb_simple_error_msg_and_die("need at least destination address");
1045 } 1045 }
1046 1046
1047 xrtnl_open(&rth); 1047 xrtnl_open(&rth);
@@ -1077,7 +1077,7 @@ static int iproute_get(char **argv)
1077 print_route(NULL, &req.n, NULL); 1077 print_route(NULL, &req.n, NULL);
1078 1078
1079 if (req.n.nlmsg_type != RTM_NEWROUTE) { 1079 if (req.n.nlmsg_type != RTM_NEWROUTE) {
1080 bb_error_msg_and_die("not a route?"); 1080 bb_simple_error_msg_and_die("not a route?");
1081 } 1081 }
1082 len -= NLMSG_LENGTH(sizeof(*r)); 1082 len -= NLMSG_LENGTH(sizeof(*r));
1083 if (len < 0) { 1083 if (len < 0) {
@@ -1091,7 +1091,7 @@ static int iproute_get(char **argv)
1091 tb[RTA_PREFSRC]->rta_type = RTA_SRC; 1091 tb[RTA_PREFSRC]->rta_type = RTA_SRC;
1092 r->rtm_src_len = 8*RTA_PAYLOAD(tb[RTA_PREFSRC]); 1092 r->rtm_src_len = 8*RTA_PAYLOAD(tb[RTA_PREFSRC]);
1093 } else if (!tb[RTA_SRC]) { 1093 } else if (!tb[RTA_SRC]) {
1094 bb_error_msg_and_die("can't connect the route"); 1094 bb_simple_error_msg_and_die("can't connect the route");
1095 } 1095 }
1096 if (!odev && tb[RTA_OIF]) { 1096 if (!odev && tb[RTA_OIF]) {
1097 tb[RTA_OIF]->rta_type = 0; 1097 tb[RTA_OIF]->rta_type = 0;
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index 4002feb78..c9fa632f3 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -338,7 +338,7 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p)
338 338
339 if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) { 339 if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) {
340 if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) { 340 if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) {
341 bb_error_msg_and_die("keys are not allowed with ipip and sit"); 341 bb_simple_error_msg_and_die("keys are not allowed with ipip and sit");
342 } 342 }
343 } 343 }
344 344
@@ -355,7 +355,7 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p)
355 p->o_flags |= GRE_KEY; 355 p->o_flags |= GRE_KEY;
356 } 356 }
357 if (IN_MULTICAST(ntohl(p->iph.daddr)) && !p->iph.saddr) { 357 if (IN_MULTICAST(ntohl(p->iph.daddr)) && !p->iph.saddr) {
358 bb_error_msg_and_die("broadcast tunnel requires a source address"); 358 bb_simple_error_msg_and_die("broadcast tunnel requires a source address");
359 } 359 }
360} 360}
361 361
@@ -367,7 +367,7 @@ static int do_add(int cmd, char **argv)
367 parse_args(argv, cmd, &p); 367 parse_args(argv, cmd, &p);
368 368
369 if (p.iph.ttl && p.iph.frag_off == 0) { 369 if (p.iph.ttl && p.iph.frag_off == 0) {
370 bb_error_msg_and_die("ttl != 0 and noptmudisc are incompatible"); 370 bb_simple_error_msg_and_die("ttl != 0 and noptmudisc are incompatible");
371 } 371 }
372 372
373 switch (p.iph.protocol) { 373 switch (p.iph.protocol) {
@@ -378,7 +378,7 @@ static int do_add(int cmd, char **argv)
378 case IPPROTO_IPV6: 378 case IPPROTO_IPV6:
379 return do_add_ioctl(cmd, "sit0", &p); 379 return do_add_ioctl(cmd, "sit0", &p);
380 default: 380 default:
381 bb_error_msg_and_die("can't determine tunnel mode (ipip, gre or sit)"); 381 bb_simple_error_msg_and_die("can't determine tunnel mode (ipip, gre or sit)");
382 } 382 }
383} 383}
384 384
@@ -485,7 +485,7 @@ static void do_tunnels_list(struct ip_tunnel_parm *p)
485 if (ptr == NULL || 485 if (ptr == NULL ||
486 (*ptr++ = 0, sscanf(buf, "%s", name) != 1) 486 (*ptr++ = 0, sscanf(buf, "%s", name) != 1)
487 ) { 487 ) {
488 bb_error_msg("wrong format of /proc/net/dev"); 488 bb_simple_error_msg("wrong format of /proc/net/dev");
489 return; 489 return;
490 } 490 }
491 if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu", 491 if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu",
diff --git a/networking/libiproute/libnetlink.c b/networking/libiproute/libnetlink.c
index b0d4166ac..7e3473a1c 100644
--- a/networking/libiproute/libnetlink.c
+++ b/networking/libiproute/libnetlink.c
@@ -79,7 +79,7 @@ int FAST_FUNC rtnl_send_check(struct rtnl_handle *rth, const void *buf, int len)
79 if (h->nlmsg_type == NLMSG_ERROR) { 79 if (h->nlmsg_type == NLMSG_ERROR) {
80 struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h); 80 struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
81 if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr))) 81 if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr)))
82 bb_error_msg("ERROR truncated"); 82 bb_simple_error_msg("ERROR truncated");
83 else 83 else
84 errno = -err->error; 84 errno = -err->error;
85 return -1; 85 return -1;
@@ -149,11 +149,11 @@ static int rtnl_dump_filter(struct rtnl_handle *rth,
149 if (status < 0) { 149 if (status < 0) {
150 if (errno == EINTR) 150 if (errno == EINTR)
151 continue; 151 continue;
152 bb_perror_msg("OVERRUN"); 152 bb_simple_perror_msg("OVERRUN");
153 continue; 153 continue;
154 } 154 }
155 if (status == 0) { 155 if (status == 0) {
156 bb_error_msg("EOF on netlink"); 156 bb_simple_error_msg("EOF on netlink");
157 goto ret; 157 goto ret;
158 } 158 }
159 if (msg.msg_namelen != sizeof(nladdr)) { 159 if (msg.msg_namelen != sizeof(nladdr)) {
@@ -184,10 +184,10 @@ static int rtnl_dump_filter(struct rtnl_handle *rth,
184 if (h->nlmsg_type == NLMSG_ERROR) { 184 if (h->nlmsg_type == NLMSG_ERROR) {
185 struct nlmsgerr *l_err = (struct nlmsgerr*)NLMSG_DATA(h); 185 struct nlmsgerr *l_err = (struct nlmsgerr*)NLMSG_DATA(h);
186 if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr))) { 186 if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr))) {
187 bb_error_msg("ERROR truncated"); 187 bb_simple_error_msg("ERROR truncated");
188 } else { 188 } else {
189 errno = -l_err->error; 189 errno = -l_err->error;
190 bb_perror_msg("RTNETLINK answers"); 190 bb_simple_perror_msg("RTNETLINK answers");
191 } 191 }
192 goto ret; 192 goto ret;
193 } 193 }
@@ -201,7 +201,7 @@ static int rtnl_dump_filter(struct rtnl_handle *rth,
201 h = NLMSG_NEXT(h, status); 201 h = NLMSG_NEXT(h, status);
202 } 202 }
203 if (msg.msg_flags & MSG_TRUNC) { 203 if (msg.msg_flags & MSG_TRUNC) {
204 bb_error_msg("message truncated"); 204 bb_simple_error_msg("message truncated");
205 continue; 205 continue;
206 } 206 }
207 if (status) { 207 if (status) {
@@ -221,7 +221,7 @@ int FAST_FUNC xrtnl_dump_filter(struct rtnl_handle *rth,
221{ 221{
222 int ret = rtnl_dump_filter(rth, filter, arg1/*, NULL, NULL*/); 222 int ret = rtnl_dump_filter(rth, filter, arg1/*, NULL, NULL*/);
223 if (ret < 0) 223 if (ret < 0)
224 bb_error_msg_and_die("dump terminated"); 224 bb_simple_error_msg_and_die("dump terminated");
225 return ret; 225 return ret;
226} 226}
227 227
@@ -266,7 +266,7 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
266 status = sendmsg(rtnl->fd, &msg, 0); 266 status = sendmsg(rtnl->fd, &msg, 0);
267 267
268 if (status < 0) { 268 if (status < 0) {
269 bb_perror_msg("can't talk to rtnetlink"); 269 bb_simple_perror_msg("can't talk to rtnetlink");
270 goto ret; 270 goto ret;
271 } 271 }
272 272
@@ -280,11 +280,11 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
280 if (errno == EINTR) { 280 if (errno == EINTR) {
281 continue; 281 continue;
282 } 282 }
283 bb_perror_msg("OVERRUN"); 283 bb_simple_perror_msg("OVERRUN");
284 continue; 284 continue;
285 } 285 }
286 if (status == 0) { 286 if (status == 0) {
287 bb_error_msg("EOF on netlink"); 287 bb_simple_error_msg("EOF on netlink");
288 goto ret; 288 goto ret;
289 } 289 }
290 if (msg.msg_namelen != sizeof(nladdr)) { 290 if (msg.msg_namelen != sizeof(nladdr)) {
@@ -297,7 +297,7 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
297 297
298 if (l < 0 || len > status) { 298 if (l < 0 || len > status) {
299 if (msg.msg_flags & MSG_TRUNC) { 299 if (msg.msg_flags & MSG_TRUNC) {
300 bb_error_msg("truncated message"); 300 bb_simple_error_msg("truncated message");
301 goto ret; 301 goto ret;
302 } 302 }
303 bb_error_msg_and_die("malformed message: len=%d!", len); 303 bb_error_msg_and_die("malformed message: len=%d!", len);
@@ -320,7 +320,7 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
320 if (h->nlmsg_type == NLMSG_ERROR) { 320 if (h->nlmsg_type == NLMSG_ERROR) {
321 struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h); 321 struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
322 if (l < (int)sizeof(struct nlmsgerr)) { 322 if (l < (int)sizeof(struct nlmsgerr)) {
323 bb_error_msg("ERROR truncated"); 323 bb_simple_error_msg("ERROR truncated");
324 } else { 324 } else {
325 errno = - err->error; 325 errno = - err->error;
326 if (errno == 0) { 326 if (errno == 0) {
@@ -329,7 +329,7 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
329 } 329 }
330 goto ret_0; 330 goto ret_0;
331 } 331 }
332 bb_perror_msg("RTNETLINK answers"); 332 bb_simple_perror_msg("RTNETLINK answers");
333 } 333 }
334 goto ret; 334 goto ret;
335 } 335 }
@@ -338,13 +338,13 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
338 goto ret_0; 338 goto ret_0;
339 } 339 }
340 340
341 bb_error_msg("unexpected reply!"); 341 bb_simple_error_msg("unexpected reply!");
342 342
343 status -= NLMSG_ALIGN(len); 343 status -= NLMSG_ALIGN(len);
344 h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len)); 344 h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
345 } 345 }
346 if (msg.msg_flags & MSG_TRUNC) { 346 if (msg.msg_flags & MSG_TRUNC) {
347 bb_error_msg("message truncated"); 347 bb_simple_error_msg("message truncated");
348 continue; 348 continue;
349 } 349 }
350 if (status) { 350 if (status) {
diff --git a/networking/libiproute/utils.c b/networking/libiproute/utils.c
index bf053a54b..4ce230356 100644
--- a/networking/libiproute/utils.c
+++ b/networking/libiproute/utils.c
@@ -230,7 +230,7 @@ uint32_t FAST_FUNC get_addr32(char *name)
230char** FAST_FUNC next_arg(char **argv) 230char** FAST_FUNC next_arg(char **argv)
231{ 231{
232 if (!*++argv) 232 if (!*++argv)
233 bb_error_msg_and_die("command line is not complete, try \"help\""); 233 bb_simple_error_msg_and_die("command line is not complete, try \"help\"");
234 return argv; 234 return argv;
235} 235}
236 236
diff --git a/networking/nbd-client.c b/networking/nbd-client.c
index 0dc8d0c43..3db3b46f9 100644
--- a/networking/nbd-client.c
+++ b/networking/nbd-client.c
@@ -179,7 +179,7 @@ int nbdclient_main(int argc, char **argv)
179 if (memcmp(&nbd_header.magic1, "NBDMAGIC", 179 if (memcmp(&nbd_header.magic1, "NBDMAGIC",
180 sizeof(nbd_header.magic1)) != 0 180 sizeof(nbd_header.magic1)) != 0
181 ) { 181 ) {
182 bb_error_msg_and_die("login failed"); 182 bb_simple_error_msg_and_die("login failed");
183 } 183 }
184 if (memcmp(&nbd_header.magic2, 184 if (memcmp(&nbd_header.magic2,
185 "\x00\x00\x42\x02\x81\x86\x12\x53", 185 "\x00\x00\x42\x02\x81\x86\x12\x53",
@@ -189,7 +189,7 @@ int nbdclient_main(int argc, char **argv)
189 } else if (memcmp(&nbd_header.magic2, "IHAVEOPT", 8) == 0) { 189 } else if (memcmp(&nbd_header.magic2, "IHAVEOPT", 8) == 0) {
190 proto_new = 1; 190 proto_new = 1;
191 } else { 191 } else {
192 bb_error_msg_and_die("login failed"); 192 bb_simple_error_msg_and_die("login failed");
193 } 193 }
194 194
195 if (!proto_new) { 195 if (!proto_new) {
@@ -240,17 +240,17 @@ int nbdclient_main(int argc, char **argv)
240 } 240 }
241 241
242 if (ioctl(nbd, BLKROSET, &ro) < 0) { 242 if (ioctl(nbd, BLKROSET, &ro) < 0) {
243 bb_perror_msg_and_die("BLKROSET"); 243 bb_simple_perror_msg_and_die("BLKROSET");
244 } 244 }
245 245
246 if (timeout) { 246 if (timeout) {
247 if (ioctl(nbd, NBD_SET_TIMEOUT, (unsigned long) timeout)) { 247 if (ioctl(nbd, NBD_SET_TIMEOUT, (unsigned long) timeout)) {
248 bb_perror_msg_and_die("NBD_SET_TIMEOUT"); 248 bb_simple_perror_msg_and_die("NBD_SET_TIMEOUT");
249 } 249 }
250 } 250 }
251 251
252 if (ioctl(nbd, NBD_SET_SOCK, sock)) { 252 if (ioctl(nbd, NBD_SET_SOCK, sock)) {
253 bb_perror_msg_and_die("NBD_SET_SOCK"); 253 bb_simple_perror_msg_and_die("NBD_SET_SOCK");
254 } 254 }
255 255
256 //if (swap) mlockall(MCL_CURRENT|MCL_FUTURE); 256 //if (swap) mlockall(MCL_CURRENT|MCL_FUTURE);
diff --git a/networking/nc.c b/networking/nc.c
index b208f46c6..705b7356a 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -112,7 +112,7 @@
112 112
113static void timeout(int signum UNUSED_PARAM) 113static void timeout(int signum UNUSED_PARAM)
114{ 114{
115 bb_error_msg_and_die("timed out"); 115 bb_simple_error_msg_and_die("timed out");
116} 116}
117 117
118int nc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 118int nc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -211,7 +211,7 @@ int nc_main(int argc, char **argv)
211 accept_again: 211 accept_again:
212 cfd = accept(sfd, NULL, 0); 212 cfd = accept(sfd, NULL, 0);
213 if (cfd < 0) 213 if (cfd < 0)
214 bb_perror_msg_and_die("accept"); 214 bb_simple_perror_msg_and_die("accept");
215 if (!execparam) 215 if (!execparam)
216 close(sfd); 216 close(sfd);
217 } else { 217 } else {
@@ -260,7 +260,7 @@ int nc_main(int argc, char **argv)
260 int nread; 260 int nread;
261 261
262 if (safe_poll(pfds, 2, -1) < 0) 262 if (safe_poll(pfds, 2, -1) < 0)
263 bb_perror_msg_and_die("poll"); 263 bb_simple_perror_msg_and_die("poll");
264 264
265 fdidx = 0; 265 fdidx = 0;
266 while (1) { 266 while (1) {
diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c
index 42c84de45..034e03d21 100644
--- a/networking/nc_bloaty.c
+++ b/networking/nc_bloaty.c
@@ -198,8 +198,8 @@ enum {
198#define Debug(...) do { } while (0) 198#define Debug(...) do { } while (0)
199#endif 199#endif
200 200
201#define holler_error(...) do { if (o_verbose) bb_error_msg(__VA_ARGS__); } while (0) 201#define holler_error(msg) do { if (o_verbose) bb_simple_error_msg(msg); } while (0)
202#define holler_perror(...) do { if (o_verbose) bb_perror_msg(__VA_ARGS__); } while (0) 202#define holler_perror(msg) do { if (o_verbose) bb_simple_perror_msg(msg); } while (0)
203 203
204/* catch: no-brainer interrupt handler */ 204/* catch: no-brainer interrupt handler */
205static void catch(int sig) 205static void catch(int sig)
@@ -361,10 +361,10 @@ static void dolisten(int is_persistent, char **proggie)
361 rr = recv_from_to(netfd, NULL, 0, MSG_PEEK, /*was bigbuf_net, BIGSIZ*/ 361 rr = recv_from_to(netfd, NULL, 0, MSG_PEEK, /*was bigbuf_net, BIGSIZ*/
362 &remend.u.sa, &ouraddr->u.sa, ouraddr->len); 362 &remend.u.sa, &ouraddr->u.sa, ouraddr->len);
363 if (rr < 0) 363 if (rr < 0)
364 bb_perror_msg_and_die("recvfrom"); 364 bb_simple_perror_msg_and_die("recvfrom");
365 unarm(); 365 unarm();
366 } else 366 } else
367 bb_error_msg_and_die("timeout"); 367 bb_simple_error_msg_and_die("timeout");
368/* Now we learned *to which IP* peer has connected, and we want to anchor 368/* Now we learned *to which IP* peer has connected, and we want to anchor
369our socket on it, so that our outbound packets will have correct local IP. 369our socket on it, so that our outbound packets will have correct local IP.
370Unfortunately, bind() on already bound socket will fail now (EINVAL): 370Unfortunately, bind() on already bound socket will fail now (EINVAL):
@@ -382,7 +382,7 @@ create new one, and bind() it. TODO */
382 remend.len = LSA_SIZEOF_SA; 382 remend.len = LSA_SIZEOF_SA;
383 rr = accept(netfd, &remend.u.sa, &remend.len); 383 rr = accept(netfd, &remend.u.sa, &remend.len);
384 if (rr < 0) 384 if (rr < 0)
385 bb_perror_msg_and_die("accept"); 385 bb_simple_perror_msg_and_die("accept");
386 if (themaddr) { 386 if (themaddr) {
387 int sv_port, port, r; 387 int sv_port, port, r;
388 388
@@ -409,7 +409,7 @@ create new one, and bind() it. TODO */
409 } 409 }
410 unarm(); 410 unarm();
411 } else 411 } else
412 bb_error_msg_and_die("timeout"); 412 bb_simple_error_msg_and_die("timeout");
413 413
414 if (is_persistent && proggie) { 414 if (is_persistent && proggie) {
415 /* -l -k -e PROG */ 415 /* -l -k -e PROG */
@@ -494,7 +494,7 @@ static int udptest(void)
494 494
495 rr = write(netfd, bigbuf_in, 1); 495 rr = write(netfd, bigbuf_in, 1);
496 if (rr != 1) 496 if (rr != 1)
497 bb_perror_msg("udptest first write"); 497 bb_simple_perror_msg("udptest first write");
498 498
499 if (o_wait) 499 if (o_wait)
500 sleep(o_wait); // can be interrupted! while (t) nanosleep(&t)? 500 sleep(o_wait); // can be interrupted! while (t) nanosleep(&t)?
@@ -644,7 +644,7 @@ static int readwrite(void)
644 if (rr <= 0) { 644 if (rr <= 0) {
645 if (rr < 0 && o_verbose > 1) { 645 if (rr < 0 && o_verbose > 1) {
646 /* nc 1.10 doesn't do this */ 646 /* nc 1.10 doesn't do this */
647 bb_perror_msg("net read"); 647 bb_simple_perror_msg("net read");
648 } 648 }
649 pfds[1].fd = -1; /* don't poll for netfd anymore */ 649 pfds[1].fd = -1; /* don't poll for netfd anymore */
650 fds_open--; 650 fds_open--;
@@ -869,7 +869,7 @@ int nc_main(int argc UNUSED_PARAM, char **argv)
869 /* apparently UDP can listen ON "port 0", 869 /* apparently UDP can listen ON "port 0",
870 but that's not useful */ 870 but that's not useful */
871 if (!o_lport) 871 if (!o_lport)
872 bb_error_msg_and_die("UDP listen needs nonzero -p port"); 872 bb_simple_error_msg_and_die("UDP listen needs nonzero -p port");
873 } 873 }
874#endif 874#endif
875 875
diff --git a/networking/netstat.c b/networking/netstat.c
index f6bcd44ba..29b891cdc 100644
--- a/networking/netstat.c
+++ b/networking/netstat.c
@@ -343,9 +343,9 @@ static void prg_cache_load(void)
343 return; 343 return;
344 344
345 if (prg_cache_loaded == 1) 345 if (prg_cache_loaded == 1)
346 bb_error_msg("can't scan /proc - are you root?"); 346 bb_simple_error_msg("can't scan /proc - are you root?");
347 else 347 else
348 bb_error_msg("showing only processes with your user ID"); 348 bb_simple_error_msg("showing only processes with your user ID");
349} 349}
350 350
351#else 351#else
diff --git a/networking/nslookup.c b/networking/nslookup.c
index 24e09d4f0..8adde14b8 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -549,7 +549,7 @@ static int send_queries(struct ns *ns)
549 549
550 recvlen = read(pfd.fd, reply, sizeof(reply)); 550 recvlen = read(pfd.fd, reply, sizeof(reply));
551 if (recvlen < 0) { 551 if (recvlen < 0) {
552 bb_perror_msg("read"); 552 bb_simple_perror_msg("read");
553 next: 553 next:
554 tcur = monotonic_ms(); 554 tcur = monotonic_ms();
555 continue; 555 continue;
diff --git a/networking/ntpd.c b/networking/ntpd.c
index d55b070c5..2700cf515 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -905,7 +905,7 @@ do_sendto(int fd,
905 ret = send_to_from(fd, msg, len, MSG_DONTWAIT, to, from, addrlen); 905 ret = send_to_from(fd, msg, len, MSG_DONTWAIT, to, from, addrlen);
906 } 906 }
907 if (ret != len) { 907 if (ret != len) {
908 bb_perror_msg("send failed"); 908 bb_simple_perror_msg("send failed");
909 return -1; 909 return -1;
910 } 910 }
911 return 0; 911 return 0;
@@ -1121,7 +1121,7 @@ step_time(double offset)
1121 dtime = tvc.tv_sec + (1.0e-6 * tvc.tv_usec) + offset; 1121 dtime = tvc.tv_sec + (1.0e-6 * tvc.tv_usec) + offset;
1122 d_to_tv(dtime, &tvn); 1122 d_to_tv(dtime, &tvn);
1123 if (settimeofday(&tvn, NULL) == -1) 1123 if (settimeofday(&tvn, NULL) == -1)
1124 bb_perror_msg_and_die("settimeofday"); 1124 bb_simple_perror_msg_and_die("settimeofday");
1125 1125
1126 VERB2 { 1126 VERB2 {
1127 tval = tvc.tv_sec; 1127 tval = tvc.tv_sec;
@@ -1494,7 +1494,7 @@ select_and_cluster(void)
1494 /* Starting from 1 is ok here */ 1494 /* Starting from 1 is ok here */
1495 for (i = 1; i < num_survivors; i++) { 1495 for (i = 1; i < num_survivors; i++) {
1496 if (G.last_update_peer == survivor[i].p) { 1496 if (G.last_update_peer == survivor[i].p) {
1497 VERB5 bb_error_msg("keeping old synced peer"); 1497 VERB5 bb_simple_error_msg("keeping old synced peer");
1498 p = G.last_update_peer; 1498 p = G.last_update_peer;
1499 goto keep_old; 1499 goto keep_old;
1500 } 1500 }
@@ -1702,7 +1702,7 @@ update_local_clock(peer_t *p)
1702#else 1702#else
1703 set_new_values(STATE_SYNC, offset, recv_time); 1703 set_new_values(STATE_SYNC, offset, recv_time);
1704#endif 1704#endif
1705 VERB4 bb_error_msg("transitioning to FREQ, datapoint ignored"); 1705 VERB4 bb_simple_error_msg("transitioning to FREQ, datapoint ignored");
1706 return 0; /* "leave poll interval as is" */ 1706 return 0; /* "leave poll interval as is" */
1707 1707
1708#if 0 /* this is dead code for now */ 1708#if 0 /* this is dead code for now */
@@ -1796,7 +1796,7 @@ update_local_clock(peer_t *p)
1796 VERB4 { 1796 VERB4 {
1797 memset(&tmx, 0, sizeof(tmx)); 1797 memset(&tmx, 0, sizeof(tmx));
1798 if (adjtimex(&tmx) < 0) 1798 if (adjtimex(&tmx) < 0)
1799 bb_perror_msg_and_die("adjtimex"); 1799 bb_simple_perror_msg_and_die("adjtimex");
1800 bb_error_msg("p adjtimex freq:%ld offset:%+ld status:0x%x tc:%ld", 1800 bb_error_msg("p adjtimex freq:%ld offset:%+ld status:0x%x tc:%ld",
1801 tmx.freq, tmx.offset, tmx.status, tmx.constant); 1801 tmx.freq, tmx.offset, tmx.status, tmx.constant);
1802 } 1802 }
@@ -1906,7 +1906,7 @@ update_local_clock(peer_t *p)
1906 //tmx.maxerror = (uint32_t)((sys_rootdelay / 2 + sys_rootdisp) * 1e6); 1906 //tmx.maxerror = (uint32_t)((sys_rootdelay / 2 + sys_rootdisp) * 1e6);
1907 rc = adjtimex(&tmx); 1907 rc = adjtimex(&tmx);
1908 if (rc < 0) 1908 if (rc < 0)
1909 bb_perror_msg_and_die("adjtimex"); 1909 bb_simple_perror_msg_and_die("adjtimex");
1910 /* NB: here kernel returns constant == G.poll_exp, not == G.poll_exp - 4. 1910 /* NB: here kernel returns constant == G.poll_exp, not == G.poll_exp - 4.
1911 * Not sure why. Perhaps it is normal. 1911 * Not sure why. Perhaps it is normal.
1912 */ 1912 */
@@ -2248,7 +2248,7 @@ recv_and_process_client_pkt(void /*int fd*/)
2248 if (size < 0) { 2248 if (size < 0) {
2249 if (errno == EAGAIN) 2249 if (errno == EAGAIN)
2250 goto bail; 2250 goto bail;
2251 bb_perror_msg_and_die("recv"); 2251 bb_simple_perror_msg_and_die("recv");
2252 } 2252 }
2253 addr = xmalloc_sockaddr2dotted_noport(from); 2253 addr = xmalloc_sockaddr2dotted_noport(from);
2254 bb_error_msg("malformed packet received from %s: size %u", addr, (int)size); 2254 bb_error_msg("malformed packet received from %s: size %u", addr, (int)size);
@@ -2415,7 +2415,7 @@ static NOINLINE void ntp_init(char **argv)
2415 srand(getpid()); 2415 srand(getpid());
2416 2416
2417 if (getuid()) 2417 if (getuid())
2418 bb_error_msg_and_die(bb_msg_you_must_be_root); 2418 bb_simple_error_msg_and_die(bb_msg_you_must_be_root);
2419 2419
2420 /* Set some globals */ 2420 /* Set some globals */
2421 G.discipline_jitter = G_precision_sec; 2421 G.discipline_jitter = G_precision_sec;
@@ -2491,7 +2491,7 @@ static NOINLINE void ntp_init(char **argv)
2491 /* supports 'sha' and 'sha1' formats */ 2491 /* supports 'sha' and 'sha1' formats */
2492 hash_type = HASH_SHA1; 2492 hash_type = HASH_SHA1;
2493 else 2493 else
2494 bb_error_msg_and_die("only MD5 and SHA1 keys supported"); 2494 bb_simple_error_msg_and_die("only MD5 and SHA1 keys supported");
2495/* man ntp.keys: 2495/* man ntp.keys:
2496 * MD5 The key is 1 to 16 printable characters terminated by an EOL, 2496 * MD5 The key is 1 to 16 printable characters terminated by an EOL,
2497 * whitespace, or a # (which is the "start of comment" character). 2497 * whitespace, or a # (which is the "start of comment" character).
@@ -2674,7 +2674,7 @@ int ntpd_main(int argc UNUSED_PARAM, char **argv)
2674 if (p->p_fd == -1) { 2674 if (p->p_fd == -1) {
2675 /* Time to send new req */ 2675 /* Time to send new req */
2676 if (--cnt == 0) { 2676 if (--cnt == 0) {
2677 VERB4 bb_error_msg("disabling burst mode"); 2677 VERB4 bb_simple_error_msg("disabling burst mode");
2678 G.polladj_count = 0; 2678 G.polladj_count = 0;
2679 G.poll_exp = MINPOLL; 2679 G.poll_exp = MINPOLL;
2680 } 2680 }
diff --git a/networking/ping.c b/networking/ping.c
index b534c74c7..a47342fee 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -184,8 +184,8 @@ create_icmp_socket(void)
184 sock = socket(AF_INET, SOCK_RAW, 1); /* 1 == ICMP */ 184 sock = socket(AF_INET, SOCK_RAW, 1); /* 1 == ICMP */
185 if (sock < 0) { 185 if (sock < 0) {
186 if (errno == EPERM) 186 if (errno == EPERM)
187 bb_error_msg_and_die(bb_msg_perm_denied_are_you_root); 187 bb_simple_error_msg_and_die(bb_msg_perm_denied_are_you_root);
188 bb_perror_msg_and_die(bb_msg_can_not_create_raw_socket); 188 bb_simple_perror_msg_and_die(bb_msg_can_not_create_raw_socket);
189 } 189 }
190 190
191 xmove_fd(sock, pingsock); 191 xmove_fd(sock, pingsock);
@@ -235,7 +235,7 @@ static void ping4(len_and_sockaddr *lsa)
235#endif 235#endif
236 if (c < 0) { 236 if (c < 0) {
237 if (errno != EINTR) 237 if (errno != EINTR)
238 bb_perror_msg("recvfrom"); 238 bb_simple_perror_msg("recvfrom");
239 continue; 239 continue;
240 } 240 }
241 if (c >= 76) { /* ip + icmp */ 241 if (c >= 76) { /* ip + icmp */
@@ -280,7 +280,7 @@ static void ping6(len_and_sockaddr *lsa)
280#endif 280#endif
281 if (c < 0) { 281 if (c < 0) {
282 if (errno != EINTR) 282 if (errno != EINTR)
283 bb_perror_msg("recvfrom"); 283 bb_simple_perror_msg("recvfrom");
284 continue; 284 continue;
285 } 285 }
286 if (c >= ICMP_MINLEN) { /* icmp6_hdr */ 286 if (c >= ICMP_MINLEN) { /* icmp6_hdr */
@@ -482,7 +482,7 @@ static void sendping_tail(void (*sp)(int), int size_pkt)
482 * it doesn't matter */ 482 * it doesn't matter */
483 sz = xsendto(pingsock, G.snd_packet, size_pkt, &pingaddr.sa, sizeof(pingaddr)); 483 sz = xsendto(pingsock, G.snd_packet, size_pkt, &pingaddr.sa, sizeof(pingaddr));
484 if (sz != size_pkt) 484 if (sz != size_pkt)
485 bb_error_msg_and_die(bb_msg_write_error); 485 bb_simple_error_msg_and_die(bb_msg_write_error);
486 486
487 if (pingcount == 0 || G.ntransmitted < pingcount) { 487 if (pingcount == 0 || G.ntransmitted < pingcount) {
488 /* Didn't send all pings yet - schedule next in -i SEC interval */ 488 /* Didn't send all pings yet - schedule next in -i SEC interval */
@@ -723,7 +723,7 @@ static void ping4(len_and_sockaddr *lsa)
723 if (source_lsa) { 723 if (source_lsa) {
724 if (setsockopt(pingsock, IPPROTO_IP, IP_MULTICAST_IF, 724 if (setsockopt(pingsock, IPPROTO_IP, IP_MULTICAST_IF,
725 &source_lsa->u.sa, source_lsa->len)) 725 &source_lsa->u.sa, source_lsa->len))
726 bb_error_msg_and_die("can't set multicast source interface"); 726 bb_simple_error_msg_and_die("can't set multicast source interface");
727 xbind(pingsock, &source_lsa->u.sa, source_lsa->len); 727 xbind(pingsock, &source_lsa->u.sa, source_lsa->len);
728 } 728 }
729 729
@@ -757,7 +757,7 @@ static void ping4(len_and_sockaddr *lsa)
757 (struct sockaddr *) &from, &fromlen); 757 (struct sockaddr *) &from, &fromlen);
758 if (c < 0) { 758 if (c < 0) {
759 if (errno != EINTR) 759 if (errno != EINTR)
760 bb_perror_msg("recvfrom"); 760 bb_simple_perror_msg("recvfrom");
761 continue; 761 continue;
762 } 762 }
763 c = unpack4(G.rcv_packet, c, &from); 763 c = unpack4(G.rcv_packet, c, &from);
@@ -838,7 +838,7 @@ static void ping6(len_and_sockaddr *lsa)
838 c = recvmsg(pingsock, &msg, 0); 838 c = recvmsg(pingsock, &msg, 0);
839 if (c < 0) { 839 if (c < 0) {
840 if (errno != EINTR) 840 if (errno != EINTR)
841 bb_perror_msg("recvfrom"); 841 bb_simple_perror_msg("recvfrom");
842 continue; 842 continue;
843 } 843 }
844 for (mp = CMSG_FIRSTHDR(&msg); mp; mp = CMSG_NXTHDR(&msg, mp)) { 844 for (mp = CMSG_FIRSTHDR(&msg); mp; mp = CMSG_NXTHDR(&msg, mp)) {
diff --git a/networking/route.c b/networking/route.c
index ac1d94c28..a5d8d7cb9 100644
--- a/networking/route.c
+++ b/networking/route.c
@@ -336,7 +336,7 @@ static NOINLINE void INET_setroute(int action, char **args)
336 } 336 }
337 mask = ((struct sockaddr_in *) &rt->rt_dst)->sin_addr.s_addr; 337 mask = ((struct sockaddr_in *) &rt->rt_dst)->sin_addr.s_addr;
338 if (mask & ~(uint32_t)mask_in_addr(*rt)) { 338 if (mask & ~(uint32_t)mask_in_addr(*rt)) {
339 bb_error_msg_and_die("netmask and route address conflict"); 339 bb_simple_error_msg_and_die("netmask and route address conflict");
340 } 340 }
341 } 341 }
342 342
@@ -532,7 +532,7 @@ void FAST_FUNC bb_displayroutes(int noresolve, int netstatfmt)
532 if ((r < 0) && feof(fp)) { /* EOF with no (nonspace) chars read. */ 532 if ((r < 0) && feof(fp)) { /* EOF with no (nonspace) chars read. */
533 break; 533 break;
534 } 534 }
535 bb_perror_msg_and_die(bb_msg_read_error); 535 bb_simple_perror_msg_and_die(bb_msg_read_error);
536 } 536 }
537 537
538 if (!(flgs & RTF_UP)) { /* Skip interfaces that are down. */ 538 if (!(flgs & RTF_UP)) { /* Skip interfaces that are down. */
@@ -598,7 +598,7 @@ static void INET6_displayroutes(void)
598 break; 598 break;
599 } 599 }
600 ERROR: 600 ERROR:
601 bb_perror_msg_and_die(bb_msg_read_error); 601 bb_simple_perror_msg_and_die(bb_msg_read_error);
602 } 602 }
603 603
604 /* Do the addr6x shift-and-insert changes to ':'-delimit addresses. 604 /* Do the addr6x shift-and-insert changes to ':'-delimit addresses.
diff --git a/networking/slattach.c b/networking/slattach.c
index c6feca248..659822a91 100644
--- a/networking/slattach.c
+++ b/networking/slattach.c
@@ -56,7 +56,7 @@ static int tcsetattr_serial_or_warn(struct termios *state)
56 56
57 ret = tcsetattr(serial_fd, TCSANOW, state); 57 ret = tcsetattr(serial_fd, TCSANOW, state);
58 if (ret != 0) { 58 if (ret != 0) {
59 bb_perror_msg("tcsetattr"); 59 bb_simple_perror_msg("tcsetattr");
60 return 1; /* used as exitcode */ 60 return 1; /* used as exitcode */
61 } 61 }
62 return ret; /* 0 */ 62 return ret; /* 0 */
@@ -159,7 +159,7 @@ int slattach_main(int argc UNUSED_PARAM, char **argv)
159 159
160 /* Save current tty state */ 160 /* Save current tty state */
161 if (tcgetattr(serial_fd, &G.saved_state) != 0) 161 if (tcgetattr(serial_fd, &G.saved_state) != 0)
162 bb_perror_msg_and_die("tcgetattr"); 162 bb_simple_perror_msg_and_die("tcgetattr");
163 /* Save line discipline */ 163 /* Save line discipline */
164 xioctl(serial_fd, TIOCGETD, &G.saved_disc); 164 xioctl(serial_fd, TIOCGETD, &G.saved_disc);
165 165
diff --git a/networking/tcpudp.c b/networking/tcpudp.c
index a0af64981..8c4afabf6 100644
--- a/networking/tcpudp.c
+++ b/networking/tcpudp.c
@@ -325,7 +325,7 @@ int tcpudpsvd_main(int argc UNUSED_PARAM, char **argv)
325 client = 0; 325 client = 0;
326 if ((getuid() == 0) && !(opts & OPT_u)) { 326 if ((getuid() == 0) && !(opts & OPT_u)) {
327 xfunc_error_retval = 100; 327 xfunc_error_retval = 100;
328 bb_error_msg_and_die(bb_msg_you_must_be_root); 328 bb_simple_error_msg_and_die(bb_msg_you_must_be_root);
329 } 329 }
330 if (opts & OPT_u) 330 if (opts & OPT_u)
331 if (!uidgid_get(&sslugid, ssluser, 1)) { 331 if (!uidgid_get(&sslugid, ssluser, 1)) {
@@ -419,7 +419,7 @@ int tcpudpsvd_main(int argc UNUSED_PARAM, char **argv)
419 sig_block(SIGCHLD); 419 sig_block(SIGCHLD);
420 if (conn < 0) { 420 if (conn < 0) {
421 if (errno != EINTR) 421 if (errno != EINTR)
422 bb_perror_msg(tcp ? "accept" : "recv"); 422 bb_simple_perror_msg(tcp ? "accept" : "recv");
423 goto again2; 423 goto again2;
424 } 424 }
425 xmove_fd(tcp ? conn : sock, 0); 425 xmove_fd(tcp ? conn : sock, 0);
@@ -484,7 +484,7 @@ int tcpudpsvd_main(int argc UNUSED_PARAM, char **argv)
484 484
485 pid = vfork(); 485 pid = vfork();
486 if (pid == -1) { 486 if (pid == -1) {
487 bb_perror_msg("vfork"); 487 bb_simple_perror_msg("vfork");
488 goto again; 488 goto again;
489 } 489 }
490 490
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 6abecbde2..29f805de7 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -495,7 +495,7 @@ make_new_session(
495 free(ts); 495 free(ts);
496 close(fd); 496 close(fd);
497 /* sock will be closed by caller */ 497 /* sock will be closed by caller */
498 bb_perror_msg("vfork"); 498 bb_simple_perror_msg("vfork");
499 return NULL; 499 return NULL;
500 } 500 }
501 if (pid > 0) { 501 if (pid > 0) {
diff --git a/networking/tftp.c b/networking/tftp.c
index d551c861f..04bfe844f 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -453,7 +453,7 @@ static int tftp_protocol(
453 /* fill in packet if the filename fits into xbuf */ 453 /* fill in packet if the filename fits into xbuf */
454 len = strlen(remote_file) + 1; 454 len = strlen(remote_file) + 1;
455 if (2 + len + sizeof("octet") >= io_bufsize) { 455 if (2 + len + sizeof("octet") >= io_bufsize) {
456 bb_error_msg("remote filename is too long"); 456 bb_simple_error_msg("remote filename is too long");
457 goto ret; 457 goto ret;
458 } 458 }
459 strcpy(cp, remote_file); 459 strcpy(cp, remote_file);
@@ -468,7 +468,7 @@ static int tftp_protocol(
468 468
469 /* Need to add option to pkt */ 469 /* Need to add option to pkt */
470 if ((&xbuf[io_bufsize - 1] - cp) < sizeof("blksize NNNNN tsize ") + sizeof(off_t)*3) { 470 if ((&xbuf[io_bufsize - 1] - cp) < sizeof("blksize NNNNN tsize ") + sizeof(off_t)*3) {
471 bb_error_msg("remote filename is too long"); 471 bb_simple_error_msg("remote filename is too long");
472 goto ret; 472 goto ret;
473 } 473 }
474 expect_OACK = 1; 474 expect_OACK = 1;
@@ -569,7 +569,7 @@ static int tftp_protocol(
569 retries--; 569 retries--;
570 if (retries == 0) { 570 if (retries == 0) {
571 tftp_progress_done(); 571 tftp_progress_done();
572 bb_error_msg("timeout"); 572 bb_simple_error_msg("timeout");
573 goto ret; /* no err packet sent */ 573 goto ret; /* no err packet sent */
574 } 574 }
575 575
@@ -674,7 +674,7 @@ static int tftp_protocol(
674 * must be ignored by the client and server 674 * must be ignored by the client and server
675 * as if it were never requested." */ 675 * as if it were never requested." */
676 if (blksize != TFTP_BLKSIZE_DEFAULT) 676 if (blksize != TFTP_BLKSIZE_DEFAULT)
677 bb_error_msg("falling back to blocksize "TFTP_BLKSIZE_DEFAULT_STR); 677 bb_simple_error_msg("falling back to blocksize "TFTP_BLKSIZE_DEFAULT_STR);
678 blksize = TFTP_BLKSIZE_DEFAULT; 678 blksize = TFTP_BLKSIZE_DEFAULT;
679 io_bufsize = TFTP_BLKSIZE_DEFAULT + 4; 679 io_bufsize = TFTP_BLKSIZE_DEFAULT + 4;
680 } 680 }
@@ -739,7 +739,7 @@ static int tftp_protocol(
739 strcpy(G_error_pkt_str, bb_msg_read_error); 739 strcpy(G_error_pkt_str, bb_msg_read_error);
740 send_err_pkt: 740 send_err_pkt:
741 if (G_error_pkt_str[0]) 741 if (G_error_pkt_str[0])
742 bb_error_msg("%s", G_error_pkt_str); 742 bb_simple_error_msg(G_error_pkt_str);
743 G.error_pkt[1] = TFTP_ERROR; 743 G.error_pkt[1] = TFTP_ERROR;
744 xsendto(socket_fd, G.error_pkt, 4 + 1 + strlen(G_error_pkt_str), 744 xsendto(socket_fd, G.error_pkt, 4 + 1 + strlen(G_error_pkt_str),
745 &peer_lsa->u.sa, peer_lsa->len); 745 &peer_lsa->u.sa, peer_lsa->len);
diff --git a/networking/tls.c b/networking/tls.c
index db7be07f3..854937302 100644
--- a/networking/tls.c
+++ b/networking/tls.c
@@ -446,7 +446,7 @@ static void hmac_begin(hmac_precomputed_t *pre, uint8_t *key, unsigned key_size,
446 // than INSIZE bytes will first hash the key using H and then use the 446 // than INSIZE bytes will first hash the key using H and then use the
447 // resultant OUTSIZE byte string as the actual key to HMAC." 447 // resultant OUTSIZE byte string as the actual key to HMAC."
448 if (key_size > SHA_INSIZE) { 448 if (key_size > SHA_INSIZE) {
449 bb_error_msg_and_die("HMAC key>64"); //does not happen (yet?) 449 bb_simple_error_msg_and_die("HMAC key>64"); //does not happen (yet?)
450// md5sha_ctx_t ctx; 450// md5sha_ctx_t ctx;
451// begin(&ctx); 451// begin(&ctx);
452// md5sha_hash(&ctx, key, key_size); 452// md5sha_hash(&ctx, key, key_size);
@@ -1132,7 +1132,7 @@ static int tls_xread_record(tls_state_t *tls, const char *expected)
1132 } 1132 }
1133 } 1133 }
1134 if (sz < 0) 1134 if (sz < 0)
1135 bb_error_msg_and_die("encrypted data too short"); 1135 bb_simple_error_msg_and_die("encrypted data too short");
1136 1136
1137 //dump_hex("<< %s\n", tls->inbuf, RECHDR_LEN + sz); 1137 //dump_hex("<< %s\n", tls->inbuf, RECHDR_LEN + sz);
1138 1138
@@ -1411,7 +1411,7 @@ static void find_key_in_der_cert(tls_state_t *tls, uint8_t *der, int len)
1411 dbg("ECDSA key\n"); 1411 dbg("ECDSA key\n");
1412 //UNUSED: tls->flags |= GOT_CERT_ECDSA_KEY_ALG; 1412 //UNUSED: tls->flags |= GOT_CERT_ECDSA_KEY_ALG;
1413 } else 1413 } else
1414 bb_error_msg_and_die("not RSA or ECDSA cert"); 1414 bb_simple_error_msg_and_die("not RSA or ECDSA cert");
1415 } 1415 }
1416 1416
1417 if (tls->flags & GOT_CERT_RSA_KEY_ALG) { 1417 if (tls->flags & GOT_CERT_RSA_KEY_ALG) {
@@ -1882,7 +1882,7 @@ static void process_server_key(tls_state_t *tls, int len)
1882 /* So far we only support curve_x25519 */ 1882 /* So far we only support curve_x25519 */
1883 move_from_unaligned32(t32, keybuf); 1883 move_from_unaligned32(t32, keybuf);
1884 if (t32 != htonl(0x03001d20)) 1884 if (t32 != htonl(0x03001d20))
1885 bb_error_msg_and_die("elliptic curve is not x25519"); 1885 bb_simple_error_msg_and_die("elliptic curve is not x25519");
1886 1886
1887 memcpy(tls->hsd->ecc_pub_key32, keybuf + 4, 32); 1887 memcpy(tls->hsd->ecc_pub_key32, keybuf + 4, 32);
1888 tls->flags |= GOT_EC_KEY; 1888 tls->flags |= GOT_EC_KEY;
@@ -1929,7 +1929,7 @@ static void send_client_key_exchange(tls_state_t *tls)
1929 if (!(tls->flags & NEED_EC_KEY)) { 1929 if (!(tls->flags & NEED_EC_KEY)) {
1930 /* RSA */ 1930 /* RSA */
1931 if (!(tls->flags & GOT_CERT_RSA_KEY_ALG)) 1931 if (!(tls->flags & GOT_CERT_RSA_KEY_ALG))
1932 bb_error_msg("server cert is not RSA"); 1932 bb_simple_error_msg("server cert is not RSA");
1933 1933
1934 tls_get_random(rsa_premaster, sizeof(rsa_premaster)); 1934 tls_get_random(rsa_premaster, sizeof(rsa_premaster));
1935 if (TLS_DEBUG_FIXED_SECRETS) 1935 if (TLS_DEBUG_FIXED_SECRETS)
@@ -1959,7 +1959,7 @@ static void send_client_key_exchange(tls_state_t *tls)
1959 uint8_t privkey[CURVE25519_KEYSIZE]; //[32] 1959 uint8_t privkey[CURVE25519_KEYSIZE]; //[32]
1960 1960
1961 if (!(tls->flags & GOT_EC_KEY)) 1961 if (!(tls->flags & GOT_EC_KEY))
1962 bb_error_msg("server did not provide EC key"); 1962 bb_simple_error_msg("server did not provide EC key");
1963 1963
1964 /* Generate random private key, see RFC 7748 */ 1964 /* Generate random private key, see RFC 7748 */
1965 tls_get_random(privkey, sizeof(privkey)); 1965 tls_get_random(privkey, sizeof(privkey));
@@ -2322,7 +2322,7 @@ void FAST_FUNC tls_run_copy_loop(tls_state_t *tls, unsigned flags)
2322 int nread; 2322 int nread;
2323 2323
2324 if (safe_poll(pfds, 2, -1) < 0) 2324 if (safe_poll(pfds, 2, -1) < 0)
2325 bb_perror_msg_and_die("poll"); 2325 bb_simple_perror_msg_and_die("poll");
2326 2326
2327 if (pfds[0].revents) { 2327 if (pfds[0].revents) {
2328 void *buf; 2328 void *buf;
diff --git a/networking/tls.h b/networking/tls.h
index 494ed78c4..d4ac1bef8 100644
--- a/networking/tls.h
+++ b/networking/tls.h
@@ -90,7 +90,7 @@ void xorbuf_aligned_AES_BLOCK_SIZE(void* buf, const void* mask) FAST_FUNC;
90#define matrixCryptoGetPrngData(buf, len, userPtr) (tls_get_random(buf, len), PS_SUCCESS) 90#define matrixCryptoGetPrngData(buf, len, userPtr) (tls_get_random(buf, len), PS_SUCCESS)
91 91
92#define psFree(p, pool) free(p) 92#define psFree(p, pool) free(p)
93#define psTraceCrypto(...) bb_error_msg_and_die(__VA_ARGS__) 93#define psTraceCrypto(msg) bb_simple_error_msg_and_die(msg)
94 94
95/* Secure zerofill */ 95/* Secure zerofill */
96#define memset_s(A,B,C,D) memset((A),(C),(D)) 96#define memset_s(A,B,C,D) memset((A),(C),(D))
diff --git a/networking/traceroute.c b/networking/traceroute.c
index bdf451186..0435d6ba6 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -875,7 +875,7 @@ common_traceroute_main(int op, char **argv)
875 * probe (e.g., on a multi-homed host). 875 * probe (e.g., on a multi-homed host).
876 */ 876 */
877 if (getuid() != 0) 877 if (getuid() != 0)
878 bb_error_msg_and_die(bb_msg_you_must_be_root); 878 bb_simple_error_msg_and_die(bb_msg_you_must_be_root);
879 } 879 }
880 if (op & OPT_WAITTIME) 880 if (op & OPT_WAITTIME)
881 waittime = xatou_range(waittime_str, 1, 24 * 60 * 60); 881 waittime = xatou_range(waittime_str, 1, 24 * 60 * 60);
@@ -1003,7 +1003,7 @@ common_traceroute_main(int op, char **argv)
1003 if (af == AF_INET) 1003 if (af == AF_INET)
1004 if (setsockopt(sndsock, IPPROTO_IP, IP_MULTICAST_IF, 1004 if (setsockopt(sndsock, IPPROTO_IP, IP_MULTICAST_IF,
1005 &source_lsa->u.sa, source_lsa->len)) 1005 &source_lsa->u.sa, source_lsa->len))
1006 bb_error_msg_and_die("can't set multicast source interface"); 1006 bb_simple_error_msg_and_die("can't set multicast source interface");
1007//TODO: we can query source port we bound to, 1007//TODO: we can query source port we bound to,
1008// and check it in replies... if we care enough 1008// and check it in replies... if we care enough
1009 xbind(sndsock, &source_lsa->u.sa, source_lsa->len); 1009 xbind(sndsock, &source_lsa->u.sa, source_lsa->len);
@@ -1025,7 +1025,7 @@ common_traceroute_main(int op, char **argv)
1025 /* read IP and port */ 1025 /* read IP and port */
1026 source_lsa = get_sock_lsa(probe_fd); 1026 source_lsa = get_sock_lsa(probe_fd);
1027 if (source_lsa == NULL) 1027 if (source_lsa == NULL)
1028 bb_error_msg_and_die("can't get probe addr"); 1028 bb_simple_error_msg_and_die("can't get probe addr");
1029 1029
1030 close(probe_fd); 1030 close(probe_fd);
1031 1031
diff --git a/networking/udhcp/arpping.c b/networking/udhcp/arpping.c
index 215d023ce..a395e838d 100644
--- a/networking/udhcp/arpping.c
+++ b/networking/udhcp/arpping.c
@@ -53,12 +53,12 @@ int FAST_FUNC arpping(uint32_t test_nip,
53 53
54 s = socket(PF_PACKET, SOCK_PACKET, htons(ETH_P_ARP)); 54 s = socket(PF_PACKET, SOCK_PACKET, htons(ETH_P_ARP));
55 if (s == -1) { 55 if (s == -1) {
56 bb_perror_msg(bb_msg_can_not_create_raw_socket); 56 bb_simple_perror_msg(bb_msg_can_not_create_raw_socket);
57 return -1; 57 return -1;
58 } 58 }
59 59
60 if (setsockopt_broadcast(s) == -1) { 60 if (setsockopt_broadcast(s) == -1) {
61 bb_perror_msg("can't enable bcast on raw socket"); 61 bb_simple_perror_msg("can't enable bcast on raw socket");
62 goto ret; 62 goto ret;
63 } 63 }
64 64
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index 62ad248ce..4a452cdb9 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -240,7 +240,7 @@ uint8_t* FAST_FUNC udhcp_get_option(struct dhcp_packet *packet, int code)
240 while (1) { 240 while (1) {
241 if (rem <= 0) { 241 if (rem <= 0) {
242 complain: 242 complain:
243 bb_error_msg("bad packet, malformed option field"); 243 bb_simple_error_msg("bad packet, malformed option field");
244 return NULL; 244 return NULL;
245 } 245 }
246 246
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index bba3d6037..60255eefa 100644
--- a/networking/udhcp/common.h
+++ b/networking/udhcp/common.h
@@ -267,26 +267,45 @@ struct option_set *udhcp_find_option(struct option_set *opt_list, uint8_t code)
267# define IF_UDHCP_VERBOSE(...) __VA_ARGS__ 267# define IF_UDHCP_VERBOSE(...) __VA_ARGS__
268extern unsigned dhcp_verbose; 268extern unsigned dhcp_verbose;
269# define log1(...) do { if (dhcp_verbose >= 1) bb_info_msg(__VA_ARGS__); } while (0) 269# define log1(...) do { if (dhcp_verbose >= 1) bb_info_msg(__VA_ARGS__); } while (0)
270# define log1s(msg) do { if (dhcp_verbose >= 1) bb_simple_info_msg(msg); } while (0)
270# if CONFIG_UDHCP_DEBUG >= 2 271# if CONFIG_UDHCP_DEBUG >= 2
271void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC; 272void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC;
272# define log2(...) do { if (dhcp_verbose >= 2) bb_info_msg(__VA_ARGS__); } while (0) 273# define log2(...) do { if (dhcp_verbose >= 2) bb_info_msg(__VA_ARGS__); } while (0)
274# define log2s(msg) do { if (dhcp_verbose >= 2) bb_simple_info_msg(msg); } while (0)
273# else 275# else
274# define udhcp_dump_packet(...) ((void)0) 276# define udhcp_dump_packet(...) ((void)0)
275# define log2(...) ((void)0) 277# define log2(...) ((void)0)
278# define log2s(msg) ((void)0)
276# endif 279# endif
277# if CONFIG_UDHCP_DEBUG >= 3 280# if CONFIG_UDHCP_DEBUG >= 3
278# define log3(...) do { if (dhcp_verbose >= 3) bb_info_msg(__VA_ARGS__); } while (0) 281# define log3(...) do { if (dhcp_verbose >= 3) bb_info_msg(__VA_ARGS__); } while (0)
282# define log3s(msg) do { if (dhcp_verbose >= 3) bb_simple_info_msg(msg); } while (0)
279# else 283# else
280# define log3(...) ((void)0) 284# define log3(...) ((void)0)
285# define log3s(msg) ((void)0)
281# endif 286# endif
282#else 287#else
283# define IF_UDHCP_VERBOSE(...) 288# define IF_UDHCP_VERBOSE(...)
284# define udhcp_dump_packet(...) ((void)0) 289# define udhcp_dump_packet(...) ((void)0)
285# define log1(...) ((void)0) 290# define log1(...) ((void)0)
291# define log1s(msg) ((void)0)
286# define log2(...) ((void)0) 292# define log2(...) ((void)0)
293# define log2s(msg) ((void)0)
287# define log3(...) ((void)0) 294# define log3(...) ((void)0)
295# define log3s(msg) ((void)0)
288#endif 296#endif
289 297
298#if defined(__mips__)
299/*
300 * The 'simple' message functions have a negative impact on the size of the
301 * DHCP code when compiled for MIPS, so don't use them in this case.
302 */
303#define bb_simple_info_msg bb_info_msg
304#define bb_simple_error_msg bb_error_msg
305#define bb_simple_perror_msg_and_die bb_perror_msg_and_die
306#undef log1s
307#define log1s log1
308#endif
290 309
291/*** Other shared functions ***/ 310/*** Other shared functions ***/
292 311
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
index 4eb7ae1c1..9d8e17c51 100644
--- a/networking/udhcp/d6_dhcpc.c
+++ b/networking/udhcp/d6_dhcpc.c
@@ -235,7 +235,7 @@ static char *string_option_to_env(const uint8_t *option,
235 found: 235 found:
236 val_len = (option[2] << 8) | option[3]; 236 val_len = (option[2] << 8) | option[3];
237 if (val_len + &option[D6_OPT_DATA] > option_end) { 237 if (val_len + &option[D6_OPT_DATA] > option_end) {
238 bb_error_msg("option data exceeds option length"); 238 bb_simple_error_msg("option data exceeds option length");
239 return NULL; 239 return NULL;
240 } 240 }
241 return xasprintf("%s=%.*s", name, val_len, (char*)option + 4); 241 return xasprintf("%s=%.*s", name, val_len, (char*)option + 4);
@@ -848,19 +848,19 @@ static NOINLINE int d6_recv_raw_packet(struct in6_addr *peer_ipv6, struct d6_pac
848 848
849 bytes = safe_read(fd, &packet, sizeof(packet)); 849 bytes = safe_read(fd, &packet, sizeof(packet));
850 if (bytes < 0) { 850 if (bytes < 0) {
851 log1("packet read error, ignoring"); 851 log1s("packet read error, ignoring");
852 /* NB: possible down interface, etc. Caller should pause. */ 852 /* NB: possible down interface, etc. Caller should pause. */
853 return bytes; /* returns -1 */ 853 return bytes; /* returns -1 */
854 } 854 }
855 855
856 if (bytes < (int) (sizeof(packet.ip6) + sizeof(packet.udp))) { 856 if (bytes < (int) (sizeof(packet.ip6) + sizeof(packet.udp))) {
857 log1("packet is too short, ignoring"); 857 log1s("packet is too short, ignoring");
858 return -2; 858 return -2;
859 } 859 }
860 860
861 if (bytes < sizeof(packet.ip6) + ntohs(packet.ip6.ip6_plen)) { 861 if (bytes < sizeof(packet.ip6) + ntohs(packet.ip6.ip6_plen)) {
862 /* packet is bigger than sizeof(packet), we did partial read */ 862 /* packet is bigger than sizeof(packet), we did partial read */
863 log1("oversized packet, ignoring"); 863 log1s("oversized packet, ignoring");
864 return -2; 864 return -2;
865 } 865 }
866 866
@@ -874,7 +874,7 @@ static NOINLINE int d6_recv_raw_packet(struct in6_addr *peer_ipv6, struct d6_pac
874 /* || bytes > (int) sizeof(packet) - can't happen */ 874 /* || bytes > (int) sizeof(packet) - can't happen */
875 || packet.udp.len != packet.ip6.ip6_plen 875 || packet.udp.len != packet.ip6.ip6_plen
876 ) { 876 ) {
877 log1("unrelated/bogus packet, ignoring"); 877 log1s("unrelated/bogus packet, ignoring");
878 return -2; 878 return -2;
879 } 879 }
880 880
@@ -1003,7 +1003,7 @@ static int d6_raw_socket(int ifindex)
1003 } 1003 }
1004#endif 1004#endif
1005 1005
1006 log1("created raw socket"); 1006 log1s("created raw socket");
1007 1007
1008 return fd; 1008 return fd;
1009} 1009}
@@ -1031,7 +1031,7 @@ static void change_listen_mode(int new_mode)
1031/* Called only on SIGUSR1 */ 1031/* Called only on SIGUSR1 */
1032static void perform_renew(void) 1032static void perform_renew(void)
1033{ 1033{
1034 bb_info_msg("performing DHCP renew"); 1034 bb_simple_info_msg("performing DHCP renew");
1035 switch (client_data.state) { 1035 switch (client_data.state) {
1036 case BOUND: 1036 case BOUND:
1037 change_listen_mode(LISTEN_KERNEL); 1037 change_listen_mode(LISTEN_KERNEL);
@@ -1059,10 +1059,10 @@ static void perform_d6_release(struct in6_addr *server_ipv6, struct in6_addr *ou
1059 || client_data.state == REBINDING 1059 || client_data.state == REBINDING
1060 || client_data.state == RENEW_REQUESTED 1060 || client_data.state == RENEW_REQUESTED
1061 ) { 1061 ) {
1062 bb_info_msg("unicasting a release"); 1062 bb_simple_info_msg("unicasting a release");
1063 send_d6_release(server_ipv6, our_cur_ipv6); /* unicast */ 1063 send_d6_release(server_ipv6, our_cur_ipv6); /* unicast */
1064 } 1064 }
1065 bb_info_msg("entering released state"); 1065 bb_simple_info_msg("entering released state");
1066/* 1066/*
1067 * We can be here on: SIGUSR2, 1067 * We can be here on: SIGUSR2,
1068 * or on exit (SIGTERM) and -R "release on quit" is specified. 1068 * or on exit (SIGTERM) and -R "release on quit" is specified.
@@ -1275,7 +1275,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1275 /* Create pidfile */ 1275 /* Create pidfile */
1276 write_pidfile(client_data.pidfile); 1276 write_pidfile(client_data.pidfile);
1277 /* Goes to stdout (unless NOMMU) and possibly syslog */ 1277 /* Goes to stdout (unless NOMMU) and possibly syslog */
1278 bb_info_msg("started, v"BB_VER); 1278 bb_simple_info_msg("started, v"BB_VER);
1279 1279
1280 client_data.state = INIT_SELECTING; 1280 client_data.state = INIT_SELECTING;
1281 d6_run_script_no_option("deconfig"); 1281 d6_run_script_no_option("deconfig");
@@ -1321,7 +1321,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1321 continue; 1321 continue;
1322 } 1322 }
1323 /* Else: an error occured, panic! */ 1323 /* Else: an error occured, panic! */
1324 bb_perror_msg_and_die("poll"); 1324 bb_simple_perror_msg_and_die("poll");
1325 } 1325 }
1326 } 1326 }
1327 1327
@@ -1362,7 +1362,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1362 d6_run_script_no_option("leasefail"); 1362 d6_run_script_no_option("leasefail");
1363#if BB_MMU /* -b is not supported on NOMMU */ 1363#if BB_MMU /* -b is not supported on NOMMU */
1364 if (opt & OPT_b) { /* background if no lease */ 1364 if (opt & OPT_b) { /* background if no lease */
1365 bb_info_msg("no lease, forking to background"); 1365 bb_simple_info_msg("no lease, forking to background");
1366 client_background(); 1366 client_background();
1367 /* do not background again! */ 1367 /* do not background again! */
1368 opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f); 1368 opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f);
@@ -1375,7 +1375,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1375 } else 1375 } else
1376#endif 1376#endif
1377 if (opt & OPT_n) { /* abort if no lease */ 1377 if (opt & OPT_n) { /* abort if no lease */
1378 bb_info_msg("no lease, failing"); 1378 bb_simple_info_msg("no lease, failing");
1379 retval = 1; 1379 retval = 1;
1380 goto ret; 1380 goto ret;
1381 } 1381 }
@@ -1403,7 +1403,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1403 client_data.state = RENEWING; 1403 client_data.state = RENEWING;
1404 client_data.first_secs = 0; /* make secs field count from 0 */ 1404 client_data.first_secs = 0; /* make secs field count from 0 */
1405 change_listen_mode(LISTEN_KERNEL); 1405 change_listen_mode(LISTEN_KERNEL);
1406 log1("entering renew state"); 1406 log1s("entering renew state");
1407 /* fall right through */ 1407 /* fall right through */
1408 case RENEW_REQUESTED: /* manual (SIGUSR1) renew */ 1408 case RENEW_REQUESTED: /* manual (SIGUSR1) renew */
1409 case_RENEW_REQUESTED: 1409 case_RENEW_REQUESTED:
@@ -1423,7 +1423,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1423 continue; 1423 continue;
1424 } 1424 }
1425 /* Timed out, enter rebinding state */ 1425 /* Timed out, enter rebinding state */
1426 log1("entering rebinding state"); 1426 log1s("entering rebinding state");
1427 client_data.state = REBINDING; 1427 client_data.state = REBINDING;
1428 /* fall right through */ 1428 /* fall right through */
1429 case REBINDING: 1429 case REBINDING:
@@ -1438,7 +1438,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1438 continue; 1438 continue;
1439 } 1439 }
1440 /* Timed out, enter init state */ 1440 /* Timed out, enter init state */
1441 bb_info_msg("lease lost, entering init state"); 1441 bb_simple_info_msg("lease lost, entering init state");
1442 d6_run_script_no_option("deconfig"); 1442 d6_run_script_no_option("deconfig");
1443 client_data.state = INIT_SELECTING; 1443 client_data.state = INIT_SELECTING;
1444 client_data.first_secs = 0; /* make secs field count from 0 */ 1444 client_data.first_secs = 0; /* make secs field count from 0 */
@@ -1560,7 +1560,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1560 } 1560 }
1561 option = d6_copy_option(packet.d6_options, packet_end, D6_OPT_SERVERID); 1561 option = d6_copy_option(packet.d6_options, packet_end, D6_OPT_SERVERID);
1562 if (!option) { 1562 if (!option) {
1563 bb_info_msg("no server ID, ignoring packet"); 1563 bb_simple_info_msg("no server ID, ignoring packet");
1564 continue; 1564 continue;
1565 /* still selecting - this server looks bad */ 1565 /* still selecting - this server looks bad */
1566 } 1566 }
diff --git a/networking/udhcp/d6_packet.c b/networking/udhcp/d6_packet.c
index 01d1c930b..446497e15 100644
--- a/networking/udhcp/d6_packet.c
+++ b/networking/udhcp/d6_packet.c
@@ -35,12 +35,12 @@ int FAST_FUNC d6_recv_kernel_packet(struct in6_addr *peer_ipv6
35 memset(packet, 0, sizeof(*packet)); 35 memset(packet, 0, sizeof(*packet));
36 bytes = safe_read(fd, packet, sizeof(*packet)); 36 bytes = safe_read(fd, packet, sizeof(*packet));
37 if (bytes < 0) { 37 if (bytes < 0) {
38 log1("packet read error, ignoring"); 38 log1s("packet read error, ignoring");
39 return bytes; /* returns -1 */ 39 return bytes; /* returns -1 */
40 } 40 }
41 41
42 if (bytes < offsetof(struct d6_packet, d6_options)) { 42 if (bytes < offsetof(struct d6_packet, d6_options)) {
43 bb_info_msg("packet with bad magic, ignoring"); 43 bb_simple_info_msg("packet with bad magic, ignoring");
44 return -2; 44 return -2;
45 } 45 }
46 log1("received %s", "a packet"); 46 log1("received %s", "a packet");
diff --git a/networking/udhcp/d6_socket.c b/networking/udhcp/d6_socket.c
index 25e622d6f..8ddee5a8e 100644
--- a/networking/udhcp/d6_socket.c
+++ b/networking/udhcp/d6_socket.c
@@ -115,7 +115,7 @@ int FAST_FUNC d6_listen_socket(int port, const char *inf)
115 115
116 setsockopt_reuseaddr(fd); 116 setsockopt_reuseaddr(fd);
117 if (setsockopt_broadcast(fd) == -1) 117 if (setsockopt_broadcast(fd) == -1)
118 bb_perror_msg_and_die("SO_BROADCAST"); 118 bb_simple_perror_msg_and_die("SO_BROADCAST");
119 119
120 /* NB: bug 1032 says this doesn't work on ethernet aliases (ethN:M) */ 120 /* NB: bug 1032 says this doesn't work on ethernet aliases (ethN:M) */
121 if (setsockopt_bindtodevice(fd, inf)) 121 if (setsockopt_bindtodevice(fd, inf))
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index d1a0eaf02..656295ff7 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -906,7 +906,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
906 if (bytes < 0) { 906 if (bytes < 0) {
907 if (errno == EINTR) 907 if (errno == EINTR)
908 continue; 908 continue;
909 log1("packet read error, ignoring"); 909 log1s("packet read error, ignoring");
910 /* NB: possible down interface, etc. Caller should pause. */ 910 /* NB: possible down interface, etc. Caller should pause. */
911 return bytes; /* returns -1 */ 911 return bytes; /* returns -1 */
912 } 912 }
@@ -914,13 +914,13 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
914 } 914 }
915 915
916 if (bytes < (int) (sizeof(packet.ip) + sizeof(packet.udp))) { 916 if (bytes < (int) (sizeof(packet.ip) + sizeof(packet.udp))) {
917 log1("packet is too short, ignoring"); 917 log1s("packet is too short, ignoring");
918 return -2; 918 return -2;
919 } 919 }
920 920
921 if (bytes < ntohs(packet.ip.tot_len)) { 921 if (bytes < ntohs(packet.ip.tot_len)) {
922 /* packet is bigger than sizeof(packet), we did partial read */ 922 /* packet is bigger than sizeof(packet), we did partial read */
923 log1("oversized packet, ignoring"); 923 log1s("oversized packet, ignoring");
924 return -2; 924 return -2;
925 } 925 }
926 926
@@ -935,7 +935,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
935 /* || bytes > (int) sizeof(packet) - can't happen */ 935 /* || bytes > (int) sizeof(packet) - can't happen */
936 || ntohs(packet.udp.len) != (uint16_t)(bytes - sizeof(packet.ip)) 936 || ntohs(packet.udp.len) != (uint16_t)(bytes - sizeof(packet.ip))
937 ) { 937 ) {
938 log1("unrelated/bogus packet, ignoring"); 938 log1s("unrelated/bogus packet, ignoring");
939 return -2; 939 return -2;
940 } 940 }
941 941
@@ -943,7 +943,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
943 check = packet.ip.check; 943 check = packet.ip.check;
944 packet.ip.check = 0; 944 packet.ip.check = 0;
945 if (check != inet_cksum((uint16_t *)&packet.ip, sizeof(packet.ip))) { 945 if (check != inet_cksum((uint16_t *)&packet.ip, sizeof(packet.ip))) {
946 log1("bad IP header checksum, ignoring"); 946 log1s("bad IP header checksum, ignoring");
947 return -2; 947 return -2;
948 } 948 }
949 949
@@ -968,13 +968,13 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
968 check = packet.udp.check; 968 check = packet.udp.check;
969 packet.udp.check = 0; 969 packet.udp.check = 0;
970 if (check && check != inet_cksum((uint16_t *)&packet, bytes)) { 970 if (check && check != inet_cksum((uint16_t *)&packet, bytes)) {
971 log1("packet with bad UDP checksum received, ignoring"); 971 log1s("packet with bad UDP checksum received, ignoring");
972 return -2; 972 return -2;
973 } 973 }
974 skip_udp_sum_check: 974 skip_udp_sum_check:
975 975
976 if (packet.data.cookie != htonl(DHCP_MAGIC)) { 976 if (packet.data.cookie != htonl(DHCP_MAGIC)) {
977 bb_info_msg("packet with bad magic, ignoring"); 977 bb_simple_info_msg("packet with bad magic, ignoring");
978 return -2; 978 return -2;
979 } 979 }
980 980
@@ -1089,10 +1089,10 @@ static int udhcp_raw_socket(int ifindex)
1089 1089
1090 if (setsockopt_1(fd, SOL_PACKET, PACKET_AUXDATA) != 0) { 1090 if (setsockopt_1(fd, SOL_PACKET, PACKET_AUXDATA) != 0) {
1091 if (errno != ENOPROTOOPT) 1091 if (errno != ENOPROTOOPT)
1092 log1("can't set PACKET_AUXDATA on raw socket"); 1092 log1s("can't set PACKET_AUXDATA on raw socket");
1093 } 1093 }
1094 1094
1095 log1("created raw socket"); 1095 log1s("created raw socket");
1096 1096
1097 return fd; 1097 return fd;
1098} 1098}
@@ -1120,7 +1120,7 @@ static void change_listen_mode(int new_mode)
1120/* Called only on SIGUSR1 */ 1120/* Called only on SIGUSR1 */
1121static void perform_renew(void) 1121static void perform_renew(void)
1122{ 1122{
1123 bb_info_msg("performing DHCP renew"); 1123 bb_simple_info_msg("performing DHCP renew");
1124 switch (client_data.state) { 1124 switch (client_data.state) {
1125 case BOUND: 1125 case BOUND:
1126 change_listen_mode(LISTEN_KERNEL); 1126 change_listen_mode(LISTEN_KERNEL);
@@ -1158,7 +1158,7 @@ static void perform_release(uint32_t server_addr, uint32_t requested_ip)
1158 inet_ntoa(temp_addr), buffer); 1158 inet_ntoa(temp_addr), buffer);
1159 send_release(server_addr, requested_ip); /* unicast */ 1159 send_release(server_addr, requested_ip); /* unicast */
1160 } 1160 }
1161 bb_info_msg("entering released state"); 1161 bb_simple_info_msg("entering released state");
1162/* 1162/*
1163 * We can be here on: SIGUSR2, 1163 * We can be here on: SIGUSR2,
1164 * or on exit (SIGTERM) and -R "release on quit" is specified. 1164 * or on exit (SIGTERM) and -R "release on quit" is specified.
@@ -1303,7 +1303,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1303 ); 1303 );
1304 if (opt & (OPT_h|OPT_H)) { 1304 if (opt & (OPT_h|OPT_H)) {
1305 //msg added 2011-11 1305 //msg added 2011-11
1306 bb_error_msg("option -h NAME is deprecated, use -x hostname:NAME"); 1306 bb_simple_error_msg("option -h NAME is deprecated, use -x hostname:NAME");
1307 client_data.hostname = alloc_dhcp_option(DHCP_HOST_NAME, str_h, 0); 1307 client_data.hostname = alloc_dhcp_option(DHCP_HOST_NAME, str_h, 0);
1308 } 1308 }
1309 if (opt & OPT_F) { 1309 if (opt & OPT_F) {
@@ -1397,7 +1397,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1397 /* Create pidfile */ 1397 /* Create pidfile */
1398 write_pidfile(client_data.pidfile); 1398 write_pidfile(client_data.pidfile);
1399 /* Goes to stdout (unless NOMMU) and possibly syslog */ 1399 /* Goes to stdout (unless NOMMU) and possibly syslog */
1400 bb_info_msg("started, v"BB_VER); 1400 bb_simple_info_msg("started, v"BB_VER);
1401 /* We want random_xid to be random... */ 1401 /* We want random_xid to be random... */
1402 srand(monotonic_us()); 1402 srand(monotonic_us());
1403 1403
@@ -1444,7 +1444,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1444 continue; 1444 continue;
1445 } 1445 }
1446 /* Else: an error occurred, panic! */ 1446 /* Else: an error occurred, panic! */
1447 bb_perror_msg_and_die("poll"); 1447 bb_simple_perror_msg_and_die("poll");
1448 } 1448 }
1449 } 1449 }
1450 1450
@@ -1485,7 +1485,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1485 udhcp_run_script(NULL, "leasefail"); 1485 udhcp_run_script(NULL, "leasefail");
1486#if BB_MMU /* -b is not supported on NOMMU */ 1486#if BB_MMU /* -b is not supported on NOMMU */
1487 if (opt & OPT_b) { /* background if no lease */ 1487 if (opt & OPT_b) { /* background if no lease */
1488 bb_info_msg("no lease, forking to background"); 1488 bb_simple_info_msg("no lease, forking to background");
1489 client_background(); 1489 client_background();
1490 /* do not background again! */ 1490 /* do not background again! */
1491 opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f); 1491 opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f);
@@ -1498,7 +1498,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1498 } else 1498 } else
1499#endif 1499#endif
1500 if (opt & OPT_n) { /* abort if no lease */ 1500 if (opt & OPT_n) { /* abort if no lease */
1501 bb_info_msg("no lease, failing"); 1501 bb_simple_info_msg("no lease, failing");
1502 retval = 1; 1502 retval = 1;
1503 goto ret; 1503 goto ret;
1504 } 1504 }
@@ -1526,7 +1526,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1526 client_data.state = RENEWING; 1526 client_data.state = RENEWING;
1527 client_data.first_secs = 0; /* make secs field count from 0 */ 1527 client_data.first_secs = 0; /* make secs field count from 0 */
1528 change_listen_mode(LISTEN_KERNEL); 1528 change_listen_mode(LISTEN_KERNEL);
1529 log1("entering renew state"); 1529 log1s("entering renew state");
1530 /* fall right through */ 1530 /* fall right through */
1531 case RENEW_REQUESTED: /* manual (SIGUSR1) renew */ 1531 case RENEW_REQUESTED: /* manual (SIGUSR1) renew */
1532 case_RENEW_REQUESTED: 1532 case_RENEW_REQUESTED:
@@ -1559,7 +1559,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1559 */ 1559 */
1560 } 1560 }
1561 /* Timed out or error, enter rebinding state */ 1561 /* Timed out or error, enter rebinding state */
1562 log1("entering rebinding state"); 1562 log1s("entering rebinding state");
1563 client_data.state = REBINDING; 1563 client_data.state = REBINDING;
1564 /* fall right through */ 1564 /* fall right through */
1565 case REBINDING: 1565 case REBINDING:
@@ -1574,7 +1574,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1574 continue; 1574 continue;
1575 } 1575 }
1576 /* Timed out, enter init state */ 1576 /* Timed out, enter init state */
1577 bb_info_msg("lease lost, entering init state"); 1577 bb_simple_info_msg("lease lost, entering init state");
1578 udhcp_run_script(NULL, "deconfig"); 1578 udhcp_run_script(NULL, "deconfig");
1579 client_data.state = INIT_SELECTING; 1579 client_data.state = INIT_SELECTING;
1580 client_data.first_secs = 0; /* make secs field count from 0 */ 1580 client_data.first_secs = 0; /* make secs field count from 0 */
@@ -1660,13 +1660,13 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1660 || memcmp(packet.chaddr, client_data.client_mac, 6) != 0 1660 || memcmp(packet.chaddr, client_data.client_mac, 6) != 0
1661 ) { 1661 ) {
1662//FIXME: need to also check that last 10 bytes are zero 1662//FIXME: need to also check that last 10 bytes are zero
1663 log1("chaddr does not match, ignoring packet"); // log2? 1663 log1("chaddr does not match%s", ", ignoring packet"); // log2?
1664 continue; 1664 continue;
1665 } 1665 }
1666 1666
1667 message = udhcp_get_option(&packet, DHCP_MESSAGE_TYPE); 1667 message = udhcp_get_option(&packet, DHCP_MESSAGE_TYPE);
1668 if (message == NULL) { 1668 if (message == NULL) {
1669 bb_info_msg("no message type option, ignoring packet"); 1669 bb_info_msg("no message type option%s", ", ignoring packet");
1670 continue; 1670 continue;
1671 } 1671 }
1672 1672
@@ -1703,7 +1703,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1703 server_addr = 0; 1703 server_addr = 0;
1704 temp = udhcp_get_option32(&packet, DHCP_SERVER_ID); 1704 temp = udhcp_get_option32(&packet, DHCP_SERVER_ID);
1705 if (!temp) { 1705 if (!temp) {
1706 bb_info_msg("no server ID, using 0.0.0.0"); 1706 bb_simple_info_msg("no server ID, using 0.0.0.0");
1707 } else { 1707 } else {
1708 /* it IS unaligned sometimes, don't "optimize" */ 1708 /* it IS unaligned sometimes, don't "optimize" */
1709 move_from_unaligned32(server_addr, temp); 1709 move_from_unaligned32(server_addr, temp);
@@ -1730,7 +1730,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1730 1730
1731 temp = udhcp_get_option32(&packet, DHCP_LEASE_TIME); 1731 temp = udhcp_get_option32(&packet, DHCP_LEASE_TIME);
1732 if (!temp) { 1732 if (!temp) {
1733 bb_info_msg("no lease time with ACK, using 1 hour lease"); 1733 bb_simple_info_msg("no lease time with ACK, using 1 hour lease");
1734 lease_seconds = 60 * 60; 1734 lease_seconds = 60 * 60;
1735 } else { 1735 } else {
1736 /* it IS unaligned sometimes, don't "optimize" */ 1736 /* it IS unaligned sometimes, don't "optimize" */
@@ -1763,7 +1763,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1763 client_data.interface, 1763 client_data.interface,
1764 arpping_ms) 1764 arpping_ms)
1765 ) { 1765 ) {
1766 bb_info_msg("offered address is in use " 1766 bb_simple_info_msg("offered address is in use "
1767 "(got ARP reply), declining"); 1767 "(got ARP reply), declining");
1768 send_decline(/*xid,*/ server_addr, packet.yiaddr); 1768 send_decline(/*xid,*/ server_addr, packet.yiaddr);
1769 1769
@@ -1827,7 +1827,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1827 if (!temp) { 1827 if (!temp) {
1828 non_matching_svid: 1828 non_matching_svid:
1829 log1("received DHCP NAK with wrong" 1829 log1("received DHCP NAK with wrong"
1830 " server ID, ignoring packet"); 1830 " server ID%s", ", ignoring packet");
1831 continue; 1831 continue;
1832 } 1832 }
1833 move_from_unaligned32(svid, temp); 1833 move_from_unaligned32(svid, temp);
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 022b8721b..3e08ec011 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -582,11 +582,11 @@ static void send_packet_to_client(struct dhcp_packet *dhcp_pkt, int force_broadc
582 || (dhcp_pkt->flags & htons(BROADCAST_FLAG)) 582 || (dhcp_pkt->flags & htons(BROADCAST_FLAG))
583 || dhcp_pkt->ciaddr == 0 583 || dhcp_pkt->ciaddr == 0
584 ) { 584 ) {
585 log1("broadcasting packet to client"); 585 log1s("broadcasting packet to client");
586 ciaddr = INADDR_BROADCAST; 586 ciaddr = INADDR_BROADCAST;
587 chaddr = MAC_BCAST_ADDR; 587 chaddr = MAC_BCAST_ADDR;
588 } else { 588 } else {
589 log1("unicasting packet to client ciaddr"); 589 log1s("unicasting packet to client ciaddr");
590 ciaddr = dhcp_pkt->ciaddr; 590 ciaddr = dhcp_pkt->ciaddr;
591 chaddr = dhcp_pkt->chaddr; 591 chaddr = dhcp_pkt->chaddr;
592 } 592 }
@@ -600,7 +600,7 @@ static void send_packet_to_client(struct dhcp_packet *dhcp_pkt, int force_broadc
600/* Send a packet to gateway_nip using the kernel ip stack */ 600/* Send a packet to gateway_nip using the kernel ip stack */
601static void send_packet_to_relay(struct dhcp_packet *dhcp_pkt) 601static void send_packet_to_relay(struct dhcp_packet *dhcp_pkt)
602{ 602{
603 log1("forwarding packet to relay"); 603 log1s("forwarding packet to relay");
604 604
605 udhcp_send_kernel_packet(dhcp_pkt, 605 udhcp_send_kernel_packet(dhcp_pkt,
606 server_data.server_nip, SERVER_PORT, 606 server_data.server_nip, SERVER_PORT,
@@ -754,7 +754,7 @@ static NOINLINE void send_offer(struct dhcp_packet *oldpacket,
754 } 754 }
755 755
756 if (!packet.yiaddr) { 756 if (!packet.yiaddr) {
757 bb_error_msg("no free IP addresses. OFFER abandoned"); 757 bb_simple_error_msg("no free IP addresses. OFFER abandoned");
758 return; 758 return;
759 } 759 }
760 /* Reserve the IP for a short time hoping to get DHCPREQUEST soon */ 760 /* Reserve the IP for a short time hoping to get DHCPREQUEST soon */
@@ -765,7 +765,7 @@ static NOINLINE void send_offer(struct dhcp_packet *oldpacket,
765 p_host_name ? (unsigned char)p_host_name[OPT_LEN - OPT_DATA] : 0 765 p_host_name ? (unsigned char)p_host_name[OPT_LEN - OPT_DATA] : 0
766 ); 766 );
767 if (!lease) { 767 if (!lease) {
768 bb_error_msg("no free IP addresses. OFFER abandoned"); 768 bb_simple_error_msg("no free IP addresses. OFFER abandoned");
769 return; 769 return;
770 } 770 }
771 } 771 }
@@ -914,7 +914,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
914 write_pidfile(server_data.pidfile); 914 write_pidfile(server_data.pidfile);
915 /* if (!..) bb_perror_msg("can't create pidfile %s", pidfile); */ 915 /* if (!..) bb_perror_msg("can't create pidfile %s", pidfile); */
916 916
917 bb_info_msg("started, v"BB_VER); 917 bb_simple_info_msg("started, v"BB_VER);
918 918
919 option = udhcp_find_option(server_data.options, DHCP_LEASE_TIME); 919 option = udhcp_find_option(server_data.options, DHCP_LEASE_TIME);
920 server_data.max_lease_sec = DEFAULT_LEASE_TIME; 920 server_data.max_lease_sec = DEFAULT_LEASE_TIME;
@@ -985,7 +985,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
985 if (errno == EINTR) 985 if (errno == EINTR)
986 goto new_tv; 986 goto new_tv;
987 /* < 0 and not EINTR: should not happen */ 987 /* < 0 and not EINTR: should not happen */
988 bb_perror_msg_and_die("poll"); 988 bb_simple_perror_msg_and_die("poll");
989 } 989 }
990 990
991 if (pfds[0].revents) switch (udhcp_sp_read()) { 991 if (pfds[0].revents) switch (udhcp_sp_read()) {
@@ -1019,16 +1019,16 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
1019 continue; 1019 continue;
1020 } 1020 }
1021 if (packet.hlen != 6) { 1021 if (packet.hlen != 6) {
1022 bb_info_msg("MAC length != 6, ignoring packet"); 1022 bb_info_msg("MAC length != 6%s", ", ignoring packet");
1023 continue; 1023 continue;
1024 } 1024 }
1025 if (packet.op != BOOTREQUEST) { 1025 if (packet.op != BOOTREQUEST) {
1026 bb_info_msg("not a REQUEST, ignoring packet"); 1026 bb_info_msg("not a REQUEST%s", ", ignoring packet");
1027 continue; 1027 continue;
1028 } 1028 }
1029 state = udhcp_get_option(&packet, DHCP_MESSAGE_TYPE); 1029 state = udhcp_get_option(&packet, DHCP_MESSAGE_TYPE);
1030 if (state == NULL || state[0] < DHCP_MINTYPE || state[0] > DHCP_MAXTYPE) { 1030 if (state == NULL || state[0] < DHCP_MINTYPE || state[0] > DHCP_MAXTYPE) {
1031 bb_info_msg("no or bad message type option, ignoring packet"); 1031 bb_info_msg("no or bad message type option%s", ", ignoring packet");
1032 continue; 1032 continue;
1033 } 1033 }
1034 1034
@@ -1039,7 +1039,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
1039 move_from_unaligned32(server_id_network_order, server_id_opt); 1039 move_from_unaligned32(server_id_network_order, server_id_opt);
1040 if (server_id_network_order != server_data.server_nip) { 1040 if (server_id_network_order != server_data.server_nip) {
1041 /* client talks to somebody else */ 1041 /* client talks to somebody else */
1042 log1("server ID doesn't match, ignoring"); 1042 log1("server ID doesn't match%s", ", ignoring");
1043 continue; 1043 continue;
1044 } 1044 }
1045 } 1045 }
@@ -1162,7 +1162,7 @@ o DHCPREQUEST generated during REBINDING state:
1162 if (!requested_ip_opt) { 1162 if (!requested_ip_opt) {
1163 requested_nip = packet.ciaddr; 1163 requested_nip = packet.ciaddr;
1164 if (requested_nip == 0) { 1164 if (requested_nip == 0) {
1165 log1("no requested IP and no ciaddr, ignoring"); 1165 log1("no requested IP and no ciaddr%s", ", ignoring");
1166 break; 1166 break;
1167 } 1167 }
1168 } 1168 }
diff --git a/networking/udhcp/dhcprelay.c b/networking/udhcp/dhcprelay.c
index 86dcb1af0..ef9447b4b 100644
--- a/networking/udhcp/dhcprelay.c
+++ b/networking/udhcp/dhcprelay.c
@@ -186,7 +186,7 @@ static int sendto_ip4(int sock, const void *msg, int msg_len, struct sockaddr_in
186 err = sendto(sock, msg, msg_len, 0, (struct sockaddr*) to, sizeof(*to)); 186 err = sendto(sock, msg, msg_len, 0, (struct sockaddr*) to, sizeof(*to));
187 err -= msg_len; 187 err -= msg_len;
188 if (err) 188 if (err)
189 bb_perror_msg("sendto"); 189 bb_simple_perror_msg("sendto");
190 return err; 190 return err;
191} 191}
192 192
@@ -273,7 +273,7 @@ int dhcprelay_main(int argc UNUSED_PARAM, char **argv)
273 bb_show_usage(); 273 bb_show_usage();
274 if (argv[3]) { 274 if (argv[3]) {
275 if (!inet_aton(argv[3], &server_addr.sin_addr)) 275 if (!inet_aton(argv[3], &server_addr.sin_addr))
276 bb_perror_msg_and_die("bad server IP"); 276 bb_simple_perror_msg_and_die("bad server IP");
277 } 277 }
278 278
279 iface_list = make_iface_list(argv + 1, &num_sockets); 279 iface_list = make_iface_list(argv + 1, &num_sockets);
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 64af802a3..6d4375237 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -85,14 +85,14 @@ int FAST_FUNC udhcp_recv_kernel_packet(struct dhcp_packet *packet, int fd)
85 memset(packet, 0, sizeof(*packet)); 85 memset(packet, 0, sizeof(*packet));
86 bytes = safe_read(fd, packet, sizeof(*packet)); 86 bytes = safe_read(fd, packet, sizeof(*packet));
87 if (bytes < 0) { 87 if (bytes < 0) {
88 log1("packet read error, ignoring"); 88 log1s("packet read error, ignoring");
89 return bytes; /* returns -1 */ 89 return bytes; /* returns -1 */
90 } 90 }
91 91
92 if (bytes < offsetof(struct dhcp_packet, options) 92 if (bytes < offsetof(struct dhcp_packet, options)
93 || packet->cookie != htonl(DHCP_MAGIC) 93 || packet->cookie != htonl(DHCP_MAGIC)
94 ) { 94 ) {
95 bb_info_msg("packet with bad magic, ignoring"); 95 bb_simple_info_msg("packet with bad magic, ignoring");
96 return -2; 96 return -2;
97 } 97 }
98 log1("received %s", "a packet"); 98 log1("received %s", "a packet");
diff --git a/networking/udhcp/signalpipe.c b/networking/udhcp/signalpipe.c
index 81d1fc01a..7df671245 100644
--- a/networking/udhcp/signalpipe.c
+++ b/networking/udhcp/signalpipe.c
@@ -28,7 +28,7 @@ static void signal_handler(int sig)
28 int sv = errno; 28 int sv = errno;
29 unsigned char ch = sig; /* use char, avoid dealing with partial writes */ 29 unsigned char ch = sig; /* use char, avoid dealing with partial writes */
30 if (write(WRITE_FD, &ch, 1) != 1) 30 if (write(WRITE_FD, &ch, 1) != 1)
31 bb_perror_msg("can't send signal"); 31 bb_simple_perror_msg("can't send signal");
32 errno = sv; 32 errno = sv;
33} 33}
34 34
diff --git a/networking/udhcp/socket.c b/networking/udhcp/socket.c
index 34049c3ee..65a1a8ead 100644
--- a/networking/udhcp/socket.c
+++ b/networking/udhcp/socket.c
@@ -87,7 +87,7 @@ int FAST_FUNC udhcp_listen_socket(/*uint32_t ip,*/ int port, const char *inf)
87 87
88 setsockopt_reuseaddr(fd); 88 setsockopt_reuseaddr(fd);
89 if (setsockopt_broadcast(fd) == -1) 89 if (setsockopt_broadcast(fd) == -1)
90 bb_perror_msg_and_die("SO_BROADCAST"); 90 bb_simple_perror_msg_and_die("SO_BROADCAST");
91 91
92 /* SO_BINDTODEVICE doesn't work on ethernet aliases (ethN:M) */ 92 /* SO_BINDTODEVICE doesn't work on ethernet aliases (ethN:M) */
93 colon = strrchr(inf, ':'); 93 colon = strrchr(inf, ':');
diff --git a/networking/wget.c b/networking/wget.c
index b6f9d605a..9e5a40b6f 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -368,7 +368,7 @@ static void alarm_handler(int sig UNUSED_PARAM)
368{ 368{
369 /* This is theoretically unsafe (uses stdio and malloc in signal handler) */ 369 /* This is theoretically unsafe (uses stdio and malloc in signal handler) */
370 if (G.die_if_timed_out) 370 if (G.die_if_timed_out)
371 bb_error_msg_and_die("download timed out"); 371 bb_simple_error_msg_and_die("download timed out");
372} 372}
373static void set_alarm(void) 373static void set_alarm(void)
374{ 374{
@@ -452,7 +452,7 @@ static char fgets_trim_sanitize(FILE *fp, const char *fmt)
452 452
453 set_alarm(); 453 set_alarm();
454 if (fgets(G.wget_buf, sizeof(G.wget_buf), fp) == NULL) 454 if (fgets(G.wget_buf, sizeof(G.wget_buf), fp) == NULL)
455 bb_perror_msg_and_die("error getting response"); 455 bb_simple_perror_msg_and_die("error getting response");
456 clear_alarm(); 456 clear_alarm();
457 457
458 buf_ptr = strchrnul(G.wget_buf, '\n'); 458 buf_ptr = strchrnul(G.wget_buf, '\n');
@@ -633,7 +633,7 @@ static char *get_sanitized_hdr(FILE *fp)
633 633
634static void reset_beg_range_to_zero(void) 634static void reset_beg_range_to_zero(void)
635{ 635{
636 bb_error_msg("restart failed"); 636 bb_simple_error_msg("restart failed");
637 G.beg_range = 0; 637 G.beg_range = 0;
638 xlseek(G.output_fd, 0, SEEK_SET); 638 xlseek(G.output_fd, 0, SEEK_SET);
639 /* Done at the end instead: */ 639 /* Done at the end instead: */
@@ -651,7 +651,7 @@ static int spawn_https_helper_openssl(const char *host, unsigned port)
651 651
652 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) != 0) 652 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) != 0)
653 /* Kernel can have AF_UNIX support disabled */ 653 /* Kernel can have AF_UNIX support disabled */
654 bb_perror_msg_and_die("socketpair"); 654 bb_simple_perror_msg_and_die("socketpair");
655 655
656 if (!strchr(host, ':')) 656 if (!strchr(host, ':'))
657 host = allocated = xasprintf("%s:%u", host, port); 657 host = allocated = xasprintf("%s:%u", host, port);
@@ -724,7 +724,7 @@ static void spawn_ssl_client(const char *host, int network_fd, int flags)
724 724
725 if (!(option_mask32 & WGET_OPT_NO_CHECK_CERT)) { 725 if (!(option_mask32 & WGET_OPT_NO_CHECK_CERT)) {
726 option_mask32 |= WGET_OPT_NO_CHECK_CERT; 726 option_mask32 |= WGET_OPT_NO_CHECK_CERT;
727 bb_error_msg("note: TLS certificate validation not implemented"); 727 bb_simple_error_msg("note: TLS certificate validation not implemented");
728 } 728 }
729 729
730 servername = xstrdup(host); 730 servername = xstrdup(host);
@@ -733,7 +733,7 @@ static void spawn_ssl_client(const char *host, int network_fd, int flags)
733 733
734 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) != 0) 734 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) != 0)
735 /* Kernel can have AF_UNIX support disabled */ 735 /* Kernel can have AF_UNIX support disabled */
736 bb_perror_msg_and_die("socketpair"); 736 bb_simple_perror_msg_and_die("socketpair");
737 737
738 fflush_all(); 738 fflush_all();
739 pid = BB_MMU ? xfork() : xvfork(); 739 pid = BB_MMU ? xfork() : xvfork();
@@ -785,7 +785,7 @@ static FILE* prepare_ftp_session(FILE **dfpp, struct host_info *target, len_and_
785#endif 785#endif
786 786
787 if (ftpcmd(NULL, NULL, sfp) != 220) 787 if (ftpcmd(NULL, NULL, sfp) != 220)
788 bb_error_msg_and_die("%s", G.wget_buf); 788 bb_simple_error_msg_and_die(G.wget_buf);
789 /* note: ftpcmd() sanitizes G.wget_buf, ok to print */ 789 /* note: ftpcmd() sanitizes G.wget_buf, ok to print */
790 790
791 /* Split username:password pair */ 791 /* Split username:password pair */
@@ -948,7 +948,7 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
948 if (errno != EAGAIN) { 948 if (errno != EAGAIN) {
949 if (ferror(dfp)) { 949 if (ferror(dfp)) {
950 progress_meter(PROGRESS_END); 950 progress_meter(PROGRESS_END);
951 bb_perror_msg_and_die(bb_msg_read_error); 951 bb_simple_perror_msg_and_die(bb_msg_read_error);
952 } 952 }
953 break; /* EOF, not error */ 953 break; /* EOF, not error */
954 } 954 }
@@ -961,7 +961,7 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
961# if ENABLE_FEATURE_WGET_TIMEOUT 961# if ENABLE_FEATURE_WGET_TIMEOUT
962 if (second_cnt != 0 && --second_cnt == 0) { 962 if (second_cnt != 0 && --second_cnt == 0) {
963 progress_meter(PROGRESS_END); 963 progress_meter(PROGRESS_END);
964 bb_error_msg_and_die("download timed out"); 964 bb_simple_error_msg_and_die("download timed out");
965 } 965 }
966# endif 966# endif
967 /* We used to loop back to poll here, 967 /* We used to loop back to poll here,
@@ -1014,7 +1014,7 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
1014 G.got_clen = 1; /* makes it show 100% even for download of (formerly) unknown size */ 1014 G.got_clen = 1; /* makes it show 100% even for download of (formerly) unknown size */
1015 progress_meter(PROGRESS_END); 1015 progress_meter(PROGRESS_END);
1016 if (G.content_len != 0) { 1016 if (G.content_len != 0) {
1017 bb_perror_msg_and_die("connection closed prematurely"); 1017 bb_simple_perror_msg_and_die("connection closed prematurely");
1018 /* GNU wget says "DATE TIME (NN MB/s) - Connection closed at byte NNN. Retrying." */ 1018 /* GNU wget says "DATE TIME (NN MB/s) - Connection closed at byte NNN. Retrying." */
1019 } 1019 }
1020 1020
@@ -1348,7 +1348,7 @@ However, in real world it was observed that some web servers
1348 } 1348 }
1349 if (key == KEY_location && status >= 300) { 1349 if (key == KEY_location && status >= 300) {
1350 if (--redir_limit == 0) 1350 if (--redir_limit == 0)
1351 bb_error_msg_and_die("too many redirections"); 1351 bb_simple_error_msg_and_die("too many redirections");
1352 fclose(sfp); 1352 fclose(sfp);
1353 if (str[0] == '/') { 1353 if (str[0] == '/') {
1354 free(redirected_path); 1354 free(redirected_path);
diff --git a/networking/zcip.c b/networking/zcip.c
index f95b6f7fb..134dfb2df 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -276,7 +276,7 @@ int zcip_main(int argc UNUSED_PARAM, char **argv)
276 if (inet_aton(l_opt, &net) == 0 276 if (inet_aton(l_opt, &net) == 0
277 || (net.s_addr & htonl(IN_CLASSB_NET)) != net.s_addr 277 || (net.s_addr & htonl(IN_CLASSB_NET)) != net.s_addr
278 ) { 278 ) {
279 bb_error_msg_and_die("invalid network address"); 279 bb_simple_error_msg_and_die("invalid network address");
280 } 280 }
281 G.localnet_ip = ntohl(net.s_addr); 281 G.localnet_ip = ntohl(net.s_addr);
282 } 282 }
@@ -285,7 +285,7 @@ int zcip_main(int argc UNUSED_PARAM, char **argv)
285 if (inet_aton(r_opt, &ip) == 0 285 if (inet_aton(r_opt, &ip) == 0
286 || (ntohl(ip.s_addr) & IN_CLASSB_NET) != G.localnet_ip 286 || (ntohl(ip.s_addr) & IN_CLASSB_NET) != G.localnet_ip
287 ) { 287 ) {
288 bb_error_msg_and_die("invalid link address"); 288 bb_simple_error_msg_and_die("invalid link address");
289 } 289 }
290 chosen_nip = ip.s_addr; 290 chosen_nip = ip.s_addr;
291 } 291 }
@@ -473,7 +473,7 @@ int zcip_main(int argc UNUSED_PARAM, char **argv)
473 473
474 // Read ARP packet 474 // Read ARP packet
475 if (safe_read(sock_fd, &p, sizeof(p)) < 0) { 475 if (safe_read(sock_fd, &p, sizeof(p)) < 0) {
476 bb_perror_msg_and_die(bb_msg_read_error); 476 bb_simple_perror_msg_and_die(bb_msg_read_error);
477 } 477 }
478 478
479 if (p.eth.ether_type != htons(ETHERTYPE_ARP)) 479 if (p.eth.ether_type != htons(ETHERTYPE_ARP))