summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/arp.c3
-rw-r--r--net/eth-uclass.c4
-rw-r--r--net/net.c3
-rw-r--r--net/nfs.c2
-rw-r--r--net/ping.c3
5 files changed, 11 insertions, 4 deletions
diff --git a/net/arp.c b/net/arp.c
index 990b771c92..b8a71684cd 100644
--- a/net/arp.c
+++ b/net/arp.c
@@ -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);
diff --git a/net/net.c b/net/net.c
index a4932f46d9..b4563a4cab 100644
--- a/net/net.c
+++ b/net/net.c
@@ -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;
}
diff --git a/net/nfs.c b/net/nfs.c
index 83ed0a7c37..9a16765ba1 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -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;*/