From 049a95a7759c0e384c1fc7b8575d968d56a33997 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 8 Apr 2015 01:41:01 -0500 Subject: net: cosmetic: Change IPaddr_t to struct in_addr This patch is simply clean-up to make the IPv4 type that is used match what Linux uses. It also attempts to move all variables that are IP addresses use good naming instead of CamelCase. No functional change. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- net/dns.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'net/dns.c') diff --git a/net/dns.c b/net/dns.c index dd45320150..6f8b1f2596 100644 --- a/net/dns.c +++ b/net/dns.c @@ -5,7 +5,7 @@ * Copyright (c) 2009 Robin Getz * * This is a simple DNS implementation for U-Boot. It will use the first IP - * in the DNS response as NetServerIP. This can then be used for any other + * in the DNS response as net_server_ip. This can then be used for any other * network related activities. * * The packet handling is partly based on TADNS, original copyrights @@ -89,8 +89,8 @@ DnsSend(void) DnsOurPort = random_port(); - NetSendUDPPacket(NetServerEther, NetOurDNSIP, DNS_SERVICE_PORT, - DnsOurPort, n); + NetSendUDPPacket(NetServerEther, net_dns_server, DNS_SERVICE_PORT, + DnsOurPort, n); debug("DNS packet sent\n"); } @@ -101,15 +101,15 @@ DnsTimeout(void) net_set_state(NETLOOP_FAIL); } -static void -DnsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len) +static void dns_handler(uchar *pkt, unsigned dest, struct in_addr sip, + unsigned src, unsigned len) { struct header *header; const unsigned char *p, *e, *s; u16 type, i; int found, stop, dlen; char IPStr[22]; - IPaddr_t IPAddress; + struct in_addr ip_addr; debug("%s\n", __func__); @@ -180,10 +180,10 @@ DnsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len) dlen = get_unaligned_be16(p+10); p += 12; - memcpy(&IPAddress, p, 4); + memcpy(&ip_addr, p, 4); if (p + dlen <= e) { - ip_to_string(IPAddress, IPStr); + ip_to_string(ip_addr, IPStr); printf("%s\n", IPStr); if (NetDNSenvvar) setenv(NetDNSenvvar, IPStr); @@ -200,7 +200,7 @@ DnsStart(void) debug("%s\n", __func__); NetSetTimeout(DNS_TIMEOUT, DnsTimeout); - net_set_udp_handler(DnsHandler); + net_set_udp_handler(dns_handler); /* Clear a previous MAC address, the server IP might have changed. */ memset(NetServerEther, 0, sizeof(NetServerEther)); -- cgit v1.2.1