make udhcpc silent after 3 'Sending discover ...' messages
[openwrt/svn-archive/archive.git] / package / busybox / patches / 242-udhcpc_msgs.patch
1 diff -ur busybox.old/networking/udhcp/clientpacket.c busybox.dev/networking/udhcp/clientpacket.c
2 --- busybox.old/networking/udhcp/clientpacket.c 2007-03-18 17:59:24.000000000 +0100
3 +++ busybox.dev/networking/udhcp/clientpacket.c 2007-05-14 16:03:26.698979472 +0200
4 @@ -78,6 +78,7 @@
5 int send_discover(unsigned long xid, unsigned long requested)
6 {
7 struct dhcpMessage packet;
8 + static int msgs = 0;
9
10 init_packet(&packet, DHCPDISCOVER);
11 packet.xid = xid;
12 @@ -85,7 +86,8 @@
13 add_simple_option(packet.options, DHCP_REQUESTED_IP, requested);
14
15 add_requests(&packet);
16 - bb_info_msg("Sending discover...");
17 + if (msgs++ < 3)
18 + bb_info_msg("Sending discover...");
19 return udhcp_raw_packet(&packet, INADDR_ANY, CLIENT_PORT, INADDR_BROADCAST,
20 SERVER_PORT, MAC_BCAST_ADDR, client_config.ifindex);
21 }