Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jun 2017 12:46:48 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320232 - head/contrib/ipfilter/tools
Message-ID:  <201706221246.v5MCkmZX019415@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Thu Jun 22 12:46:48 2017
New Revision: 320232
URL: https://svnweb.freebsd.org/changeset/base/320232

Log:
  In poolnodcommand(): TTL (-T) is only valid when adding a node to a
  pool (ippool -a) not when removing a node from a pool (ippool -r).
  Flag -T as an error in ippool -r.

Modified:
  head/contrib/ipfilter/tools/ippool.c

Modified: head/contrib/ipfilter/tools/ippool.c
==============================================================================
--- head/contrib/ipfilter/tools/ippool.c	Thu Jun 22 11:03:42 2017	(r320231)
+++ head/contrib/ipfilter/tools/ippool.c	Thu Jun 22 12:46:48 2017	(r320232)
@@ -201,10 +201,14 @@ poolnodecommand(remove, argc, argv)
 			}
 			break;
 		case 'T' :
-			ttl = atoi(optarg);
-			if (ttl < 0) {
-				fprintf(stderr, "cannot set negative ttl\n");
-				return -1;
+			if (remove == 0) {
+				ttl = atoi(optarg);
+				if (ttl < 0) {
+					fprintf(stderr, "cannot set negative ttl\n");
+					return -1;
+				}
+			} else {
+				usage(argv[0]);
 			}
 			break;
 		case 'v' :



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