X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=net%2Farp.c;h=990b771c92118c330fc3f544464bfef96aa482e9;hb=f8c987f8f127f867d96ca74bcd1fcb11d8265b67;hp=b1f12bf10ddf1cb1affb1845a24e7f478f049cfd;hpb=943231119f3caaaca7db4c588e4f3e9a6cec426a;p=u-boot diff --git a/net/arp.c b/net/arp.c index b1f12bf10d..990b771c92 100644 --- a/net/arp.c +++ b/net/arp.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copied from Linux Monitor (LiMon) - Networking. * @@ -6,7 +7,6 @@ * Copyright 2000 Roland Borde * Copyright 2000 Paolo Scaffardi * Copyright 2000-2002 Wolfgang Denk, wd@denx.de - * SPDX-License-Identifier: GPL-2.0 */ #include @@ -96,12 +96,12 @@ void arp_request(void) arp_raw_request(net_ip, net_null_ethaddr, net_arp_wait_reply_ip); } -void arp_timeout_check(void) +int arp_timeout_check(void) { ulong t; if (!net_arp_wait_packet_ip.s_addr) - return; + return 0; t = get_timer(0); @@ -118,13 +118,13 @@ void arp_timeout_check(void) arp_request(); } } + return 1; } void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) { struct arp_hdr *arp; struct in_addr reply_ip_addr; - uchar *pkt; int eth_hdr_size; /* @@ -162,9 +162,7 @@ void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) case ARPOP_REQUEST: /* reply with our IP address */ debug_cond(DEBUG_DEV_PKT, "Got ARP REQUEST, return our IP\n"); - pkt = (uchar *)et; eth_hdr_size = net_update_ether(et, et->et_src, PROT_ARP); - pkt += eth_hdr_size; arp->ar_op = htons(ARPOP_REPLY); memcpy(&arp->ar_tha, &arp->ar_sha, ARP_HLEN); net_copy_ip(&arp->ar_tpa, &arp->ar_spa); @@ -196,7 +194,7 @@ void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) if (net_server_ip.s_addr == net_arp_wait_packet_ip.s_addr) { char buf[20]; sprintf(buf, "%pM", &arp->ar_sha); - setenv("serveraddr", buf); + env_set("serveraddr", buf); } #endif