200-udhcpc_reduce_msgs.patch 564 B

123456789101112131415161718
  1. --- a/networking/udhcp/dhcpc.c
  2. +++ b/networking/udhcp/dhcpc.c
  3. @@ -695,6 +695,7 @@ static int bcast_or_ucast(struct dhcp_pa
  4. static NOINLINE int send_discover(uint32_t xid, uint32_t requested)
  5. {
  6. struct dhcp_packet packet;
  7. + static int msgs = 0;
  8. /* Fill in: op, htype, hlen, cookie, chaddr fields,
  9. * random xid field (we override it below),
  10. @@ -712,6 +713,7 @@ static NOINLINE int send_discover(uint32
  11. */
  12. add_client_options(&packet);
  13. + if (msgs++ < 3)
  14. bb_info_msg("Sending discover...");
  15. return raw_bcast_from_client_config_ifindex(&packet);
  16. }