summaryrefslogtreecommitdiff
path: root/net/dns.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-05-23 07:59:14 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2012-05-23 17:46:21 -0500
commit22f6e99d5b0c54758646334c1153737a5585bd57 (patch)
treee70b3679ff62e93345fc0f7e3960d37582cea612 /net/dns.c
parentadf5d93e441eb3eacd8c0430d6064b35d47ad2a5 (diff)
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/dns.c')
-rw-r--r--net/dns.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/dns.c b/net/dns.c
index cc7ed51691..cc0aa0a2dc 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -98,7 +98,7 @@ static void
DnsTimeout(void)
{
puts("Timeout\n");
- NetState = NETLOOP_FAIL;
+ net_set_state(NETLOOP_FAIL);
}
static void
@@ -128,7 +128,7 @@ DnsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len)
/* Received 0 answers */
if (header->nanswers == 0) {
puts("DNS: host not found\n");
- NetState = NETLOOP_SUCCESS;
+ net_set_state(NETLOOP_SUCCESS);
return;
}
@@ -141,7 +141,7 @@ DnsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len)
/* We sent query class 1, query type 1 */
if (&p[5] > e || get_unaligned_be16(p+1) != DNS_A_RECORD) {
puts("DNS: response was not an A record\n");
- NetState = NETLOOP_SUCCESS;
+ net_set_state(NETLOOP_SUCCESS);
return;
}
@@ -191,7 +191,7 @@ DnsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len)
puts("server responded with invalid IP number\n");
}
- NetState = NETLOOP_SUCCESS;
+ net_set_state(NETLOOP_SUCCESS);
}
void