summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-12-11 15:41:46 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-12-14 11:40:50 +0100
commit39698df6f7623fca8f6bdb500625e8da2fcd54f5 (patch)
tree3a470b3ceb23c4eecdeb0cdd5faee32d82bd87e1
parent7065fa32cac8af222bffc2ce9256931beaa2acfc (diff)
downloadbarebox-39698df6f7623fca8f6bdb500625e8da2fcd54f5.tar.gz
net: resolv: Make argument const
resolv() is not allowed to change the hostname argument, make it const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--include/net.h4
-rw-r--r--net/dns.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/net.h b/include/net.h
index 2a37a43..13e335a 100644
--- a/include/net.h
+++ b/include/net.h
@@ -315,9 +315,9 @@ int string_to_ethaddr(const char *str, u8 enetaddr[6]);
void ethaddr_to_string(const u8 enetaddr[6], char *str);
#ifdef CONFIG_NET_RESOLV
-IPaddr_t resolv(char *host);
+IPaddr_t resolv(const char *host);
#else
-static inline IPaddr_t resolv(char *host)
+static inline IPaddr_t resolv(const char *host)
{
IPaddr_t ip = 0;
string_to_ip(host, &ip);
diff --git a/net/dns.c b/net/dns.c
index 0e16ea2..5488e9f 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -59,7 +59,7 @@ static uint64_t dns_timer_start;
static int dns_state;
static IPaddr_t dns_ip;
-static int dns_send(char *name)
+static int dns_send(const char *name)
{
int ret;
struct header *header;
@@ -199,7 +199,7 @@ static void dns_handler(void *ctx, char *packet, unsigned len)
net_eth_to_udplen(packet));
}
-IPaddr_t resolv(char *host)
+IPaddr_t resolv(const char *host)
{
IPaddr_t ip;
const char *ns;