Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 1 | /* |
| 2 | * RFC3927 ZeroConf IPv4 Link-Local addressing |
| 3 | * (see <http://www.zeroconf.org/>) |
| 4 | * |
| 5 | * Copied from BusyBox - networking/zcip.c |
| 6 | * |
| 7 | * Copyright (C) 2003 by Arthur van Hoff (avh@strangeberry.com) |
| 8 | * Copyright (C) 2004 by David Brownell |
| 9 | * Copyright (C) 2010 by Joe Hershberger |
| 10 | * |
| 11 | * Licensed under the GPL v2 or later |
| 12 | */ |
| 13 | |
| 14 | #include <common.h> |
Simon Glass | 7b51b57 | 2019-08-01 09:46:52 -0600 | [diff] [blame] | 15 | #include <env.h> |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 16 | #include <net.h> |
| 17 | #include "arp.h" |
| 18 | #include "net_rand.h" |
| 19 | |
| 20 | /* We don't need more than 32 bits of the counter */ |
| 21 | #define MONOTONIC_MS() ((unsigned)get_timer(0) * (1000 / CONFIG_SYS_HZ)) |
| 22 | |
| 23 | enum { |
| 24 | /* 169.254.0.0 */ |
| 25 | LINKLOCAL_ADDR = 0xa9fe0000, |
| 26 | |
| 27 | IN_CLASSB_NET = 0xffff0000, |
| 28 | IN_CLASSB_HOST = 0x0000ffff, |
| 29 | |
| 30 | /* protocol timeout parameters, specified in seconds */ |
| 31 | PROBE_WAIT = 1, |
| 32 | PROBE_MIN = 1, |
| 33 | PROBE_MAX = 2, |
| 34 | PROBE_NUM = 3, |
| 35 | MAX_CONFLICTS = 10, |
| 36 | RATE_LIMIT_INTERVAL = 60, |
| 37 | ANNOUNCE_WAIT = 2, |
| 38 | ANNOUNCE_NUM = 2, |
| 39 | ANNOUNCE_INTERVAL = 2, |
| 40 | DEFEND_INTERVAL = 10 |
| 41 | }; |
| 42 | |
| 43 | /* States during the configuration process. */ |
| 44 | static enum ll_state_t { |
| 45 | PROBE = 0, |
| 46 | RATE_LIMIT_PROBE, |
| 47 | ANNOUNCE, |
| 48 | MONITOR, |
| 49 | DEFEND, |
| 50 | DISABLED |
| 51 | } state = DISABLED; |
| 52 | |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 53 | static struct in_addr ip; |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 54 | static int timeout_ms = -1; |
| 55 | static unsigned deadline_ms; |
| 56 | static unsigned conflicts; |
| 57 | static unsigned nprobes; |
| 58 | static unsigned nclaims; |
| 59 | static int ready; |
Michael Walle | 99e139d | 2012-06-05 11:33:15 +0000 | [diff] [blame] | 60 | static unsigned int seed; |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 61 | |
| 62 | static void link_local_timeout(void); |
| 63 | |
| 64 | /** |
| 65 | * Pick a random link local IP address on 169.254/16, except that |
| 66 | * the first and last 256 addresses are reserved. |
| 67 | */ |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 68 | static struct in_addr pick(void) |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 69 | { |
| 70 | unsigned tmp; |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 71 | struct in_addr ip; |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 72 | |
| 73 | do { |
Michael Walle | 99e139d | 2012-06-05 11:33:15 +0000 | [diff] [blame] | 74 | tmp = rand_r(&seed) & IN_CLASSB_HOST; |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 75 | } while (tmp > (IN_CLASSB_HOST - 0x0200)); |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 76 | ip.s_addr = htonl((LINKLOCAL_ADDR + 0x0100) + tmp); |
| 77 | return ip; |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Return milliseconds of random delay, up to "secs" seconds. |
| 82 | */ |
| 83 | static inline unsigned random_delay_ms(unsigned secs) |
| 84 | { |
Michael Walle | 99e139d | 2012-06-05 11:33:15 +0000 | [diff] [blame] | 85 | return rand_r(&seed) % (secs * 1000); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | static void configure_wait(void) |
| 89 | { |
| 90 | if (timeout_ms == -1) |
| 91 | return; |
| 92 | |
| 93 | /* poll, being ready to adjust current timeout */ |
| 94 | if (!timeout_ms) |
| 95 | timeout_ms = random_delay_ms(PROBE_WAIT); |
| 96 | |
| 97 | /* set deadline_ms to the point in time when we timeout */ |
| 98 | deadline_ms = MONOTONIC_MS() + timeout_ms; |
| 99 | |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 100 | debug_cond(DEBUG_DEV_PKT, "...wait %d %s nprobes=%u, nclaims=%u\n", |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 101 | timeout_ms, eth_get_name(), nprobes, nclaims); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 102 | |
Joe Hershberger | bc0571f | 2015-04-08 01:41:21 -0500 | [diff] [blame] | 103 | net_set_timeout_handler(timeout_ms, link_local_timeout); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | void link_local_start(void) |
| 107 | { |
Simon Glass | 723806c | 2017-08-03 12:22:15 -0600 | [diff] [blame] | 108 | ip = env_get_ip("llipaddr"); |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 109 | if (ip.s_addr != 0 && |
| 110 | (ntohl(ip.s_addr) & IN_CLASSB_NET) != LINKLOCAL_ADDR) { |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 111 | puts("invalid link address"); |
| 112 | net_set_state(NETLOOP_FAIL); |
| 113 | return; |
| 114 | } |
Alexandre Messier | 27a0f03 | 2017-03-14 15:03:31 -0400 | [diff] [blame] | 115 | net_netmask.s_addr = htonl(IN_CLASSB_NET); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 116 | |
Michael Walle | 99e139d | 2012-06-05 11:33:15 +0000 | [diff] [blame] | 117 | seed = seed_mac(); |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 118 | if (ip.s_addr == 0) |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 119 | ip = pick(); |
| 120 | |
| 121 | state = PROBE; |
| 122 | timeout_ms = 0; |
| 123 | conflicts = 0; |
| 124 | nprobes = 0; |
| 125 | nclaims = 0; |
| 126 | ready = 0; |
| 127 | |
| 128 | configure_wait(); |
| 129 | } |
| 130 | |
| 131 | static void link_local_timeout(void) |
| 132 | { |
| 133 | switch (state) { |
| 134 | case PROBE: |
| 135 | /* timeouts in the PROBE state mean no conflicting ARP packets |
| 136 | have been received, so we can progress through the states */ |
| 137 | if (nprobes < PROBE_NUM) { |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 138 | struct in_addr zero_ip = {.s_addr = 0}; |
| 139 | |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 140 | nprobes++; |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 141 | debug_cond(DEBUG_LL_STATE, "probe/%u %s@%pI4\n", |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 142 | nprobes, eth_get_name(), &ip); |
Joe Hershberger | 0adb5b7 | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 143 | arp_raw_request(zero_ip, net_null_ethaddr, ip); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 144 | timeout_ms = PROBE_MIN * 1000; |
| 145 | timeout_ms += random_delay_ms(PROBE_MAX - PROBE_MIN); |
| 146 | } else { |
| 147 | /* Switch to announce state */ |
| 148 | state = ANNOUNCE; |
| 149 | nclaims = 0; |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 150 | debug_cond(DEBUG_LL_STATE, "announce/%u %s@%pI4\n", |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 151 | nclaims, eth_get_name(), &ip); |
Joe Hershberger | 0adb5b7 | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 152 | arp_raw_request(ip, net_ethaddr, ip); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 153 | timeout_ms = ANNOUNCE_INTERVAL * 1000; |
| 154 | } |
| 155 | break; |
| 156 | case RATE_LIMIT_PROBE: |
| 157 | /* timeouts in the RATE_LIMIT_PROBE state mean no conflicting |
| 158 | ARP packets have been received, so we can move immediately |
| 159 | to the announce state */ |
| 160 | state = ANNOUNCE; |
| 161 | nclaims = 0; |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 162 | debug_cond(DEBUG_LL_STATE, "announce/%u %s@%pI4\n", |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 163 | nclaims, eth_get_name(), &ip); |
Joe Hershberger | 0adb5b7 | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 164 | arp_raw_request(ip, net_ethaddr, ip); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 165 | timeout_ms = ANNOUNCE_INTERVAL * 1000; |
| 166 | break; |
| 167 | case ANNOUNCE: |
| 168 | /* timeouts in the ANNOUNCE state mean no conflicting ARP |
| 169 | packets have been received, so we can progress through |
| 170 | the states */ |
| 171 | if (nclaims < ANNOUNCE_NUM) { |
| 172 | nclaims++; |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 173 | debug_cond(DEBUG_LL_STATE, "announce/%u %s@%pI4\n", |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 174 | nclaims, eth_get_name(), &ip); |
Joe Hershberger | 0adb5b7 | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 175 | arp_raw_request(ip, net_ethaddr, ip); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 176 | timeout_ms = ANNOUNCE_INTERVAL * 1000; |
| 177 | } else { |
| 178 | /* Switch to monitor state */ |
| 179 | state = MONITOR; |
| 180 | printf("Successfully assigned %pI4\n", &ip); |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 181 | net_copy_ip(&net_ip, &ip); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 182 | ready = 1; |
| 183 | conflicts = 0; |
| 184 | timeout_ms = -1; |
| 185 | /* Never timeout in the monitor state */ |
Joe Hershberger | bc0571f | 2015-04-08 01:41:21 -0500 | [diff] [blame] | 186 | net_set_timeout_handler(0, NULL); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 187 | |
| 188 | /* NOTE: all other exit paths should deconfig ... */ |
| 189 | net_set_state(NETLOOP_SUCCESS); |
| 190 | return; |
| 191 | } |
| 192 | break; |
| 193 | case DEFEND: |
| 194 | /* We won! No ARP replies, so just go back to monitor */ |
| 195 | state = MONITOR; |
| 196 | timeout_ms = -1; |
| 197 | conflicts = 0; |
| 198 | break; |
| 199 | default: |
| 200 | /* Invalid, should never happen. Restart the whole protocol */ |
| 201 | state = PROBE; |
| 202 | ip = pick(); |
| 203 | timeout_ms = 0; |
| 204 | nprobes = 0; |
| 205 | nclaims = 0; |
| 206 | break; |
| 207 | } |
| 208 | configure_wait(); |
| 209 | } |
| 210 | |
| 211 | void link_local_receive_arp(struct arp_hdr *arp, int len) |
| 212 | { |
| 213 | int source_ip_conflict; |
| 214 | int target_ip_conflict; |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 215 | struct in_addr null_ip = {.s_addr = 0}; |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 216 | |
| 217 | if (state == DISABLED) |
| 218 | return; |
| 219 | |
| 220 | /* We need to adjust the timeout in case we didn't receive a |
| 221 | conflicting packet. */ |
| 222 | if (timeout_ms > 0) { |
| 223 | unsigned diff = deadline_ms - MONOTONIC_MS(); |
| 224 | if ((int)(diff) < 0) { |
| 225 | /* Current time is greater than the expected timeout |
| 226 | time. This should never happen */ |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 227 | debug_cond(DEBUG_LL_STATE, |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 228 | "missed an expected timeout\n"); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 229 | timeout_ms = 0; |
| 230 | } else { |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 231 | debug_cond(DEBUG_INT_STATE, "adjusting timeout\n"); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 232 | timeout_ms = diff | 1; /* never 0 */ |
| 233 | } |
| 234 | } |
benoit.thebaudeau@advans | b684115 | 2012-07-19 01:19:34 +0000 | [diff] [blame] | 235 | #if 0 |
| 236 | /* XXX Don't bother with ethernet link just yet */ |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 237 | if ((fds[0].revents & POLLIN) == 0) { |
| 238 | if (fds[0].revents & POLLERR) { |
Wolfgang Denk | 3fe6383 | 2012-07-10 09:18:33 +0200 | [diff] [blame] | 239 | /* |
| 240 | * FIXME: links routinely go down; |
| 241 | */ |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 242 | bb_error_msg("iface %s is down", eth_get_name()); |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 243 | if (ready) |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 244 | run(argv, "deconfig", &ip); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 245 | return EXIT_FAILURE; |
| 246 | } |
| 247 | continue; |
| 248 | } |
benoit.thebaudeau@advans | b684115 | 2012-07-19 01:19:34 +0000 | [diff] [blame] | 249 | #endif |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 250 | |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 251 | debug_cond(DEBUG_INT_STATE, "%s recv arp type=%d, op=%d,\n", |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 252 | eth_get_name(), ntohs(arp->ar_pro), |
| 253 | ntohs(arp->ar_op)); |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 254 | debug_cond(DEBUG_INT_STATE, "\tsource=%pM %pI4\n", |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 255 | &arp->ar_sha, |
| 256 | &arp->ar_spa); |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 257 | debug_cond(DEBUG_INT_STATE, "\ttarget=%pM %pI4\n", |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 258 | &arp->ar_tha, |
| 259 | &arp->ar_tpa); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 260 | |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 261 | if (arp->ar_op != htons(ARPOP_REQUEST) && |
| 262 | arp->ar_op != htons(ARPOP_REPLY)) { |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 263 | configure_wait(); |
| 264 | return; |
| 265 | } |
| 266 | |
| 267 | source_ip_conflict = 0; |
| 268 | target_ip_conflict = 0; |
| 269 | |
Joe Hershberger | 0adb5b7 | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 270 | if (memcmp(&arp->ar_spa, &ip, ARP_PLEN) == 0 && |
| 271 | memcmp(&arp->ar_sha, net_ethaddr, ARP_HLEN) != 0) |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 272 | source_ip_conflict = 1; |
Joe Hershberger | 5da7cf8 | 2013-02-08 14:18:53 -0600 | [diff] [blame] | 273 | |
| 274 | /* |
| 275 | * According to RFC 3927, section 2.2.1: |
| 276 | * Check if packet is an ARP probe by checking for a null source IP |
| 277 | * then check that target IP is equal to ours and source hw addr |
| 278 | * is not equal to ours. This condition should cause a conflict only |
| 279 | * during probe. |
| 280 | */ |
| 281 | if (arp->ar_op == htons(ARPOP_REQUEST) && |
| 282 | memcmp(&arp->ar_spa, &null_ip, ARP_PLEN) == 0 && |
| 283 | memcmp(&arp->ar_tpa, &ip, ARP_PLEN) == 0 && |
Joe Hershberger | 0adb5b7 | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 284 | memcmp(&arp->ar_sha, net_ethaddr, ARP_HLEN) != 0) { |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 285 | target_ip_conflict = 1; |
| 286 | } |
| 287 | |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 288 | debug_cond(DEBUG_NET_PKT, |
Joe Hershberger | 8e7ff67 | 2015-04-08 01:41:18 -0500 | [diff] [blame] | 289 | "state = %d, source ip conflict = %d, target ip conflict = " |
| 290 | "%d\n", state, source_ip_conflict, target_ip_conflict); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 291 | switch (state) { |
| 292 | case PROBE: |
| 293 | case ANNOUNCE: |
| 294 | /* When probing or announcing, check for source IP conflicts |
| 295 | and other hosts doing ARP probes (target IP conflicts). */ |
| 296 | if (source_ip_conflict || target_ip_conflict) { |
| 297 | conflicts++; |
| 298 | state = PROBE; |
| 299 | if (conflicts >= MAX_CONFLICTS) { |
| 300 | debug("%s ratelimit\n", eth_get_name()); |
| 301 | timeout_ms = RATE_LIMIT_INTERVAL * 1000; |
| 302 | state = RATE_LIMIT_PROBE; |
| 303 | } |
| 304 | |
| 305 | /* restart the whole protocol */ |
| 306 | ip = pick(); |
| 307 | timeout_ms = 0; |
| 308 | nprobes = 0; |
| 309 | nclaims = 0; |
| 310 | } |
| 311 | break; |
| 312 | case MONITOR: |
| 313 | /* If a conflict, we try to defend with a single ARP probe */ |
| 314 | if (source_ip_conflict) { |
| 315 | debug("monitor conflict -- defending\n"); |
| 316 | state = DEFEND; |
| 317 | timeout_ms = DEFEND_INTERVAL * 1000; |
Joe Hershberger | 0adb5b7 | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 318 | arp_raw_request(ip, net_ethaddr, ip); |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 319 | } |
| 320 | break; |
| 321 | case DEFEND: |
| 322 | /* Well, we tried. Start over (on conflict) */ |
| 323 | if (source_ip_conflict) { |
| 324 | state = PROBE; |
| 325 | debug("defend conflict -- starting over\n"); |
| 326 | ready = 0; |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 327 | net_ip.s_addr = 0; |
Joe Hershberger | d22c338 | 2012-05-23 08:00:12 +0000 | [diff] [blame] | 328 | |
| 329 | /* restart the whole protocol */ |
| 330 | ip = pick(); |
| 331 | timeout_ms = 0; |
| 332 | nprobes = 0; |
| 333 | nclaims = 0; |
| 334 | } |
| 335 | break; |
| 336 | default: |
| 337 | /* Invalid, should never happen. Restart the whole protocol */ |
| 338 | debug("invalid state -- starting over\n"); |
| 339 | state = PROBE; |
| 340 | ip = pick(); |
| 341 | timeout_ms = 0; |
| 342 | nprobes = 0; |
| 343 | nclaims = 0; |
| 344 | break; |
| 345 | } |
| 346 | configure_wait(); |
| 347 | } |