Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Sep 2015 07:37:01 +0000 (UTC)
From:      Poul-Henning Kamp <phk@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r288212 - head/sbin/natd
Message-ID:  <201509250737.t8P7b1Zl002439@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: phk
Date: Fri Sep 25 07:37:00 2015
New Revision: 288212
URL: https://svnweb.freebsd.org/changeset/base/288212

Log:
  Fix two cases where "const" were washed off pointers with strchr(3)

Modified:
  head/sbin/natd/natd.c

Modified: head/sbin/natd/natd.c
==============================================================================
--- head/sbin/natd/natd.c	Fri Sep 25 07:27:23 2015	(r288211)
+++ head/sbin/natd/natd.c	Fri Sep 25 07:37:00 2015	(r288212)
@@ -124,7 +124,7 @@ static void	StrToAddr (const char* str, 
 static u_short  StrToPort (const char* str, const char* proto);
 static int      StrToPortRange (const char* str, const char* proto, port_range *portRange);
 static int 	StrToProto (const char* str);
-static int      StrToAddrAndPortRange (const char* str, struct in_addr* addr, char* proto, port_range *portRange);
+static int      StrToAddrAndPortRange (char* str, struct in_addr* addr, char* proto, port_range *portRange);
 static void	ParseArgs (int argc, char** argv);
 static void	SetupPunchFW(const char *strValue);
 static void	SetupSkinnyPort(const char *strValue);
@@ -1896,7 +1896,7 @@ u_short StrToPort (const char* str, cons
 
 int StrToPortRange (const char* str, const char* proto, port_range *portRange)
 {
-	char*           sep;
+	const char*	sep;
 	struct servent*	sp;
 	char*		end;
 	u_short         loPort;
@@ -1938,7 +1938,8 @@ int StrToPortRange (const char* str, con
 }
 
 
-int StrToProto (const char* str)
+static int
+StrToProto (const char* str)
 {
 	if (!strcmp (str, "tcp"))
 		return IPPROTO_TCP;
@@ -1949,7 +1950,8 @@ int StrToProto (const char* str)
 	errx (1, "unknown protocol %s. Expected tcp or udp", str);
 }
 
-int StrToAddrAndPortRange (const char* str, struct in_addr* addr, char* proto, port_range *portRange)
+static int
+StrToAddrAndPortRange (char* str, struct in_addr* addr, char* proto, port_range *portRange)
 {
 	char*	ptr;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509250737.t8P7b1Zl002439>