udhcp: get rid of bb_info_msg()

function                                             old     new   delta
udhcpd_main                                         1501    1531     +30
d6_recv_raw_packet                                   251     264     +13
perform_d6_release                                   188     198     +10
udhcpc6_main                                        2443    2449      +6
udhcp_recv_raw_packet                                582     588      +6
udhcp_recv_kernel_packet                             132     138      +6
send_d6_renew                                        140     146      +6
d6_recv_kernel_packet                                118     124      +6
send_renew                                            77      82      +5
send_discover                                         85      90      +5
send_decline                                          84      89      +5
send_d6_select                                        97     102      +5
send_d6_discover                                     174     179      +5
perform_release                                      167     172      +5
count_lines                                           72      74      +2
udhcpc_main                                         2836    2837      +1
bb_info_msg                                          125       -    -125
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 17/4 up/down: 117/-180)         Total: -63 bytes
   text	   data	    bss	    dec	    hex	filename
 924935	    906	  17160	 943001	  e6399	busybox_old
 924736	    906	  17160	 942802	  e62d2	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2016-03-30 18:41:23 +02:00
parent 80f0f1d712
commit 8f2e99c813
16 changed files with 107 additions and 171 deletions

View File

@@ -38,8 +38,8 @@ void FAST_FUNC udhcp_dump_packet(struct dhcp_packet *packet)
if (dhcp_verbose < 2)
return;
bb_info_msg(
//" op %x"
bb_error_msg(
//"op %x"
//" htype %x"
" hlen %x"
//" hops %x"
@@ -73,7 +73,7 @@ void FAST_FUNC udhcp_dump_packet(struct dhcp_packet *packet)
//, packet->options[]
);
*bin2hex(buf, (void *) packet->chaddr, sizeof(packet->chaddr)) = '\0';
bb_info_msg(" chaddr %s", buf);
bb_error_msg("chaddr %s", buf);
}
#endif
@@ -85,17 +85,17 @@ int FAST_FUNC udhcp_recv_kernel_packet(struct dhcp_packet *packet, int fd)
memset(packet, 0, sizeof(*packet));
bytes = safe_read(fd, packet, sizeof(*packet));
if (bytes < 0) {
log1("Packet read error, ignoring");
log1("packet read error, ignoring");
return bytes; /* returns -1 */
}
if (bytes < offsetof(struct dhcp_packet, options)
|| packet->cookie != htonl(DHCP_MAGIC)
) {
bb_info_msg("Packet with bad magic, ignoring");
bb_error_msg("packet with bad magic, ignoring");
return -2;
}
log1("Received a packet");
log1("received %s", "a packet");
udhcp_dump_packet(packet);
return bytes;