svn commit: r320232 - head/contrib/ipfilter/tools

Cy Schubert cy at FreeBSD.org
Thu Jun 22 12:46:49 UTC 2017


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' :


More information about the svn-src-all mailing list