aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Byrne <james.byrne@origamienergy.com>2019-04-12 17:01:51 +0000
committerDenys Vlasenko <vda.linux@googlemail.com>2019-04-30 10:51:27 +0200
commit253c4e787a799a3e1f92957ed791b5222f8d2f64 (patch)
tree36204e05aaaf2cdcbd89eaadeff0193f99b063bf
parentf3a064f4956e113978e74486300dcd1e3e044efa (diff)
downloadbusybox-w32-253c4e787a799a3e1f92957ed791b5222f8d2f64.tar.gz
busybox-w32-253c4e787a799a3e1f92957ed791b5222f8d2f64.tar.bz2
busybox-w32-253c4e787a799a3e1f92957ed791b5222f8d2f64.zip
Optionally re-introduce bb_info_msg()
Between Busybox 1.24.2 and 1.25.0 the bb_info_msg() function was eliminated and calls to it changed to be bb_error_msg(). The downside of this is that daemons now log all messages to syslog at the LOG_ERR level which makes it hard to filter errors from informational messages. This change optionally re-introduces bb_info_msg(), controlled by a new option FEATURE_SYSLOG_INFO, restores all the calls to bb_info_msg() that were removed (only in applets that set logmode to LOGMODE_SYSLOG or LOGMODE_BOTH), and also changes informational messages in ifplugd and ntpd. The code size change of this is as follows (using 'defconfig' on x86_64 with gcc 7.3.0-27ubuntu1~18.04) function old new delta bb_info_msg - 182 +182 bb_vinfo_msg - 27 +27 static.log7 194 198 +4 log8 190 191 +1 log5 190 191 +1 crondlog 45 - -45 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 3/0 up/down: 215/-45) Total: 170 bytes If you don't care about everything being logged at LOG_ERR level then when FEATURE_SYSLOG_INFO is disabled Busybox actually gets smaller: function old new delta static.log7 194 200 +6 log8 190 193 +3 log5 190 193 +3 syslog_level 1 - -1 bb_verror_msg 583 581 -2 crondlog 45 - -45 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 3/1 up/down: 12/-48) Total: -36 bytes Signed-off-by: James Byrne <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--Config.in9
-rw-r--r--include/libbb.h9
-rw-r--r--libbb/verror_msg.c22
-rw-r--r--loginutils/chpasswd.c2
-rw-r--r--loginutils/passwd.c2
-rw-r--r--loginutils/sulogin.c6
-rw-r--r--miscutils/crond.c6
-rw-r--r--miscutils/devfsd.c2
-rw-r--r--networking/dnsd.c10
-rw-r--r--networking/ifplugd.c20
-rw-r--r--networking/ntpd.c4
-rw-r--r--networking/tftp.c2
-rw-r--r--networking/udhcp/common.c2
-rw-r--r--networking/udhcp/common.h6
-rw-r--r--networking/udhcp/d6_dhcpc.c49
-rw-r--r--networking/udhcp/d6_packet.c4
-rw-r--r--networking/udhcp/dhcpc.c42
-rw-r--r--networking/udhcp/dhcpd.c22
-rw-r--r--networking/udhcp/packet.c6
-rw-r--r--networking/zcip.c4
20 files changed, 130 insertions, 99 deletions
diff --git a/Config.in b/Config.in
index 1a44c5b6d..1a726f043 100644
--- a/Config.in
+++ b/Config.in
@@ -339,6 +339,15 @@ config FEATURE_CLEAN_UP
339 Don't enable this unless you have a really good reason to clean 339 Don't enable this unless you have a really good reason to clean
340 things up manually. 340 things up manually.
341 341
342config FEATURE_SYSLOG_INFO
343 bool "Support LOG_INFO level syslog messages"
344 default y
345 depends on FEATURE_SYSLOG
346 help
347 Applets which send their output to syslog use either LOG_INFO or
348 LOG_ERR log levels, but by disabling this option all messages will
349 be logged at the LOG_ERR level, saving just under 200 bytes.
350
342# These are auto-selected by other options 351# These are auto-selected by other options
343 352
344config FEATURE_SYSLOG 353config FEATURE_SYSLOG
diff --git a/include/libbb.h b/include/libbb.h
index a20d5e403..57cfce385 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1316,7 +1316,6 @@ enum {
1316 LOGMODE_BOTH = LOGMODE_SYSLOG + LOGMODE_STDIO, 1316 LOGMODE_BOTH = LOGMODE_SYSLOG + LOGMODE_STDIO,
1317}; 1317};
1318extern const char *msg_eol; 1318extern const char *msg_eol;
1319extern smallint syslog_level;
1320extern smallint logmode; 1319extern smallint logmode;
1321extern uint8_t xfunc_error_retval; 1320extern uint8_t xfunc_error_retval;
1322extern void (*die_func)(void); 1321extern void (*die_func)(void);
@@ -1336,6 +1335,14 @@ void bb_verror_msg(const char *s, va_list p, const char *strerr) FAST_FUNC;
1336void bb_die_memory_exhausted(void) NORETURN FAST_FUNC; 1335void bb_die_memory_exhausted(void) NORETURN FAST_FUNC;
1337void bb_logenv_override(void) FAST_FUNC; 1336void bb_logenv_override(void) FAST_FUNC;
1338 1337
1338#if ENABLE_FEATURE_SYSLOG_INFO
1339void bb_info_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
1340void bb_vinfo_msg(const char *s, va_list p) FAST_FUNC;
1341#else
1342#define bb_info_msg bb_error_msg
1343#define bb_vinfo_msg(s,p) bb_verror_msg(s,p,NULL)
1344#endif
1345
1339/* We need to export XXX_main from libbusybox 1346/* We need to export XXX_main from libbusybox
1340 * only if we build "individual" binaries 1347 * only if we build "individual" binaries
1341 */ 1348 */
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c
index 22c30357b..6d3459905 100644
--- a/libbb/verror_msg.c
+++ b/libbb/verror_msg.c
@@ -12,7 +12,7 @@
12#endif 12#endif
13 13
14#if ENABLE_FEATURE_SYSLOG 14#if ENABLE_FEATURE_SYSLOG
15smallint syslog_level = LOG_ERR; 15static smallint syslog_level = LOG_ERR;
16#endif 16#endif
17smallint logmode = LOGMODE_STDIO; 17smallint logmode = LOGMODE_STDIO;
18const char *msg_eol = "\n"; 18const char *msg_eol = "\n";
@@ -154,7 +154,7 @@ void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr)
154 } 154 }
155# if ENABLE_FEATURE_SYSLOG 155# if ENABLE_FEATURE_SYSLOG
156 if (logmode & LOGMODE_SYSLOG) { 156 if (logmode & LOGMODE_SYSLOG) {
157 syslog(LOG_ERR, "%s", msgc); 157 syslog(syslog_level, "%s", msgc);
158 } 158 }
159# endif 159# endif
160 free(msgc); 160 free(msgc);
@@ -180,3 +180,21 @@ void FAST_FUNC bb_error_msg(const char *s, ...)
180 bb_verror_msg(s, p, NULL); 180 bb_verror_msg(s, p, NULL);
181 va_end(p); 181 va_end(p);
182} 182}
183
184#if ENABLE_FEATURE_SYSLOG_INFO
185void FAST_FUNC bb_vinfo_msg(const char *s, va_list p)
186{
187 syslog_level = LOG_INFO;
188 bb_verror_msg(s, p, NULL);
189 syslog_level = LOG_ERR;
190}
191
192void FAST_FUNC bb_info_msg(const char *s, ...)
193{
194 va_list p;
195
196 va_start(p, s);
197 bb_vinfo_msg(s, p);
198 va_end(p);
199}
200#endif
diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c
index 4b3602e7a..dd0532c66 100644
--- a/loginutils/chpasswd.c
+++ b/loginutils/chpasswd.c
@@ -114,7 +114,7 @@ int chpasswd_main(int argc UNUSED_PARAM, char **argv)
114 if (rc < 0) 114 if (rc < 0)
115 bb_error_msg_and_die("an error occurred updating password for %s", name); 115 bb_error_msg_and_die("an error occurred updating password for %s", name);
116 if (rc) 116 if (rc)
117 bb_error_msg("password for '%s' changed", name); 117 bb_info_msg("password for '%s' changed", name);
118 logmode = LOGMODE_STDIO; 118 logmode = LOGMODE_STDIO;
119 free(name); 119 free(name);
120 free(free_me); 120 free(free_me);
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index 30e096460..6c643d3d0 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -228,7 +228,7 @@ int passwd_main(int argc UNUSED_PARAM, char **argv)
228 /* LOGMODE_BOTH */ 228 /* LOGMODE_BOTH */
229 if (rc < 0) 229 if (rc < 0)
230 bb_error_msg_and_die("can't update password file %s", filename); 230 bb_error_msg_and_die("can't update password file %s", filename);
231 bb_error_msg("password for %s changed by %s", name, myname); 231 bb_info_msg("password for %s changed by %s", name, myname);
232 232
233 /*if (ENABLE_FEATURE_CLEAN_UP) free(newp); - can't, it may be non-malloced */ 233 /*if (ENABLE_FEATURE_CLEAN_UP) free(newp); - can't, it may be non-malloced */
234 skip: 234 skip:
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 27ea5dff0..9bb4d3613 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -68,17 +68,17 @@ int sulogin_main(int argc UNUSED_PARAM, char **argv)
68 ); 68 );
69 if (r < 0) { 69 if (r < 0) {
70 /* ^D, ^C, timeout, or read error */ 70 /* ^D, ^C, timeout, or read error */
71 bb_error_msg("normal startup"); 71 bb_info_msg("normal startup");
72 return 0; 72 return 0;
73 } 73 }
74 if (r > 0) { 74 if (r > 0) {
75 break; 75 break;
76 } 76 }
77 bb_do_delay(LOGIN_FAIL_DELAY); 77 bb_do_delay(LOGIN_FAIL_DELAY);
78 bb_error_msg("Login incorrect"); 78 bb_info_msg("Login incorrect");
79 } 79 }
80 80
81 bb_error_msg("starting shell for system maintenance"); 81 bb_info_msg("starting shell for system maintenance");
82 82
83 IF_SELINUX(renew_current_security_context()); 83 IF_SELINUX(renew_current_security_context());
84 84
diff --git a/miscutils/crond.c b/miscutils/crond.c
index 25e5503c7..b533a3991 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -181,9 +181,7 @@ static void crondlog(unsigned level, const char *msg, va_list va)
181 * need not touch syslog_level 181 * need not touch syslog_level
182 * (they are ok with LOG_ERR default). 182 * (they are ok with LOG_ERR default).
183 */ 183 */
184 syslog_level = LOG_INFO; 184 bb_vinfo_msg(msg, va);
185 bb_verror_msg(msg, va, /* strerr: */ NULL);
186 syslog_level = LOG_ERR;
187 } 185 }
188} 186}
189 187
@@ -1108,7 +1106,7 @@ int crond_main(int argc UNUSED_PARAM, char **argv)
1108 process_cron_update_file(); 1106 process_cron_update_file();
1109 log5("wakeup dt=%ld", dt); 1107 log5("wakeup dt=%ld", dt);
1110 if (dt < -60 * 60 || dt > 60 * 60) { 1108 if (dt < -60 * 60 || dt > 60 * 60) {
1111 bb_error_msg("time disparity of %ld minutes detected", dt / 60); 1109 bb_info_msg("time disparity of %ld minutes detected", dt / 60);
1112 /* and we do not run any jobs in this case */ 1110 /* and we do not run any jobs in this case */
1113 } else if (dt > 0) { 1111 } else if (dt > 0) {
1114 /* Usual case: time advances forward, as expected */ 1112 /* Usual case: time advances forward, as expected */
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c
index 3bf06b965..e4d104d0c 100644
--- a/miscutils/devfsd.c
+++ b/miscutils/devfsd.c
@@ -343,7 +343,7 @@ static const char bb_msg_variable_not_found[] ALIGN1 = "variable: %s not found";
343 343
344/* Busybox stuff */ 344/* Busybox stuff */
345#if ENABLE_DEVFSD_VERBOSE || ENABLE_DEBUG 345#if ENABLE_DEVFSD_VERBOSE || ENABLE_DEBUG
346#define info_logger(p, fmt, args...) bb_error_msg(fmt, ## args) 346#define info_logger(p, fmt, args...) bb_info_msg(fmt, ## args)
347#define msg_logger(p, fmt, args...) bb_error_msg(fmt, ## args) 347#define msg_logger(p, fmt, args...) bb_error_msg(fmt, ## args)
348#define msg_logger_and_die(p, fmt, args...) bb_error_msg_and_die(fmt, ## args) 348#define msg_logger_and_die(p, fmt, args...) bb_error_msg_and_die(fmt, ## args)
349#define error_logger(p, fmt, args...) bb_perror_msg(fmt, ## args) 349#define error_logger(p, fmt, args...) bb_perror_msg(fmt, ## args)
diff --git a/networking/dnsd.c b/networking/dnsd.c
index 37a80309d..f2c6bddc6 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -133,7 +133,7 @@ static struct dns_entry *parse_conf_file(const char *fileconf)
133 } 133 }
134 134
135 if (OPT_verbose) 135 if (OPT_verbose)
136 bb_error_msg("name:%s, ip:%s", token[0], token[1]); 136 bb_info_msg("name:%s, ip:%s", token[0], token[1]);
137 137
138 /* sizeof(*m) includes 1 byte for m->name[0] */ 138 /* sizeof(*m) includes 1 byte for m->name[0] */
139 m = xzalloc(sizeof(*m) + strlen(token[0]) + 1); 139 m = xzalloc(sizeof(*m) + strlen(token[0]) + 1);
@@ -438,7 +438,7 @@ static int process_packet(struct dns_entry *conf_data,
438 answstr = table_lookup(conf_data, type, query_string); 438 answstr = table_lookup(conf_data, type, query_string);
439#if DEBUG 439#if DEBUG
440 /* Shows lengths instead of dots, unusable for !DEBUG */ 440 /* Shows lengths instead of dots, unusable for !DEBUG */
441 bb_error_msg("'%s'->'%s'", query_string, answstr); 441 bb_info_msg("'%s'->'%s'", query_string, answstr);
442#endif 442#endif
443 outr_rlen = 4; 443 outr_rlen = 4;
444 if (answstr && type == htons(REQ_PTR)) { 444 if (answstr && type == htons(REQ_PTR)) {
@@ -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_error_msg("returning positive reply"); 477 bb_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);
@@ -539,7 +539,7 @@ int dnsd_main(int argc UNUSED_PARAM, char **argv)
539 539
540 { 540 {
541 char *p = xmalloc_sockaddr2dotted(&lsa->u.sa); 541 char *p = xmalloc_sockaddr2dotted(&lsa->u.sa);
542 bb_error_msg("accepting UDP packets on %s", p); 542 bb_info_msg("accepting UDP packets on %s", p);
543 free(p); 543 free(p);
544 } 544 }
545 545
@@ -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_error_msg("got UDP packet"); 560 bb_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/ifplugd.c b/networking/ifplugd.c
index 026ff1cc8..1426709cb 100644
--- a/networking/ifplugd.c
+++ b/networking/ifplugd.c
@@ -326,7 +326,7 @@ static int run_script(const char *action)
326 char *argv[5]; 326 char *argv[5];
327 int r; 327 int r;
328 328
329 bb_error_msg("executing '%s %s %s'", G.script_name, G.iface, action); 329 bb_info_msg("executing '%s %s %s'", G.script_name, G.iface, action);
330 330
331 argv[0] = (char*) G.script_name; 331 argv[0] = (char*) G.script_name;
332 argv[1] = (char*) G.iface; 332 argv[1] = (char*) G.iface;
@@ -345,7 +345,7 @@ static int run_script(const char *action)
345 bb_unsetenv_and_free(env_PREVIOUS); 345 bb_unsetenv_and_free(env_PREVIOUS);
346 bb_unsetenv_and_free(env_CURRENT); 346 bb_unsetenv_and_free(env_CURRENT);
347 347
348 bb_error_msg("exit code: %d", r & 0xff); 348 bb_info_msg("exit code: %d", r & 0xff);
349 return (option_mask32 & FLAG_IGNORE_RETVAL) ? 0 : r; 349 return (option_mask32 & FLAG_IGNORE_RETVAL) ? 0 : r;
350} 350}
351 351
@@ -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_error_msg("upping interface"); 368 bb_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();
@@ -414,7 +414,7 @@ static void maybe_up_new_iface(void)
414 (uint8_t)(ifrequest.ifr_hwaddr.sa_data[5])); 414 (uint8_t)(ifrequest.ifr_hwaddr.sa_data[5]));
415 } 415 }
416 416
417 bb_error_msg("using interface %s%s with driver<%s> (version: %s)", 417 bb_info_msg("using interface %s%s with driver<%s> (version: %s)",
418 G.iface, buf, driver_info.driver, driver_info.version); 418 G.iface, buf, driver_info.driver, driver_info.version);
419 } 419 }
420#endif 420#endif
@@ -447,7 +447,7 @@ static smallint detect_link(void)
447 logmode = sv_logmode; 447 logmode = sv_logmode;
448 if (status != IFSTATUS_ERR) { 448 if (status != IFSTATUS_ERR) {
449 G.api_method_num = i; 449 G.api_method_num = i;
450 bb_error_msg("using %s detection mode", method_table[i].name); 450 bb_info_msg("using %s detection mode", method_table[i].name);
451 break; 451 break;
452 } 452 }
453 } 453 }
@@ -632,7 +632,7 @@ int ifplugd_main(int argc UNUSED_PARAM, char **argv)
632 /* | (1 << SIGCHLD) - run_script does not use it anymore */ 632 /* | (1 << SIGCHLD) - run_script does not use it anymore */
633 , record_signo); 633 , record_signo);
634 634
635 bb_error_msg("started: %s", bb_banner); 635 bb_info_msg("started: %s", bb_banner);
636 636
637 if (opts & FLAG_MONITOR) { 637 if (opts & FLAG_MONITOR) {
638 struct ifreq ifrequest; 638 struct ifreq ifrequest;
@@ -649,7 +649,7 @@ int ifplugd_main(int argc UNUSED_PARAM, char **argv)
649 iface_status_str = strstatus(iface_status); 649 iface_status_str = strstatus(iface_status);
650 650
651 if (opts & FLAG_MONITOR) { 651 if (opts & FLAG_MONITOR) {
652 bb_error_msg("interface %s", 652 bb_info_msg("interface %s",
653 G.iface_exists ? "exists" 653 G.iface_exists ? "exists"
654 : "doesn't exist, waiting"); 654 : "doesn't exist, waiting");
655 } 655 }
@@ -657,7 +657,7 @@ int ifplugd_main(int argc UNUSED_PARAM, char **argv)
657 * by potentially lying that it really exists */ 657 * by potentially lying that it really exists */
658 658
659 if (G.iface_exists) { 659 if (G.iface_exists) {
660 bb_error_msg("link is %s", iface_status_str); 660 bb_info_msg("link is %s", iface_status_str);
661 } 661 }
662 662
663 if ((!(opts & FLAG_NO_STARTUP) 663 if ((!(opts & FLAG_NO_STARTUP)
@@ -712,7 +712,7 @@ int ifplugd_main(int argc UNUSED_PARAM, char **argv)
712 if (G.iface_exists < 0) /* error */ 712 if (G.iface_exists < 0) /* error */
713 goto exiting; 713 goto exiting;
714 if (iface_exists_old != G.iface_exists) { 714 if (iface_exists_old != G.iface_exists) {
715 bb_error_msg("interface %sappeared", 715 bb_info_msg("interface %sappeared",
716 G.iface_exists ? "" : "dis"); 716 G.iface_exists ? "" : "dis");
717 if (G.iface_exists) 717 if (G.iface_exists)
718 maybe_up_new_iface(); 718 maybe_up_new_iface();
@@ -730,7 +730,7 @@ int ifplugd_main(int argc UNUSED_PARAM, char **argv)
730 iface_status_str = strstatus(iface_status); 730 iface_status_str = strstatus(iface_status);
731 731
732 if (iface_status_old != iface_status) { 732 if (iface_status_old != iface_status) {
733 bb_error_msg("link is %s", iface_status_str); 733 bb_info_msg("link is %s", iface_status_str);
734 734
735 if (delay_time) { 735 if (delay_time) {
736 /* link restored its old status before 736 /* link restored its old status before
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 027cfe783..cd6da2b38 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -1130,7 +1130,7 @@ step_time(double offset)
1130 } 1130 }
1131 tval = tvn.tv_sec; 1131 tval = tvn.tv_sec;
1132 strftime_YYYYMMDDHHMMSS(buf, sizeof(buf), &tval); 1132 strftime_YYYYMMDDHHMMSS(buf, sizeof(buf), &tval);
1133 bb_error_msg("setting time to %s.%06u (offset %+fs)", buf, (unsigned)tvn.tv_usec, offset); 1133 bb_info_msg("setting time to %s.%06u (offset %+fs)", buf, (unsigned)tvn.tv_usec, offset);
1134 //maybe? G.FREQHOLD_cnt = 0; 1134 //maybe? G.FREQHOLD_cnt = 0;
1135 1135
1136 /* Correct various fields which contain time-relative values: */ 1136 /* Correct various fields which contain time-relative values: */
@@ -2132,7 +2132,7 @@ recv_and_process_peer_pkt(peer_t *p)
2132 2132
2133 p->reachable_bits |= 1; 2133 p->reachable_bits |= 1;
2134 if ((MAX_VERBOSE && G.verbose) || (option_mask32 & OPT_w)) { 2134 if ((MAX_VERBOSE && G.verbose) || (option_mask32 & OPT_w)) {
2135 bb_error_msg("reply from %s: offset:%+f delay:%f status:0x%02x strat:%d refid:0x%08x rootdelay:%f reach:0x%02x", 2135 bb_info_msg("reply from %s: offset:%+f delay:%f status:0x%02x strat:%d refid:0x%08x rootdelay:%f reach:0x%02x",
2136 p->p_dotted, 2136 p->p_dotted,
2137 offset, 2137 offset,
2138 p->p_raw_delay, 2138 p->p_raw_delay,
diff --git a/networking/tftp.c b/networking/tftp.c
index d20d4ca4b..5ebd22105 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -245,7 +245,7 @@ static int tftp_blksize_check(const char *blksize_str, int maxsize)
245 return -1; 245 return -1;
246 } 246 }
247# if ENABLE_TFTP_DEBUG 247# if ENABLE_TFTP_DEBUG
248 bb_error_msg("using blksize %u", blksize); 248 bb_info_msg("using blksize %u", blksize);
249# endif 249# endif
250 return blksize; 250 return blksize;
251} 251}
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index 59cf723ee..62ad248ce 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -191,7 +191,7 @@ static void log_option(const char *pfx, const uint8_t *opt)
191 if (dhcp_verbose >= 2) { 191 if (dhcp_verbose >= 2) {
192 char buf[256 * 2 + 2]; 192 char buf[256 * 2 + 2];
193 *bin2hex(buf, (void*) (opt + OPT_DATA), opt[OPT_LEN]) = '\0'; 193 *bin2hex(buf, (void*) (opt + OPT_DATA), opt[OPT_LEN]) = '\0';
194 bb_error_msg("%s: 0x%02x %s", pfx, opt[OPT_CODE], buf); 194 bb_info_msg("%s: 0x%02x %s", pfx, opt[OPT_CODE], buf);
195 } 195 }
196} 196}
197#else 197#else
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index 9d1f71aae..a897837f9 100644
--- a/networking/udhcp/common.h
+++ b/networking/udhcp/common.h
@@ -274,16 +274,16 @@ struct option_set *udhcp_find_option(struct option_set *opt_list, uint8_t code)
274#if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1 274#if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1
275# define IF_UDHCP_VERBOSE(...) __VA_ARGS__ 275# define IF_UDHCP_VERBOSE(...) __VA_ARGS__
276extern unsigned dhcp_verbose; 276extern unsigned dhcp_verbose;
277# define log1(...) do { if (dhcp_verbose >= 1) bb_error_msg(__VA_ARGS__); } while (0) 277# define log1(...) do { if (dhcp_verbose >= 1) bb_info_msg(__VA_ARGS__); } while (0)
278# if CONFIG_UDHCP_DEBUG >= 2 278# if CONFIG_UDHCP_DEBUG >= 2
279void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC; 279void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC;
280# define log2(...) do { if (dhcp_verbose >= 2) bb_error_msg(__VA_ARGS__); } while (0) 280# define log2(...) do { if (dhcp_verbose >= 2) bb_info_msg(__VA_ARGS__); } while (0)
281# else 281# else
282# define udhcp_dump_packet(...) ((void)0) 282# define udhcp_dump_packet(...) ((void)0)
283# define log2(...) ((void)0) 283# define log2(...) ((void)0)
284# endif 284# endif
285# if CONFIG_UDHCP_DEBUG >= 3 285# if CONFIG_UDHCP_DEBUG >= 3
286# define log3(...) do { if (dhcp_verbose >= 3) bb_error_msg(__VA_ARGS__); } while (0) 286# define log3(...) do { if (dhcp_verbose >= 3) bb_info_msg(__VA_ARGS__); } while (0)
287# else 287# else
288# define log3(...) ((void)0) 288# define log3(...) ((void)0)
289# endif 289# endif
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
index 3562988fd..1a0a5739e 100644
--- a/networking/udhcp/d6_dhcpc.c
+++ b/networking/udhcp/d6_dhcpc.c
@@ -670,7 +670,7 @@ static NOINLINE int send_d6_discover(uint32_t xid, struct in6_addr *requested_ip
670 */ 670 */
671 opt_ptr = add_d6_client_options(opt_ptr); 671 opt_ptr = add_d6_client_options(opt_ptr);
672 672
673 bb_error_msg("sending %s", "discover"); 673 bb_info_msg("sending %s", "discover");
674 return d6_mcast_from_client_config_ifindex(&packet, opt_ptr); 674 return d6_mcast_from_client_config_ifindex(&packet, opt_ptr);
675} 675}
676 676
@@ -727,7 +727,7 @@ static NOINLINE int send_d6_select(uint32_t xid)
727 */ 727 */
728 opt_ptr = add_d6_client_options(opt_ptr); 728 opt_ptr = add_d6_client_options(opt_ptr);
729 729
730 bb_error_msg("sending %s", "select"); 730 bb_info_msg("sending %s", "select");
731 return d6_mcast_from_client_config_ifindex(&packet, opt_ptr); 731 return d6_mcast_from_client_config_ifindex(&packet, opt_ptr);
732} 732}
733 733
@@ -800,7 +800,7 @@ static NOINLINE int send_d6_renew(uint32_t xid, struct in6_addr *server_ipv6, st
800 */ 800 */
801 opt_ptr = add_d6_client_options(opt_ptr); 801 opt_ptr = add_d6_client_options(opt_ptr);
802 802
803 bb_error_msg("sending %s", "renew"); 803 bb_info_msg("sending %s", "renew");
804 if (server_ipv6) 804 if (server_ipv6)
805 return d6_send_kernel_packet( 805 return d6_send_kernel_packet(
806 &packet, (opt_ptr - (uint8_t*) &packet), 806 &packet, (opt_ptr - (uint8_t*) &packet),
@@ -830,7 +830,7 @@ int send_d6_release(struct in6_addr *server_ipv6, struct in6_addr *our_cur_ipv6)
830 if (client6_data.ia_pd) 830 if (client6_data.ia_pd)
831 opt_ptr = mempcpy(opt_ptr, client6_data.ia_pd, client6_data.ia_pd->len + 2+2); 831 opt_ptr = mempcpy(opt_ptr, client6_data.ia_pd, client6_data.ia_pd->len + 2+2);
832 832
833 bb_error_msg("sending %s", "release"); 833 bb_info_msg("sending %s", "release");
834 return d6_send_kernel_packet( 834 return d6_send_kernel_packet(
835 &packet, (opt_ptr - (uint8_t*) &packet), 835 &packet, (opt_ptr - (uint8_t*) &packet),
836 our_cur_ipv6, CLIENT_PORT6, 836 our_cur_ipv6, CLIENT_PORT6,
@@ -1033,7 +1033,7 @@ static void change_listen_mode(int new_mode)
1033/* Called only on SIGUSR1 */ 1033/* Called only on SIGUSR1 */
1034static void perform_renew(void) 1034static void perform_renew(void)
1035{ 1035{
1036 bb_error_msg("performing DHCP renew"); 1036 bb_info_msg("performing DHCP renew");
1037 switch (state) { 1037 switch (state) {
1038 case BOUND: 1038 case BOUND:
1039 change_listen_mode(LISTEN_KERNEL); 1039 change_listen_mode(LISTEN_KERNEL);
@@ -1061,10 +1061,10 @@ static void perform_d6_release(struct in6_addr *server_ipv6, struct in6_addr *ou
1061 || state == REBINDING 1061 || state == REBINDING
1062 || state == RENEW_REQUESTED 1062 || state == RENEW_REQUESTED
1063 ) { 1063 ) {
1064 bb_error_msg("unicasting a release"); 1064 bb_info_msg("unicasting a release");
1065 send_d6_release(server_ipv6, our_cur_ipv6); /* unicast */ 1065 send_d6_release(server_ipv6, our_cur_ipv6); /* unicast */
1066 } 1066 }
1067 bb_error_msg("entering released state"); 1067 bb_info_msg("entering released state");
1068/* 1068/*
1069 * We can be here on: SIGUSR2, 1069 * We can be here on: SIGUSR2,
1070 * or on exit (SIGTERM) and -R "release on quit" is specified. 1070 * or on exit (SIGTERM) and -R "release on quit" is specified.
@@ -1274,7 +1274,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1274 /* Create pidfile */ 1274 /* Create pidfile */
1275 write_pidfile(client_config.pidfile); 1275 write_pidfile(client_config.pidfile);
1276 /* Goes to stdout (unless NOMMU) and possibly syslog */ 1276 /* Goes to stdout (unless NOMMU) and possibly syslog */
1277 bb_error_msg("started, v"BB_VER); 1277 bb_info_msg("started, v"BB_VER);
1278 /* Set up the signal pipe */ 1278 /* Set up the signal pipe */
1279 udhcp_sp_setup(); 1279 udhcp_sp_setup();
1280 1280
@@ -1363,7 +1363,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1363 d6_run_script_no_option("leasefail"); 1363 d6_run_script_no_option("leasefail");
1364#if BB_MMU /* -b is not supported on NOMMU */ 1364#if BB_MMU /* -b is not supported on NOMMU */
1365 if (opt & OPT_b) { /* background if no lease */ 1365 if (opt & OPT_b) { /* background if no lease */
1366 bb_error_msg("no lease, forking to background"); 1366 bb_info_msg("no lease, forking to background");
1367 client_background(); 1367 client_background();
1368 /* do not background again! */ 1368 /* do not background again! */
1369 opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f); 1369 opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f);
@@ -1376,7 +1376,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1376 } else 1376 } else
1377#endif 1377#endif
1378 if (opt & OPT_n) { /* abort if no lease */ 1378 if (opt & OPT_n) { /* abort if no lease */
1379 bb_error_msg("no lease, failing"); 1379 bb_info_msg("no lease, failing");
1380 retval = 1; 1380 retval = 1;
1381 goto ret; 1381 goto ret;
1382 } 1382 }
@@ -1439,7 +1439,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1439 continue; 1439 continue;
1440 } 1440 }
1441 /* Timed out, enter init state */ 1441 /* Timed out, enter init state */
1442 bb_error_msg("lease lost, entering init state"); 1442 bb_info_msg("lease lost, entering init state");
1443 d6_run_script_no_option("deconfig"); 1443 d6_run_script_no_option("deconfig");
1444 state = INIT_SELECTING; 1444 state = INIT_SELECTING;
1445 client_config.first_secs = 0; /* make secs field count from 0 */ 1445 client_config.first_secs = 0; /* make secs field count from 0 */
@@ -1484,7 +1484,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1484 timeout = INT_MAX; 1484 timeout = INT_MAX;
1485 continue; 1485 continue;
1486 case SIGTERM: 1486 case SIGTERM:
1487 bb_error_msg("received %s", "SIGTERM"); 1487 bb_info_msg("received %s", "SIGTERM");
1488 goto ret0; 1488 goto ret0;
1489 } 1489 }
1490 1490
@@ -1544,7 +1544,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1544 option = d6_find_option(packet.d6_options, packet_end, D6_OPT_STATUS_CODE); 1544 option = d6_find_option(packet.d6_options, packet_end, D6_OPT_STATUS_CODE);
1545 if (option && (option->data[0] | option->data[1]) != 0) { 1545 if (option && (option->data[0] | option->data[1]) != 0) {
1546 /* return to init state */ 1546 /* return to init state */
1547 bb_error_msg("received DHCP NAK (%u)", option->data[4]); 1547 bb_info_msg("received DHCP NAK (%u)", option->data[4]);
1548 d6_run_script(packet.d6_options, 1548 d6_run_script(packet.d6_options,
1549 packet_end, "nak"); 1549 packet_end, "nak");
1550 if (state != REQUESTING) 1550 if (state != REQUESTING)
@@ -1561,7 +1561,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1561 } 1561 }
1562 option = d6_copy_option(packet.d6_options, packet_end, D6_OPT_SERVERID); 1562 option = d6_copy_option(packet.d6_options, packet_end, D6_OPT_SERVERID);
1563 if (!option) { 1563 if (!option) {
1564 bb_error_msg("no server ID, ignoring packet"); 1564 bb_info_msg("no server ID, ignoring packet");
1565 continue; 1565 continue;
1566 /* still selecting - this server looks bad */ 1566 /* still selecting - this server looks bad */
1567 } 1567 }
@@ -1670,11 +1670,11 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1670 free(client6_data.ia_na); 1670 free(client6_data.ia_na);
1671 client6_data.ia_na = d6_copy_option(packet.d6_options, packet_end, D6_OPT_IA_NA); 1671 client6_data.ia_na = d6_copy_option(packet.d6_options, packet_end, D6_OPT_IA_NA);
1672 if (!client6_data.ia_na) { 1672 if (!client6_data.ia_na) {
1673 bb_error_msg("no %s option, ignoring packet", "IA_NA"); 1673 bb_info_msg("no %s option, ignoring packet", "IA_NA");
1674 continue; 1674 continue;
1675 } 1675 }
1676 if (client6_data.ia_na->len < (4 + 4 + 4) + (2 + 2 + 16 + 4 + 4)) { 1676 if (client6_data.ia_na->len < (4 + 4 + 4) + (2 + 2 + 16 + 4 + 4)) {
1677 bb_error_msg("%s option is too short:%d bytes", 1677 bb_info_msg("%s option is too short:%d bytes",
1678 "IA_NA", client6_data.ia_na->len); 1678 "IA_NA", client6_data.ia_na->len);
1679 continue; 1679 continue;
1680 } 1680 }
@@ -1683,11 +1683,11 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1683 D6_OPT_IAADDR 1683 D6_OPT_IAADDR
1684 ); 1684 );
1685 if (!iaaddr) { 1685 if (!iaaddr) {
1686 bb_error_msg("no %s option, ignoring packet", "IAADDR"); 1686 bb_info_msg("no %s option, ignoring packet", "IAADDR");
1687 continue; 1687 continue;
1688 } 1688 }
1689 if (iaaddr->len < (16 + 4 + 4)) { 1689 if (iaaddr->len < (16 + 4 + 4)) {
1690 bb_error_msg("%s option is too short:%d bytes", 1690 bb_info_msg("%s option is too short:%d bytes",
1691 "IAADDR", iaaddr->len); 1691 "IAADDR", iaaddr->len);
1692 continue; 1692 continue;
1693 } 1693 }
@@ -1698,7 +1698,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1698 move_from_unaligned32(lease_seconds, iaaddr->data + 16 + 4); 1698 move_from_unaligned32(lease_seconds, iaaddr->data + 16 + 4);
1699 lease_seconds = ntohl(lease_seconds); 1699 lease_seconds = ntohl(lease_seconds);
1700/// TODO: check for 0 lease time? 1700/// TODO: check for 0 lease time?
1701 bb_error_msg("%s obtained, lease time %u", 1701 bb_info_msg("%s obtained, lease time %u",
1702 "IPv6", /*inet_ntoa(temp_addr),*/ (unsigned)lease_seconds); 1702 "IPv6", /*inet_ntoa(temp_addr),*/ (unsigned)lease_seconds);
1703 address_timeout = lease_seconds; 1703 address_timeout = lease_seconds;
1704 } 1704 }
@@ -1708,11 +1708,11 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1708 free(client6_data.ia_pd); 1708 free(client6_data.ia_pd);
1709 client6_data.ia_pd = d6_copy_option(packet.d6_options, packet_end, D6_OPT_IA_PD); 1709 client6_data.ia_pd = d6_copy_option(packet.d6_options, packet_end, D6_OPT_IA_PD);
1710 if (!client6_data.ia_pd) { 1710 if (!client6_data.ia_pd) {
1711 bb_error_msg("no %s option, ignoring packet", "IA_PD"); 1711 bb_info_msg("no %s option, ignoring packet", "IA_PD");
1712 continue; 1712 continue;
1713 } 1713 }
1714 if (client6_data.ia_pd->len < (4 + 4 + 4) + (2 + 2 + 4 + 4 + 1 + 16)) { 1714 if (client6_data.ia_pd->len < (4 + 4 + 4) + (2 + 2 + 4 + 4 + 1 + 16)) {
1715 bb_error_msg("%s option is too short:%d bytes", 1715 bb_info_msg("%s option is too short:%d bytes",
1716 "IA_PD", client6_data.ia_pd->len); 1716 "IA_PD", client6_data.ia_pd->len);
1717 continue; 1717 continue;
1718 } 1718 }
@@ -1721,17 +1721,17 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1721 D6_OPT_IAPREFIX 1721 D6_OPT_IAPREFIX
1722 ); 1722 );
1723 if (!iaprefix) { 1723 if (!iaprefix) {
1724 bb_error_msg("no %s option, ignoring packet", "IAPREFIX"); 1724 bb_info_msg("no %s option, ignoring packet", "IAPREFIX");
1725 continue; 1725 continue;
1726 } 1726 }
1727 if (iaprefix->len < (4 + 4 + 1 + 16)) { 1727 if (iaprefix->len < (4 + 4 + 1 + 16)) {
1728 bb_error_msg("%s option is too short:%d bytes", 1728 bb_info_msg("%s option is too short:%d bytes",
1729 "IAPREFIX", iaprefix->len); 1729 "IAPREFIX", iaprefix->len);
1730 continue; 1730 continue;
1731 } 1731 }
1732 move_from_unaligned32(lease_seconds, iaprefix->data + 4); 1732 move_from_unaligned32(lease_seconds, iaprefix->data + 4);
1733 lease_seconds = ntohl(lease_seconds); 1733 lease_seconds = ntohl(lease_seconds);
1734 bb_error_msg("%s obtained, lease time %u", 1734 bb_info_msg("%s obtained, lease time %u",
1735 "prefix", /*inet_ntoa(temp_addr),*/ (unsigned)lease_seconds); 1735 "prefix", /*inet_ntoa(temp_addr),*/ (unsigned)lease_seconds);
1736 prefix_timeout = lease_seconds; 1736 prefix_timeout = lease_seconds;
1737 } 1737 }
@@ -1781,4 +1781,3 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
1781 /*if (client_config.pidfile) - remove_pidfile has its own check */ 1781 /*if (client_config.pidfile) - remove_pidfile has its own check */
1782 remove_pidfile(client_config.pidfile); 1782 remove_pidfile(client_config.pidfile);
1783 return retval; 1783 return retval;
1784}
diff --git a/networking/udhcp/d6_packet.c b/networking/udhcp/d6_packet.c
index 493943d72..01d1c930b 100644
--- a/networking/udhcp/d6_packet.c
+++ b/networking/udhcp/d6_packet.c
@@ -17,7 +17,7 @@ void FAST_FUNC d6_dump_packet(struct d6_packet *packet)
17 if (dhcp_verbose < 2) 17 if (dhcp_verbose < 2)
18 return; 18 return;
19 19
20 bb_error_msg( 20 bb_info_msg(
21 " xid %x" 21 " xid %x"
22 , packet->d6_xid32 22 , packet->d6_xid32
23 ); 23 );
@@ -40,7 +40,7 @@ int FAST_FUNC d6_recv_kernel_packet(struct in6_addr *peer_ipv6
40 } 40 }
41 41
42 if (bytes < offsetof(struct d6_packet, d6_options)) { 42 if (bytes < offsetof(struct d6_packet, d6_options)) {
43 bb_error_msg("packet with bad magic, ignoring"); 43 bb_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/dhcpc.c b/networking/udhcp/dhcpc.c
index e2fb18aba..0e673ae7e 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -730,7 +730,7 @@ static NOINLINE int send_discover(uint32_t xid, uint32_t requested)
730 */ 730 */
731 add_client_options(&packet); 731 add_client_options(&packet);
732 732
733 bb_error_msg("sending %s", "discover"); 733 bb_info_msg("sending %s", "discover");
734 return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY); 734 return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
735} 735}
736 736
@@ -774,7 +774,7 @@ static NOINLINE int send_select(uint32_t xid, uint32_t server, uint32_t requeste
774 add_client_options(&packet); 774 add_client_options(&packet);
775 775
776 temp_addr.s_addr = requested; 776 temp_addr.s_addr = requested;
777 bb_error_msg("sending select for %s", inet_ntoa(temp_addr)); 777 bb_info_msg("sending select for %s", inet_ntoa(temp_addr));
778 return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY); 778 return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
779} 779}
780 780
@@ -815,7 +815,7 @@ static NOINLINE int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr)
815 add_client_options(&packet); 815 add_client_options(&packet);
816 816
817 temp_addr.s_addr = server; 817 temp_addr.s_addr = server;
818 bb_error_msg("sending renew to %s", inet_ntoa(temp_addr)); 818 bb_info_msg("sending renew to %s", inet_ntoa(temp_addr));
819 return bcast_or_ucast(&packet, ciaddr, server); 819 return bcast_or_ucast(&packet, ciaddr, server);
820} 820}
821 821
@@ -844,7 +844,7 @@ static NOINLINE int send_decline(/*uint32_t xid,*/ uint32_t server, uint32_t req
844 844
845 udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server); 845 udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server);
846 846
847 bb_error_msg("sending %s", "decline"); 847 bb_info_msg("sending %s", "decline");
848 return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY); 848 return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
849} 849}
850#endif 850#endif
@@ -866,7 +866,7 @@ int send_release(uint32_t server, uint32_t ciaddr)
866 866
867 udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server); 867 udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server);
868 868
869 bb_error_msg("sending %s", "release"); 869 bb_info_msg("sending %s", "release");
870 /* Note: normally we unicast here since "server" is not zero. 870 /* Note: normally we unicast here since "server" is not zero.
871 * However, there _are_ people who run "address-less" DHCP servers, 871 * However, there _are_ people who run "address-less" DHCP servers,
872 * and reportedly ISC dhcp client and Windows allow that. 872 * and reportedly ISC dhcp client and Windows allow that.
@@ -969,7 +969,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
969 skip_udp_sum_check: 969 skip_udp_sum_check:
970 970
971 if (packet.data.cookie != htonl(DHCP_MAGIC)) { 971 if (packet.data.cookie != htonl(DHCP_MAGIC)) {
972 bb_error_msg("packet with bad magic, ignoring"); 972 bb_info_msg("packet with bad magic, ignoring");
973 return -2; 973 return -2;
974 } 974 }
975 975
@@ -1117,7 +1117,7 @@ static void change_listen_mode(int new_mode)
1117/* Called only on SIGUSR1 */ 1117/* Called only on SIGUSR1 */
1118static void perform_renew(void) 1118static void perform_renew(void)
1119{ 1119{
1120 bb_error_msg("performing DHCP renew"); 1120 bb_info_msg("performing DHCP renew");
1121 switch (state) { 1121 switch (state) {
1122 case BOUND: 1122 case BOUND:
1123 change_listen_mode(LISTEN_KERNEL); 1123 change_listen_mode(LISTEN_KERNEL);
@@ -1151,11 +1151,11 @@ static void perform_release(uint32_t server_addr, uint32_t requested_ip)
1151 temp_addr.s_addr = server_addr; 1151 temp_addr.s_addr = server_addr;
1152 strcpy(buffer, inet_ntoa(temp_addr)); 1152 strcpy(buffer, inet_ntoa(temp_addr));
1153 temp_addr.s_addr = requested_ip; 1153 temp_addr.s_addr = requested_ip;
1154 bb_error_msg("unicasting a release of %s to %s", 1154 bb_info_msg("unicasting a release of %s to %s",
1155 inet_ntoa(temp_addr), buffer); 1155 inet_ntoa(temp_addr), buffer);
1156 send_release(server_addr, requested_ip); /* unicast */ 1156 send_release(server_addr, requested_ip); /* unicast */
1157 } 1157 }
1158 bb_error_msg("entering released state"); 1158 bb_info_msg("entering released state");
1159/* 1159/*
1160 * We can be here on: SIGUSR2, 1160 * We can be here on: SIGUSR2,
1161 * or on exit (SIGTERM) and -R "release on quit" is specified. 1161 * or on exit (SIGTERM) and -R "release on quit" is specified.
@@ -1391,7 +1391,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1391 /* Create pidfile */ 1391 /* Create pidfile */
1392 write_pidfile(client_config.pidfile); 1392 write_pidfile(client_config.pidfile);
1393 /* Goes to stdout (unless NOMMU) and possibly syslog */ 1393 /* Goes to stdout (unless NOMMU) and possibly syslog */
1394 bb_error_msg("started, v"BB_VER); 1394 bb_info_msg("started, v"BB_VER);
1395 /* Set up the signal pipe */ 1395 /* Set up the signal pipe */
1396 udhcp_sp_setup(); 1396 udhcp_sp_setup();
1397 /* We want random_xid to be random... */ 1397 /* We want random_xid to be random... */
@@ -1481,7 +1481,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1481 udhcp_run_script(NULL, "leasefail"); 1481 udhcp_run_script(NULL, "leasefail");
1482#if BB_MMU /* -b is not supported on NOMMU */ 1482#if BB_MMU /* -b is not supported on NOMMU */
1483 if (opt & OPT_b) { /* background if no lease */ 1483 if (opt & OPT_b) { /* background if no lease */
1484 bb_error_msg("no lease, forking to background"); 1484 bb_info_msg("no lease, forking to background");
1485 client_background(); 1485 client_background();
1486 /* do not background again! */ 1486 /* do not background again! */
1487 opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f); 1487 opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f);
@@ -1494,7 +1494,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1494 } else 1494 } else
1495#endif 1495#endif
1496 if (opt & OPT_n) { /* abort if no lease */ 1496 if (opt & OPT_n) { /* abort if no lease */
1497 bb_error_msg("no lease, failing"); 1497 bb_info_msg("no lease, failing");
1498 retval = 1; 1498 retval = 1;
1499 goto ret; 1499 goto ret;
1500 } 1500 }
@@ -1570,7 +1570,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1570 continue; 1570 continue;
1571 } 1571 }
1572 /* Timed out, enter init state */ 1572 /* Timed out, enter init state */
1573 bb_error_msg("lease lost, entering init state"); 1573 bb_info_msg("lease lost, entering init state");
1574 udhcp_run_script(NULL, "deconfig"); 1574 udhcp_run_script(NULL, "deconfig");
1575 state = INIT_SELECTING; 1575 state = INIT_SELECTING;
1576 client_config.first_secs = 0; /* make secs field count from 0 */ 1576 client_config.first_secs = 0; /* make secs field count from 0 */
@@ -1615,7 +1615,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1615 timeout = INT_MAX; 1615 timeout = INT_MAX;
1616 continue; 1616 continue;
1617 case SIGTERM: 1617 case SIGTERM:
1618 bb_error_msg("received %s", "SIGTERM"); 1618 bb_info_msg("received %s", "SIGTERM");
1619 goto ret0; 1619 goto ret0;
1620 } 1620 }
1621 1621
@@ -1662,7 +1662,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1662 1662
1663 message = udhcp_get_option(&packet, DHCP_MESSAGE_TYPE); 1663 message = udhcp_get_option(&packet, DHCP_MESSAGE_TYPE);
1664 if (message == NULL) { 1664 if (message == NULL) {
1665 bb_error_msg("no message type option, ignoring packet"); 1665 bb_info_msg("no message type option, ignoring packet");
1666 continue; 1666 continue;
1667 } 1667 }
1668 1668
@@ -1691,7 +1691,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1691 * might work too. 1691 * might work too.
1692 * "Next server" and router are definitely wrong ones to use, though... 1692 * "Next server" and router are definitely wrong ones to use, though...
1693 */ 1693 */
1694/* We used to ignore pcakets without DHCP_SERVER_ID. 1694/* We used to ignore packets without DHCP_SERVER_ID.
1695 * I've got user reports from people who run "address-less" servers. 1695 * I've got user reports from people who run "address-less" servers.
1696 * They either supply DHCP_SERVER_ID of 0.0.0.0 or don't supply it at all. 1696 * They either supply DHCP_SERVER_ID of 0.0.0.0 or don't supply it at all.
1697 * They say ISC DHCP client supports this case. 1697 * They say ISC DHCP client supports this case.
@@ -1699,7 +1699,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1699 server_addr = 0; 1699 server_addr = 0;
1700 temp = udhcp_get_option32(&packet, DHCP_SERVER_ID); 1700 temp = udhcp_get_option32(&packet, DHCP_SERVER_ID);
1701 if (!temp) { 1701 if (!temp) {
1702 bb_error_msg("no server ID, using 0.0.0.0"); 1702 bb_info_msg("no server ID, using 0.0.0.0");
1703 } else { 1703 } else {
1704 /* it IS unaligned sometimes, don't "optimize" */ 1704 /* it IS unaligned sometimes, don't "optimize" */
1705 move_from_unaligned32(server_addr, temp); 1705 move_from_unaligned32(server_addr, temp);
@@ -1726,7 +1726,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1726 1726
1727 temp = udhcp_get_option32(&packet, DHCP_LEASE_TIME); 1727 temp = udhcp_get_option32(&packet, DHCP_LEASE_TIME);
1728 if (!temp) { 1728 if (!temp) {
1729 bb_error_msg("no lease time with ACK, using 1 hour lease"); 1729 bb_info_msg("no lease time with ACK, using 1 hour lease");
1730 lease_seconds = 60 * 60; 1730 lease_seconds = 60 * 60;
1731 } else { 1731 } else {
1732 /* it IS unaligned sometimes, don't "optimize" */ 1732 /* it IS unaligned sometimes, don't "optimize" */
@@ -1759,7 +1759,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1759 client_config.interface, 1759 client_config.interface,
1760 arpping_ms) 1760 arpping_ms)
1761 ) { 1761 ) {
1762 bb_error_msg("offered address is in use " 1762 bb_info_msg("offered address is in use "
1763 "(got ARP reply), declining"); 1763 "(got ARP reply), declining");
1764 send_decline(/*xid,*/ server_addr, packet.yiaddr); 1764 send_decline(/*xid,*/ server_addr, packet.yiaddr);
1765 1765
@@ -1778,7 +1778,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1778#endif 1778#endif
1779 /* enter bound state */ 1779 /* enter bound state */
1780 temp_addr.s_addr = packet.yiaddr; 1780 temp_addr.s_addr = packet.yiaddr;
1781 bb_error_msg("lease of %s obtained, lease time %u", 1781 bb_info_msg("lease of %s obtained, lease time %u",
1782 inet_ntoa(temp_addr), (unsigned)lease_seconds); 1782 inet_ntoa(temp_addr), (unsigned)lease_seconds);
1783 requested_ip = packet.yiaddr; 1783 requested_ip = packet.yiaddr;
1784 1784
@@ -1831,7 +1831,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1831 goto non_matching_svid; 1831 goto non_matching_svid;
1832 } 1832 }
1833 /* return to init state */ 1833 /* return to init state */
1834 bb_error_msg("received %s", "DHCP NAK"); 1834 bb_info_msg("received %s", "DHCP NAK");
1835 udhcp_run_script(&packet, "nak"); 1835 udhcp_run_script(&packet, "nak");
1836 if (state != REQUESTING) 1836 if (state != REQUESTING)
1837 udhcp_run_script(NULL, "deconfig"); 1837 udhcp_run_script(NULL, "deconfig");
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 0c55fa5e4..d248d2b67 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -104,7 +104,7 @@ static void log_static_leases(struct static_lease **st_lease_pp)
104 104
105 cur = *st_lease_pp; 105 cur = *st_lease_pp;
106 while (cur) { 106 while (cur) {
107 bb_error_msg("static lease: mac:%02x:%02x:%02x:%02x:%02x:%02x nip:%x", 107 bb_info_msg("static lease: mac:%02x:%02x:%02x:%02x:%02x:%02x nip:%x",
108 cur->mac[0], cur->mac[1], cur->mac[2], 108 cur->mac[0], cur->mac[1], cur->mac[2],
109 cur->mac[3], cur->mac[4], cur->mac[5], 109 cur->mac[3], cur->mac[4], cur->mac[5],
110 cur->nip 110 cur->nip
@@ -242,7 +242,7 @@ static int nobody_responds_to_arp(uint32_t nip, const uint8_t *safe_mac, unsigne
242 return r; 242 return r;
243 243
244 temp.s_addr = nip; 244 temp.s_addr = nip;
245 bb_error_msg("%s belongs to someone, reserving it for %u seconds", 245 bb_info_msg("%s belongs to someone, reserving it for %u seconds",
246 inet_ntoa(temp), (unsigned)server_config.conflict_time); 246 inet_ntoa(temp), (unsigned)server_config.conflict_time);
247 add_lease(NULL, nip, server_config.conflict_time, NULL, 0); 247 add_lease(NULL, nip, server_config.conflict_time, NULL, 0);
248 return 0; 248 return 0;
@@ -722,7 +722,7 @@ static NOINLINE void send_offer(struct dhcp_packet *oldpacket,
722 add_server_options(&packet); 722 add_server_options(&packet);
723 723
724 addr.s_addr = packet.yiaddr; 724 addr.s_addr = packet.yiaddr;
725 bb_error_msg("sending OFFER of %s", inet_ntoa(addr)); 725 bb_info_msg("sending OFFER of %s", inet_ntoa(addr));
726 /* send_packet emits error message itself if it detects failure */ 726 /* send_packet emits error message itself if it detects failure */
727 send_packet(&packet, /*force_bcast:*/ 0); 727 send_packet(&packet, /*force_bcast:*/ 0);
728} 728}
@@ -755,7 +755,7 @@ static NOINLINE void send_ACK(struct dhcp_packet *oldpacket, uint32_t yiaddr)
755 add_server_options(&packet); 755 add_server_options(&packet);
756 756
757 addr.s_addr = yiaddr; 757 addr.s_addr = yiaddr;
758 bb_error_msg("sending ACK to %s", inet_ntoa(addr)); 758 bb_info_msg("sending ACK to %s", inet_ntoa(addr));
759 send_packet(&packet, /*force_bcast:*/ 0); 759 send_packet(&packet, /*force_bcast:*/ 0);
760 760
761 p_host_name = (const char*) udhcp_get_option(oldpacket, DHCP_HOST_NAME); 761 p_host_name = (const char*) udhcp_get_option(oldpacket, DHCP_HOST_NAME);
@@ -865,7 +865,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
865 write_pidfile(server_config.pidfile); 865 write_pidfile(server_config.pidfile);
866 /* if (!..) bb_perror_msg("can't create pidfile %s", pidfile); */ 866 /* if (!..) bb_perror_msg("can't create pidfile %s", pidfile); */
867 867
868 bb_error_msg("started, v"BB_VER); 868 bb_info_msg("started, v"BB_VER);
869 869
870 option = udhcp_find_option(server_config.options, DHCP_LEASE_TIME); 870 option = udhcp_find_option(server_config.options, DHCP_LEASE_TIME);
871 server_config.max_lease_sec = DEFAULT_LEASE_TIME; 871 server_config.max_lease_sec = DEFAULT_LEASE_TIME;
@@ -944,12 +944,12 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
944 944
945 if (pfds[0].revents) switch (udhcp_sp_read()) { 945 if (pfds[0].revents) switch (udhcp_sp_read()) {
946 case SIGUSR1: 946 case SIGUSR1:
947 bb_error_msg("received %s", "SIGUSR1"); 947 bb_info_msg("received %s", "SIGUSR1");
948 write_leases(); 948 write_leases();
949 /* why not just reset the timeout, eh */ 949 /* why not just reset the timeout, eh */
950 goto continue_with_autotime; 950 goto continue_with_autotime;
951 case SIGTERM: 951 case SIGTERM:
952 bb_error_msg("received %s", "SIGTERM"); 952 bb_info_msg("received %s", "SIGTERM");
953 write_leases(); 953 write_leases();
954 goto ret0; 954 goto ret0;
955 } 955 }
@@ -973,16 +973,16 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
973 continue; 973 continue;
974 } 974 }
975 if (packet.hlen != 6) { 975 if (packet.hlen != 6) {
976 bb_error_msg("MAC length != 6, ignoring packet"); 976 bb_info_msg("MAC length != 6, ignoring packet");
977 continue; 977 continue;
978 } 978 }
979 if (packet.op != BOOTREQUEST) { 979 if (packet.op != BOOTREQUEST) {
980 bb_error_msg("not a REQUEST, ignoring packet"); 980 bb_info_msg("not a REQUEST, ignoring packet");
981 continue; 981 continue;
982 } 982 }
983 state = udhcp_get_option(&packet, DHCP_MESSAGE_TYPE); 983 state = udhcp_get_option(&packet, DHCP_MESSAGE_TYPE);
984 if (state == NULL || state[0] < DHCP_MINTYPE || state[0] > DHCP_MAXTYPE) { 984 if (state == NULL || state[0] < DHCP_MINTYPE || state[0] > DHCP_MAXTYPE) {
985 bb_error_msg("no or bad message type option, ignoring packet"); 985 bb_info_msg("no or bad message type option, ignoring packet");
986 continue; 986 continue;
987 } 987 }
988 988
@@ -1001,7 +1001,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
1001 /* Look for a static/dynamic lease */ 1001 /* Look for a static/dynamic lease */
1002 static_lease_nip = get_static_nip_by_mac(server_config.static_leases, &packet.chaddr); 1002 static_lease_nip = get_static_nip_by_mac(server_config.static_leases, &packet.chaddr);
1003 if (static_lease_nip) { 1003 if (static_lease_nip) {
1004 bb_error_msg("found static lease: %x", static_lease_nip); 1004 bb_info_msg("found static lease: %x", static_lease_nip);
1005 memcpy(&fake_lease.lease_mac, &packet.chaddr, 6); 1005 memcpy(&fake_lease.lease_mac, &packet.chaddr, 6);
1006 fake_lease.lease_nip = static_lease_nip; 1006 fake_lease.lease_nip = static_lease_nip;
1007 fake_lease.expires = 0; 1007 fake_lease.expires = 0;
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index ff16904f7..64af802a3 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -40,7 +40,7 @@ void FAST_FUNC udhcp_dump_packet(struct dhcp_packet *packet)
40 if (dhcp_verbose < 2) 40 if (dhcp_verbose < 2)
41 return; 41 return;
42 42
43 bb_error_msg( 43 bb_info_msg(
44 //" op %x" 44 //" op %x"
45 //" htype %x" 45 //" htype %x"
46 " hlen %x" 46 " hlen %x"
@@ -73,7 +73,7 @@ void FAST_FUNC udhcp_dump_packet(struct dhcp_packet *packet)
73 //, packet->options[] 73 //, packet->options[]
74 ); 74 );
75 *bin2hex(buf, (void *) packet->chaddr, sizeof(packet->chaddr)) = '\0'; 75 *bin2hex(buf, (void *) packet->chaddr, sizeof(packet->chaddr)) = '\0';
76 bb_error_msg(" chaddr %s", buf); 76 bb_info_msg(" chaddr %s", buf);
77} 77}
78#endif 78#endif
79 79
@@ -92,7 +92,7 @@ int FAST_FUNC udhcp_recv_kernel_packet(struct dhcp_packet *packet, int fd)
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_error_msg("packet with bad magic, ignoring"); 95 bb_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/zcip.c b/networking/zcip.c
index 434762f12..f95b6f7fb 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -195,7 +195,7 @@ static int run(char *argv[3], const char *param, uint32_t nip)
195 putenv(env_ip); 195 putenv(env_ip);
196 fmt -= 3; 196 fmt -= 3;
197 } 197 }
198 bb_error_msg(fmt, argv[2], argv[0], addr); 198 bb_info_msg(fmt, argv[2], argv[0], addr);
199 status = spawn_and_wait(argv + 1); 199 status = spawn_and_wait(argv + 1);
200 if (nip != 0) 200 if (nip != 0)
201 bb_unsetenv_and_free(env_ip); 201 bb_unsetenv_and_free(env_ip);
@@ -339,7 +339,7 @@ int zcip_main(int argc UNUSED_PARAM, char **argv)
339#if BB_MMU 339#if BB_MMU
340 bb_daemonize(0 /*was: DAEMON_CHDIR_ROOT*/); 340 bb_daemonize(0 /*was: DAEMON_CHDIR_ROOT*/);
341#endif 341#endif
342 bb_error_msg("start, interface %s", argv_intf); 342 bb_info_msg("start, interface %s", argv_intf);
343 } 343 }
344 344
345 // Run the dynamic address negotiation protocol, 345 // Run the dynamic address negotiation protocol,