- if (!arpping(packet.yiaddr,
- (uint32_t) 0,
- client_config.arp,
- client_config.interface)
- ) {
- bb_info_msg("offered address is in use "
- "(got ARP reply), declining");
- send_decline(xid, server_addr, packet.yiaddr);
-
- if (state != REQUESTING)
- udhcp_run_script(NULL, "deconfig");
- change_listen_mode(LISTEN_RAW);
- state = INIT_SELECTING;
- requested_ip = 0;
- timeout = tryagain_timeout;
- packet_num = 0;
- already_waited_sec = 0;
- continue; /* back to main loop */
- }
- }
-#endif
- /* enter bound state */
- timeout = lease_seconds / 2;
- {
- struct in_addr temp_addr;
- temp_addr.s_addr = packet.yiaddr;
- bb_info_msg("Lease of %s obtained, lease time %u",
- inet_ntoa(temp_addr), (unsigned)lease_seconds);
- }
- requested_ip = packet.yiaddr;
- udhcp_run_script(&packet,
- ((state == RENEWING || state == REBINDING) ? "renew" : "bound"));
-
- state = BOUND;
- change_listen_mode(LISTEN_NONE);
- if (opt & OPT_q) { /* quit after lease */
- if (opt & OPT_R) /* release on quit */
- perform_release(requested_ip, server_addr);
- goto ret0;
- }
-#if BB_MMU /* NOMMU case backgrounded earlier */
- if (!(opt & OPT_f)) {
- client_background();
- /* do not background again! */
- opt = ((opt & ~OPT_b) | OPT_f);
+ if (!arpping(packet.yiaddr,
+ NULL,
+ (uint32_t) 0,
+ client_config.client_mac,
+ client_config.interface)
+ ) {
+ bb_info_msg("Offered address is in use "
+ "(got ARP reply), declining");
+ send_decline(xid, server_addr, packet.yiaddr);
+
+ if (state != REQUESTING)
+ udhcp_run_script(NULL, "deconfig");
+ change_listen_mode(LISTEN_RAW);
+ state = INIT_SELECTING;
+ requested_ip = 0;
+ timeout = tryagain_timeout;
+ packet_num = 0;
+ already_waited_sec = 0;
+ continue; /* back to main loop */