diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-23 07:59:14 +0000 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-23 17:46:21 -0500 |
commit | 22f6e99d5b0c54758646334c1153737a5585bd57 (patch) | |
tree | e70b3679ff62e93345fc0f7e3960d37582cea612 /net/ping.c | |
parent | adf5d93e441eb3eacd8c0430d6064b35d47ad2a5 (diff) | |
download | u-boot-imx-22f6e99d5b0c54758646334c1153737a5585bd57.zip u-boot-imx-22f6e99d5b0c54758646334c1153737a5585bd57.tar.gz u-boot-imx-22f6e99d5b0c54758646334c1153737a5585bd57.tar.bz2 |
net: Refactor to protect access to the NetState variable
Changes to NetState now go through an accessor function called
net_set_state()
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net/ping.c')
-rw-r--r-- | net/ping.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -72,7 +72,7 @@ static int ping_send(void) static void ping_timeout(void) { eth_halt(); - NetState = NETLOOP_FAIL; /* we did not get the reply */ + net_set_state(NETLOOP_FAIL); /* we did not get the reply */ } void ping_start(void) @@ -92,7 +92,7 @@ void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) case ICMP_ECHO_REPLY: src_ip = NetReadIP((void *)&ip->ip_src); if (src_ip == NetPingIP) - NetState = NETLOOP_SUCCESS; + net_set_state(NETLOOP_SUCCESS); return; case ICMP_ECHO_REQUEST: debug("Got ICMP ECHO REQUEST, return " |