diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/arp.c | 3 | ||||
-rw-r--r-- | net/eth-uclass.c | 4 | ||||
-rw-r--r-- | net/net.c | 3 | ||||
-rw-r--r-- | net/nfs.c | 2 | ||||
-rw-r--r-- | net/ping.c | 3 |
5 files changed, 11 insertions, 4 deletions
@@ -182,7 +182,8 @@ void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) (net_read_ip(&arp->ar_spa).s_addr & net_netmask.s_addr)) udelay(5000); #endif - net_send_packet((uchar *)et, eth_hdr_size + ARP_HDR_SIZE); + memcpy(net_tx_packet, et, eth_hdr_size + ARP_HDR_SIZE); + net_send_packet(net_tx_packet, eth_hdr_size + ARP_HDR_SIZE); return; case ARPOP_REPLY: /* arp reply */ diff --git a/net/eth-uclass.c b/net/eth-uclass.c index d20a1cf160..e4b49229e3 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -395,7 +395,7 @@ int eth_initialize(void) * This is accomplished by attempting to probe each device and calling * their write_hwaddr() operation. */ - uclass_first_device(UCLASS_ETH, &dev); + uclass_first_device_check(UCLASS_ETH, &dev); if (!dev) { printf("No ethernet found.\n"); bootstage_error(BOOTSTAGE_ID_NET_ETH_START); @@ -424,7 +424,7 @@ int eth_initialize(void) eth_write_hwaddr(dev); - uclass_next_device(&dev); + uclass_next_device_check(&dev); num_devices++; } while (dev); @@ -393,6 +393,7 @@ void net_init(void) int net_loop(enum proto_t protocol) { int ret = -EINVAL; + enum net_loop_state prev_net_state = net_state; net_restarted = 0; net_dev_exists = 0; @@ -430,6 +431,7 @@ restart: case 1: /* network not configured */ eth_halt(); + net_set_state(prev_net_state); return -ENODEV; case 2: @@ -655,6 +657,7 @@ done: net_set_udp_handler(NULL); net_set_icmp_handler(NULL); #endif + net_set_state(prev_net_state); return ret; } @@ -822,6 +822,8 @@ static void nfs_handler(uchar *pkt, unsigned dest, struct in_addr sip, case STATE_READ_REQ: rlen = nfs_read_reply(pkt, len); + if (rlen == -NFS_RPC_DROP) + break; net_set_timeout_handler(nfs_timeout, nfs_timeout_handler); if (rlen > 0) { nfs_offset += rlen; diff --git a/net/ping.c b/net/ping.c index 5464f2f785..3e5461a36a 100644 --- a/net/ping.c +++ b/net/ping.c @@ -107,7 +107,8 @@ void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) icmph->type = ICMP_ECHO_REPLY; icmph->checksum = 0; icmph->checksum = compute_ip_checksum(icmph, len - IP_HDR_SIZE); - net_send_packet((uchar *)et, eth_hdr_size + len); + memcpy(net_tx_packet, et, eth_hdr_size + len); + net_send_packet(net_tx_packet, eth_hdr_size + len); return; /* default: return;*/ |