Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jun 2009 14:21:14 +0000 (UTC)
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r194624 - stable/7/sbin/ipfw
Message-ID:  <200906221421.n5MELEQU043388@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Mon Jun 22 14:21:14 2009
New Revision: 194624
URL: http://svn.freebsd.org/changeset/base/194624

Log:
  MFC: various minor fixes including
  - use a format string in a printf()
  - move a variable declaration at the beginning of a block
  - const-ify strings
  - fix prototypes

Modified:
  stable/7/sbin/ipfw/altq.c
  stable/7/sbin/ipfw/dummynet.c
  stable/7/sbin/ipfw/ipfw2.c
  stable/7/sbin/ipfw/main.c
  stable/7/sbin/ipfw/nat.c

Modified: stable/7/sbin/ipfw/altq.c
==============================================================================
--- stable/7/sbin/ipfw/altq.c	Mon Jun 22 13:46:00 2009	(r194623)
+++ stable/7/sbin/ipfw/altq.c	Mon Jun 22 14:21:14 2009	(r194624)
@@ -121,7 +121,7 @@ altq_name_to_qid(const char *name)
 	return altq->qid;
 }
 
-const char *
+static const char *
 altq_qid_to_name(u_int32_t qid)
 {
 	struct pf_altq *altq;

Modified: stable/7/sbin/ipfw/dummynet.c
==============================================================================
--- stable/7/sbin/ipfw/dummynet.c	Mon Jun 22 13:46:00 2009	(r194623)
+++ stable/7/sbin/ipfw/dummynet.c	Mon Jun 22 14:21:14 2009	(r194624)
@@ -297,8 +297,6 @@ ipfw_list_pipes(void *data, uint nbytes,
 		sprintf(prefix, "%05d: %s %4d ms ",
 		    p->pipe_nr, buf, p->delay);
 		print_flowset_parms(&(p->fs), prefix);
-		if (co.verbose)
-			printf("   V %20llu\n", align_uint64(&p->V) >> MY_M);
 
 		q = (struct dn_flow_queue *)(p+1);
 		list_queues(&(p->fs), q);

Modified: stable/7/sbin/ipfw/ipfw2.c
==============================================================================
--- stable/7/sbin/ipfw/ipfw2.c	Mon Jun 22 13:46:00 2009	(r194623)
+++ stable/7/sbin/ipfw/ipfw2.c	Mon Jun 22 14:21:14 2009	(r194624)
@@ -507,7 +507,7 @@ print_newports(ipfw_insn_u16 *cmd, int p
 	}
 	sep = " ";
 	for (i = F_LEN((ipfw_insn *)cmd) - 1; i > 0; i--, p += 2) {
-		printf(sep);
+		printf("%s", sep);
 		print_port(proto, p[0]);
 		if (p[0] != p[1]) {
 			printf("-");

Modified: stable/7/sbin/ipfw/main.c
==============================================================================
--- stable/7/sbin/ipfw/main.c	Mon Jun 22 13:46:00 2009	(r194623)
+++ stable/7/sbin/ipfw/main.c	Mon Jun 22 14:21:14 2009	(r194624)
@@ -104,6 +104,7 @@ ipfw_main(int oldac, char **oldav)
 	const char *errstr;
 	char **av, **save_av;
 	int do_acct = 0;		/* Show packet/byte count */
+	int try_next = 0;
 
 #define WHITESP		" \t\f\v\n\r"
 	if (oldac < 2)
@@ -332,7 +333,6 @@ ipfw_main(int oldac, char **oldav)
 		av[1] = p;
 	}
 
-	int try_next = 0;
 	if (co.use_set == 0) {
 		if (_substrcmp(*av, "add") == 0)
 			ipfw_add(ac, av);

Modified: stable/7/sbin/ipfw/nat.c
==============================================================================
--- stable/7/sbin/ipfw/nat.c	Mon Jun 22 13:46:00 2009	(r194623)
+++ stable/7/sbin/ipfw/nat.c	Mon Jun 22 14:21:14 2009	(r194624)
@@ -384,7 +384,7 @@ nospace:
 }
 
 static int
-setup_redir_port(char *spool_buf, int len,
+setup_redir_port(char *spool_buf, unsigned int len,
 		 int *_ac, char ***_av) 
 {
 	char **av, *sep, *protoName;
@@ -575,7 +575,7 @@ nospace:
 }
 
 static int
-setup_redir_proto(char *spool_buf, int len,
+setup_redir_proto(char *spool_buf, unsigned int len,
 		 int *_ac, char ***_av) 
 {
 	char **av;
@@ -858,8 +858,8 @@ ipfw_config_nat(int ac, char **av)
 	if (!co.do_quiet) {
 		/* After every modification, we show the resultant rule. */
 		int _ac = 3;
-		char *_av[] = {"show", "config", id};
-		ipfw_show_nat(_ac, _av);
+		const char *_av[] = {"show", "config", id};
+		ipfw_show_nat(_ac, (char **)(void *)_av);
 	}
 }
 



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