summaryrefslogtreecommitdiff
path: root/networking/udhcp/packet.c
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 /networking/udhcp/packet.c
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>
Diffstat (limited to 'networking/udhcp/packet.c')
-rw-r--r--networking/udhcp/packet.c6
1 files changed, 3 insertions, 3 deletions
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");