Module Name:    src
Committed By:   maxv
Date:           Mon May 28 19:36:42 UTC 2018

Modified Files:
        src/crypto/dist/ipsec-tools/src/libipsec: pfkey_dump.c policy_parse.y

Log Message:
fix -Wdiscarded-qualifiers


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
    src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c
cvs rdiff -u -r1.12 -r1.13 \
    src/crypto/dist/ipsec-tools/src/libipsec/policy_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c
diff -u src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c:1.22 src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c:1.23
--- src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c:1.22	Mon May 28 19:22:40 2018
+++ src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c	Mon May 28 19:36:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfkey_dump.c,v 1.22 2018/05/28 19:22:40 maxv Exp $	*/
+/*	$NetBSD: pfkey_dump.c,v 1.23 2018/05/28 19:36:42 maxv Exp $	*/
 
 /*	$KAME: pfkey_dump.c,v 1.45 2003/09/08 10:14:56 itojun Exp $	*/
 
@@ -105,12 +105,12 @@ do { \
 		printf("%u ", (num)); \
 } while (/*CONSTCOND*/0)
 
-static char *str_ipaddr __P((struct sockaddr *));
-static char *str_ipport __P((struct sockaddr *));
-static char *str_prefport __P((u_int, u_int, u_int, u_int));
+static const char *str_ipaddr __P((struct sockaddr *));
+static const char *str_ipport __P((struct sockaddr *));
+static const char *str_prefport __P((u_int, u_int, u_int, u_int));
 static void str_upperspec __P((u_int, u_int, u_int));
 static char *str_time __P((time_t));
-static void str_lifetime_byte __P((struct sadb_lifetime *, char *));
+static void str_lifetime_byte __P((struct sadb_lifetime *, const char *));
 static void pfkey_sadump1(struct sadb_msg *, int);
 static void pfkey_spdump1(struct sadb_msg *, int);
 
@@ -122,7 +122,7 @@ struct val2str {
 /*
  * Must to be re-written about following strings.
  */
-static char *str_satype[] = {
+static const char *str_satype[] = {
 	"unspec",
 	"unknown",
 	"ah",
@@ -137,13 +137,13 @@ static char *str_satype[] = {
 	"tcp",
 };
 
-static char *str_mode[] = {
+static const char *str_mode[] = {
 	"any",
 	"transport",
 	"tunnel",
 };
 
-static char *str_state[] = {
+static const char *str_state[] = {
 	"larval",
 	"mature",
 	"dying",
@@ -661,7 +661,7 @@ pfkey_spdump1(struct sadb_msg *m, int wi
 /*
  * set "ipaddress" to buffer.
  */
-static char *
+static const char *
 str_ipaddr(struct sockaddr *sa)
 {
 	static char buf[NI_MAXHOST];
@@ -679,7 +679,7 @@ str_ipaddr(struct sockaddr *sa)
 /*
  * set "port" to buffer.
  */
-static char *
+static const char *
 str_ipport(struct sockaddr *sa)
 {
 	static char buf[NI_MAXHOST];
@@ -698,7 +698,7 @@ str_ipport(struct sockaddr *sa)
 /*
  * set "/prefix[port number]" to buffer.
  */
-static char *
+static const char *
 str_prefport(u_int family, u_int pref, u_int port, u_int ulp)
 {
 	static char buf[128];
@@ -793,10 +793,10 @@ str_time(time_t t)
 }
 
 static void
-str_lifetime_byte(struct sadb_lifetime *x, char *str)
+str_lifetime_byte(struct sadb_lifetime *x, const char *str)
 {
 	double y;
-	char *unit;
+	const char *unit;
 	int w;
 
 	if (x == NULL) {

Index: src/crypto/dist/ipsec-tools/src/libipsec/policy_parse.y
diff -u src/crypto/dist/ipsec-tools/src/libipsec/policy_parse.y:1.12 src/crypto/dist/ipsec-tools/src/libipsec/policy_parse.y:1.13
--- src/crypto/dist/ipsec-tools/src/libipsec/policy_parse.y:1.12	Mon May 28 19:22:40 2018
+++ src/crypto/dist/ipsec-tools/src/libipsec/policy_parse.y	Mon May 28 19:36:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: policy_parse.y,v 1.12 2018/05/28 19:22:40 maxv Exp $	*/
+/*	$NetBSD: policy_parse.y,v 1.13 2018/05/28 19:36:42 maxv Exp $	*/
 
 /*	$KAME: policy_parse.y,v 1.21 2003/12/12 08:01:26 itojun Exp $	*/
 
@@ -107,7 +107,7 @@ static struct sockaddr *p_src = NULL;
 static struct sockaddr *p_dst = NULL;
 
 struct _val;
-extern void yyerror __P((char *msg));
+extern void yyerror __P((const char *msg));
 static struct sockaddr *parse_sockaddr __P((struct _val *addrbuf,
     struct _val *portbuf));
 static int rule_check __P((void));
@@ -362,7 +362,7 @@ addresses
 %%
 
 void
-yyerror(char *msg)
+yyerror(const char *msg)
 {
 	fprintf(stderr, "libipsec: %s while parsing \"%s\"\n",
 		msg, __libipsectext);

Reply via email to