mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 4/4] net: resolv: Make argument const
Date: Mon, 14 Dec 2015 11:41:14 +0100	[thread overview]
Message-ID: <1450089674-25721-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1450089674-25721-1-git-send-email-s.hauer@pengutronix.de>

resolv() is not allowed to change the hostname argument, make it const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/net.h | 4 ++--
 net/dns.c     | 4 ++--
 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;
-- 
2.6.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2015-12-14 10:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 10:41 [PATCH 1/4] net: dhcp: unify options and params Sascha Hauer
2015-12-14 10:41 ` [PATCH 2/4] net: dhcp: simplify dhcp_options_process Sascha Hauer
2015-12-14 10:41 ` [PATCH 3/4] net: dhcp: make unmodified variable const Sascha Hauer
2015-12-14 10:41 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450089674-25721-4-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox