aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-02-21 16:32:07 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2021-02-21 16:32:07 +0100
commita4959eef71067dd6763bf60113bdeafdcb5f2d91 (patch)
tree91c59d7cc891f725432abc746122afc7b6bd5870 /networking
parent855aeacfba83a776f529da7a82b749081652a486 (diff)
downloadbusybox-a4959eef71067dd6763bf60113bdeafdcb5f2d91.tar.gz
udhcp: reuse strings
text data bss dec hex filename 1019916 559 5020 1025495 fa5d7 busybox_old 1019906 559 5020 1025485 fa5cd busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/udhcp/d6_dhcpc.c14
-rw-r--r--networking/udhcp/dhcpc.c6
-rw-r--r--networking/udhcp/dhcpd.c4
3 files changed, 14 insertions, 10 deletions
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
index fbdaa99bd..76b087b92 100644
--- a/networking/udhcp/d6_dhcpc.c
+++ b/networking/udhcp/d6_dhcpc.c
@@ -1589,8 +1589,10 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
}
if ((packet.d6_xid32 & htonl(0x00ffffff)) != xid) {
- log1("xid %x (our is %x), ignoring packet",
- (unsigned)(packet.d6_xid32 & htonl(0x00ffffff)), (unsigned)xid);
+ log1("xid %x (our is %x)%s",
+ (unsigned)(packet.d6_xid32 & htonl(0x00ffffff)), (unsigned)xid,
+ ", ignoring packet"
+ );
continue;
}
@@ -1743,7 +1745,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
free(client6_data.ia_na);
client6_data.ia_na = d6_copy_option(packet.d6_options, packet_end, D6_OPT_IA_NA);
if (!client6_data.ia_na) {
- bb_info_msg("no %s option, ignoring packet", "IA_NA");
+ bb_info_msg("no %s option%s", "IA_NA", ", ignoring packet");
continue;
}
if (client6_data.ia_na->len < (4 + 4 + 4) + (2 + 2 + 16 + 4 + 4)) {
@@ -1756,7 +1758,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
D6_OPT_IAADDR
);
if (!iaaddr) {
- bb_info_msg("no %s option, ignoring packet", "IAADDR");
+ bb_info_msg("no %s option%s", "IAADDR", ", ignoring packet");
continue;
}
if (iaaddr->len < (16 + 4 + 4)) {
@@ -1781,7 +1783,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
free(client6_data.ia_pd);
client6_data.ia_pd = d6_copy_option(packet.d6_options, packet_end, D6_OPT_IA_PD);
if (!client6_data.ia_pd) {
- bb_info_msg("no %s option, ignoring packet", "IA_PD");
+ bb_info_msg("no %s option%s", "IA_PD", ", ignoring packet");
continue;
}
if (client6_data.ia_pd->len < (4 + 4 + 4) + (2 + 2 + 4 + 4 + 1 + 16)) {
@@ -1794,7 +1796,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
D6_OPT_IAPREFIX
);
if (!iaprefix) {
- bb_info_msg("no %s option, ignoring packet", "IAPREFIX");
+ bb_info_msg("no %s option%s", "IAPREFIX", ", ignoring packet");
continue;
}
if (iaprefix->len < (4 + 4 + 1 + 16)) {
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index f1f6720f3..bbcbd1fca 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -1655,8 +1655,10 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
}
if (packet.xid != xid) {
- log1("xid %x (our is %x), ignoring packet",
- (unsigned)packet.xid, (unsigned)xid);
+ log1("xid %x (our is %x)%s",
+ (unsigned)packet.xid, (unsigned)xid,
+ ", ignoring packet"
+ );
continue;
}
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index cd32cb437..260130507 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -1048,7 +1048,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
move_from_unaligned32(server_id_network_order, server_id_opt);
if (server_id_network_order != server_data.server_nip) {
/* client talks to somebody else */
- log1("server ID doesn't match%s", ", ignoring");
+ log1("server ID doesn't match%s", ", ignoring packet");
continue;
}
}
@@ -1171,7 +1171,7 @@ o DHCPREQUEST generated during REBINDING state:
if (!requested_ip_opt) {
requested_nip = packet.ciaddr;
if (requested_nip == 0) {
- log1("no requested IP and no ciaddr%s", ", ignoring");
+ log1("no requested IP and no ciaddr%s", ", ignoring packet");
break;
}
}