Tom Rini | f739fcd | 2018-05-07 17:02:21 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copied from Linux Monitor (LiMon) - Networking. |
| 4 | * |
| 5 | * Copyright 1994 - 2000 Neil Russell. |
| 6 | * (See License) |
| 7 | * Copyright 2000 Roland Borde |
| 8 | * Copyright 2000 Paolo Scaffardi |
| 9 | * Copyright 2000-2002 Wolfgang Denk, wd@denx.de |
| 10 | */ |
| 11 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 12 | #include <env.h> |
Simon Glass | f7ae49f | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 13 | #include <log.h> |
Simon Glass | 90526e9 | 2020-05-10 11:39:56 -0600 | [diff] [blame] | 14 | #include <net.h> |
Tom Rini | 03de305 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 15 | #include <vsprintf.h> |
Simon Glass | c05ed00 | 2020-05-10 11:40:11 -0600 | [diff] [blame] | 16 | #include <linux/delay.h> |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 17 | |
| 18 | #include "arp.h" |
| 19 | |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 20 | struct in_addr net_arp_wait_packet_ip; |
| 21 | static struct in_addr net_arp_wait_reply_ip; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 22 | /* MAC address of waiting packet's destination */ |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 23 | uchar *arp_wait_packet_ethaddr; |
| 24 | int arp_wait_tx_packet_size; |
| 25 | ulong arp_wait_timer_start; |
| 26 | int arp_wait_try; |
Joe Hershberger | ac3f26c | 2018-09-26 16:49:02 -0500 | [diff] [blame] | 27 | uchar *arp_tx_packet; /* THE ARP transmit packet */ |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 28 | static uchar arp_tx_packet_buf[PKTSIZE_ALIGN + PKTALIGN]; |
Joe Hershberger | e94070c | 2012-05-23 07:59:24 +0000 | [diff] [blame] | 29 | |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 30 | void arp_init(void) |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 31 | { |
| 32 | /* XXX problem with bss workaround */ |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 33 | arp_wait_packet_ethaddr = NULL; |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 34 | net_arp_wait_packet_ip.s_addr = 0; |
| 35 | net_arp_wait_reply_ip.s_addr = 0; |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 36 | arp_wait_tx_packet_size = 0; |
| 37 | arp_tx_packet = &arp_tx_packet_buf[0] + (PKTALIGN - 1); |
| 38 | arp_tx_packet -= (ulong)arp_tx_packet % PKTALIGN; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 39 | } |
| 40 | |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 41 | void arp_raw_request(struct in_addr source_ip, const uchar *target_ethaddr, |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 42 | struct in_addr target_ip) |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 43 | { |
| 44 | uchar *pkt; |
Joe Hershberger | 738853b | 2012-05-23 07:58:08 +0000 | [diff] [blame] | 45 | struct arp_hdr *arp; |
Joe Hershberger | 00f3326 | 2012-05-23 07:59:09 +0000 | [diff] [blame] | 46 | int eth_hdr_size; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 47 | |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 48 | debug_cond(DEBUG_DEV_PKT, "ARP broadcast %d\n", arp_wait_try); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 49 | |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 50 | pkt = arp_tx_packet; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 51 | |
Joe Hershberger | 1203fcc | 2015-04-08 01:41:05 -0500 | [diff] [blame] | 52 | eth_hdr_size = net_set_ether(pkt, net_bcast_ethaddr, PROT_ARP); |
Joe Hershberger | 00f3326 | 2012-05-23 07:59:09 +0000 | [diff] [blame] | 53 | pkt += eth_hdr_size; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 54 | |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 55 | arp = (struct arp_hdr *)pkt; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 56 | |
| 57 | arp->ar_hrd = htons(ARP_ETHER); |
| 58 | arp->ar_pro = htons(PROT_IP); |
Joe Hershberger | 674bb24 | 2012-05-23 07:58:17 +0000 | [diff] [blame] | 59 | arp->ar_hln = ARP_HLEN; |
| 60 | arp->ar_pln = ARP_PLEN; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 61 | arp->ar_op = htons(ARPOP_REQUEST); |
| 62 | |
Joe Hershberger | 0adb5b7 | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 63 | memcpy(&arp->ar_sha, net_ethaddr, ARP_HLEN); /* source ET addr */ |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 64 | net_write_ip(&arp->ar_spa, source_ip); /* source IP addr */ |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 65 | memcpy(&arp->ar_tha, target_ethaddr, ARP_HLEN); /* target ET addr */ |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 66 | net_write_ip(&arp->ar_tpa, target_ip); /* target IP addr */ |
Joe Hershberger | 2280418 | 2012-05-23 08:00:11 +0000 | [diff] [blame] | 67 | |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 68 | net_send_packet(arp_tx_packet, eth_hdr_size + ARP_HDR_SIZE); |
Joe Hershberger | 2280418 | 2012-05-23 08:00:11 +0000 | [diff] [blame] | 69 | } |
| 70 | |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 71 | void arp_request(void) |
Joe Hershberger | 2280418 | 2012-05-23 08:00:11 +0000 | [diff] [blame] | 72 | { |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 73 | if ((net_arp_wait_packet_ip.s_addr & net_netmask.s_addr) != |
| 74 | (net_ip.s_addr & net_netmask.s_addr)) { |
| 75 | if (net_gateway.s_addr == 0) { |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 76 | puts("## Warning: gatewayip needed but not set\n"); |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 77 | net_arp_wait_reply_ip = net_arp_wait_packet_ip; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 78 | } else { |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 79 | net_arp_wait_reply_ip = net_gateway; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 80 | } |
| 81 | } else { |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 82 | net_arp_wait_reply_ip = net_arp_wait_packet_ip; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 83 | } |
| 84 | |
Joe Hershberger | 0adb5b7 | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 85 | arp_raw_request(net_ip, net_null_ethaddr, net_arp_wait_reply_ip); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 86 | } |
| 87 | |
Stefan Brüns | 45b4773 | 2015-08-30 17:46:54 +0200 | [diff] [blame] | 88 | int arp_timeout_check(void) |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 89 | { |
| 90 | ulong t; |
| 91 | |
Joe Hershberger | 3f02c98 | 2018-09-26 16:48:58 -0500 | [diff] [blame] | 92 | if (!arp_is_waiting()) |
Stefan Brüns | 45b4773 | 2015-08-30 17:46:54 +0200 | [diff] [blame] | 93 | return 0; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 94 | |
| 95 | t = get_timer(0); |
| 96 | |
| 97 | /* check for arp timeout */ |
Tom Rini | 5d4e863 | 2022-03-11 09:12:01 -0500 | [diff] [blame] | 98 | if ((t - arp_wait_timer_start) > CONFIG_ARP_TIMEOUT) { |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 99 | arp_wait_try++; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 100 | |
Tom Rini | 01d1b99 | 2022-03-11 09:12:02 -0500 | [diff] [blame] | 101 | if (arp_wait_try >= CONFIG_NET_RETRY_COUNT) { |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 102 | puts("\nARP Retry count exceeded; starting again\n"); |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 103 | arp_wait_try = 0; |
Stefan Brüns | 9432311 | 2015-08-30 17:46:43 +0200 | [diff] [blame] | 104 | net_set_state(NETLOOP_FAIL); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 105 | } else { |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 106 | arp_wait_timer_start = t; |
| 107 | arp_request(); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 108 | } |
| 109 | } |
Stefan Brüns | 45b4773 | 2015-08-30 17:46:54 +0200 | [diff] [blame] | 110 | return 1; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 111 | } |
| 112 | |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 113 | void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 114 | { |
Joe Hershberger | 738853b | 2012-05-23 07:58:08 +0000 | [diff] [blame] | 115 | struct arp_hdr *arp; |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 116 | struct in_addr reply_ip_addr; |
Joe Hershberger | 00f3326 | 2012-05-23 07:59:09 +0000 | [diff] [blame] | 117 | int eth_hdr_size; |
Joe Hershberger | ac3f26c | 2018-09-26 16:49:02 -0500 | [diff] [blame] | 118 | uchar *tx_packet; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 119 | |
| 120 | /* |
| 121 | * We have to deal with two types of ARP packets: |
| 122 | * - REQUEST packets will be answered by sending our |
| 123 | * IP address - if we know it. |
| 124 | * - REPLY packates are expected only after we asked |
| 125 | * for the TFTP server's or the gateway's ethernet |
| 126 | * address; so if we receive such a packet, we set |
| 127 | * the server ethernet address |
| 128 | */ |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 129 | debug_cond(DEBUG_NET_PKT, "Got ARP\n"); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 130 | |
Joe Hershberger | 738853b | 2012-05-23 07:58:08 +0000 | [diff] [blame] | 131 | arp = (struct arp_hdr *)ip; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 132 | if (len < ARP_HDR_SIZE) { |
| 133 | printf("bad length %d < %d\n", len, ARP_HDR_SIZE); |
| 134 | return; |
| 135 | } |
| 136 | if (ntohs(arp->ar_hrd) != ARP_ETHER) |
| 137 | return; |
| 138 | if (ntohs(arp->ar_pro) != PROT_IP) |
| 139 | return; |
Joe Hershberger | 674bb24 | 2012-05-23 07:58:17 +0000 | [diff] [blame] | 140 | if (arp->ar_hln != ARP_HLEN) |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 141 | return; |
Joe Hershberger | 674bb24 | 2012-05-23 07:58:17 +0000 | [diff] [blame] | 142 | if (arp->ar_pln != ARP_PLEN) |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 143 | return; |
| 144 | |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 145 | if (net_ip.s_addr == 0) |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 146 | return; |
| 147 | |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 148 | if (net_read_ip(&arp->ar_tpa).s_addr != net_ip.s_addr) |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 149 | return; |
| 150 | |
| 151 | switch (ntohs(arp->ar_op)) { |
| 152 | case ARPOP_REQUEST: |
| 153 | /* reply with our IP address */ |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 154 | debug_cond(DEBUG_DEV_PKT, "Got ARP REQUEST, return our IP\n"); |
Joe Hershberger | e711101 | 2012-05-23 07:59:16 +0000 | [diff] [blame] | 155 | eth_hdr_size = net_update_ether(et, et->et_src, PROT_ARP); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 156 | arp->ar_op = htons(ARPOP_REPLY); |
Joe Hershberger | 674bb24 | 2012-05-23 07:58:17 +0000 | [diff] [blame] | 157 | memcpy(&arp->ar_tha, &arp->ar_sha, ARP_HLEN); |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 158 | net_copy_ip(&arp->ar_tpa, &arp->ar_spa); |
Joe Hershberger | 0adb5b7 | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 159 | memcpy(&arp->ar_sha, net_ethaddr, ARP_HLEN); |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 160 | net_copy_ip(&arp->ar_spa, &net_ip); |
Joe Hershberger | c697576 | 2012-05-23 08:00:13 +0000 | [diff] [blame] | 161 | |
| 162 | #ifdef CONFIG_CMD_LINK_LOCAL |
| 163 | /* |
| 164 | * Work-around for brain-damaged Cisco equipment with |
| 165 | * arp-proxy enabled. |
| 166 | * |
| 167 | * If the requesting IP is not on our subnet, wait 5ms to |
| 168 | * reply to ARP request so that our reply will overwrite |
| 169 | * the arp-proxy's instead of the other way around. |
| 170 | */ |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 171 | if ((net_read_ip(&arp->ar_tpa).s_addr & net_netmask.s_addr) != |
| 172 | (net_read_ip(&arp->ar_spa).s_addr & net_netmask.s_addr)) |
Joe Hershberger | c697576 | 2012-05-23 08:00:13 +0000 | [diff] [blame] | 173 | udelay(5000); |
| 174 | #endif |
Joe Hershberger | ac3f26c | 2018-09-26 16:49:02 -0500 | [diff] [blame] | 175 | tx_packet = net_get_async_tx_pkt_buf(); |
| 176 | memcpy(tx_packet, et, eth_hdr_size + ARP_HDR_SIZE); |
| 177 | net_send_packet(tx_packet, eth_hdr_size + ARP_HDR_SIZE); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 178 | return; |
| 179 | |
| 180 | case ARPOP_REPLY: /* arp reply */ |
Joe Hershberger | 3f02c98 | 2018-09-26 16:48:58 -0500 | [diff] [blame] | 181 | /* are we waiting for a reply? */ |
| 182 | if (!arp_is_waiting()) |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 183 | break; |
| 184 | |
Simon Glass | 3df6cd4 | 2021-12-18 11:27:48 -0700 | [diff] [blame] | 185 | if (IS_ENABLED(CONFIG_KEEP_SERVERADDR) && |
| 186 | net_server_ip.s_addr == net_arp_wait_packet_ip.s_addr) { |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 187 | char buf[20]; |
Mike Frysinger | a0bc44e | 2012-07-10 00:41:50 +0000 | [diff] [blame] | 188 | sprintf(buf, "%pM", &arp->ar_sha); |
Simon Glass | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 189 | env_set("serveraddr", buf); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 190 | } |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 191 | |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 192 | reply_ip_addr = net_read_ip(&arp->ar_spa); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 193 | |
| 194 | /* matched waiting packet's address */ |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 195 | if (reply_ip_addr.s_addr == net_arp_wait_reply_ip.s_addr) { |
Joe Hershberger | 4ef8d53 | 2012-05-23 08:01:04 +0000 | [diff] [blame] | 196 | debug_cond(DEBUG_DEV_PKT, |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 197 | "Got ARP REPLY, set eth addr (%pM)\n", |
| 198 | arp->ar_data); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 199 | |
| 200 | /* save address for later use */ |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 201 | if (arp_wait_packet_ethaddr != NULL) |
| 202 | memcpy(arp_wait_packet_ethaddr, |
Joe Hershberger | f1d2d28 | 2012-05-23 07:59:20 +0000 | [diff] [blame] | 203 | &arp->ar_sha, ARP_HLEN); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 204 | |
Joe Hershberger | ece223b | 2012-05-23 07:59:15 +0000 | [diff] [blame] | 205 | net_get_arp_handler()((uchar *)arp, 0, reply_ip_addr, |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 206 | 0, len); |
Joe Hershberger | ece223b | 2012-05-23 07:59:15 +0000 | [diff] [blame] | 207 | |
Joe Hershberger | e94070c | 2012-05-23 07:59:24 +0000 | [diff] [blame] | 208 | /* set the mac address in the waiting packet's header |
| 209 | and transmit it */ |
Joe Hershberger | 1203fcc | 2015-04-08 01:41:05 -0500 | [diff] [blame] | 210 | memcpy(((struct ethernet_hdr *)net_tx_packet)->et_dest, |
| 211 | &arp->ar_sha, ARP_HLEN); |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 212 | net_send_packet(net_tx_packet, arp_wait_tx_packet_size); |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 213 | |
| 214 | /* no arp request pending now */ |
Joe Hershberger | 049a95a | 2015-04-08 01:41:01 -0500 | [diff] [blame] | 215 | net_arp_wait_packet_ip.s_addr = 0; |
Joe Hershberger | 85d25e0 | 2015-04-08 01:41:08 -0500 | [diff] [blame] | 216 | arp_wait_tx_packet_size = 0; |
| 217 | arp_wait_packet_ethaddr = NULL; |
Joe Hershberger | d280d3f | 2012-05-23 07:58:01 +0000 | [diff] [blame] | 218 | } |
| 219 | return; |
| 220 | default: |
| 221 | debug("Unexpected ARP opcode 0x%x\n", |
| 222 | ntohs(arp->ar_op)); |
| 223 | return; |
| 224 | } |
| 225 | } |
Joe Hershberger | 3f02c98 | 2018-09-26 16:48:58 -0500 | [diff] [blame] | 226 | |
| 227 | bool arp_is_waiting(void) |
| 228 | { |
| 229 | return !!net_arp_wait_packet_ip.s_addr; |
| 230 | } |