[git commit] udhcpc: reuse string constant; remove unneeded memset(0)

Denys Vlasenko vda.linux at googlemail.com
Sat Nov 5 00:25:03 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=d38ca03946000f0837e9a0e04937499509db54c4
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 networking/udhcp/dhcpc.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index d0fe94a..ea798a3 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -800,7 +800,6 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
 	struct ip_udp_dhcp_packet packet;
 	uint16_t check;
 
-	memset(&packet, 0, sizeof(packet));
 	bytes = safe_read(fd, &packet, sizeof(packet));
 	if (bytes < 0) {
 		log1("Packet read error, ignoring");
@@ -858,7 +857,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd)
 		return -2;
 	}
 
-	log1("Got valid DHCP packet");
+	log1("Received a packet");
 	udhcp_dump_packet(&packet.data);
 
 	bytes -= sizeof(packet.ip) + sizeof(packet.udp);


More information about the busybox-cvs mailing list