- timeout = PROBE_MIN * 1000;
- timeout += ms_rdelay(PROBE_MAX
- - PROBE_MIN);
- } else
- timeout = ANNOUNCE_WAIT * 1000;
- }
- // then announcements
- else if (nclaims < ANNOUNCE_NUM) {
- nclaims++;
- VDBG("announce/%d %s@%s\n",
- nclaims, intf, inet_ntoa(ip));
- (void)arp(fd, &saddr, ARPOP_REQUEST,
- &addr, ip,
- &addr, ip);
+ nprobes++;
+ VDBG("probe/%u %s@%s\n",
+ nprobes, argv_intf, inet_ntoa(ip));
+ arp(/* ARPOP_REQUEST, */
+ /* ð_addr, */ null_ip,
+ &null_addr, ip);
+ timeout_ms = PROBE_MIN * 1000;
+ timeout_ms += random_delay_ms(PROBE_MAX - PROBE_MIN);
+ }
+ else {
+ // Switch to announce state.
+ state = ANNOUNCE;
+ nclaims = 0;
+ VDBG("announce/%u %s@%s\n",
+ nclaims, argv_intf, inet_ntoa(ip));
+ arp(/* ARPOP_REQUEST, */
+ /* ð_addr, */ ip,
+ ð_addr, ip);
+ timeout_ms = ANNOUNCE_INTERVAL * 1000;
+ }
+ break;
+ case RATE_LIMIT_PROBE:
+ // timeouts in the RATE_LIMIT_PROBE state mean no conflicting ARP packets
+ // have been received, so we can move immediately to the announce state
+ state = ANNOUNCE;
+ nclaims = 0;
+ VDBG("announce/%u %s@%s\n",
+ nclaims, argv_intf, inet_ntoa(ip));
+ arp(/* ARPOP_REQUEST, */
+ /* ð_addr, */ ip,
+ ð_addr, ip);
+ timeout_ms = ANNOUNCE_INTERVAL * 1000;
+ break;
+ case ANNOUNCE:
+ // timeouts in the ANNOUNCE state mean no conflicting ARP packets
+ // have been received, so we can progress through the states