Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jun 2011 10:39:38 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222742 - head/sys/netinet/ipfw
Message-ID:  <201106061039.p56Adccf027202@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon Jun  6 10:39:38 2011
New Revision: 222742
URL: http://svn.freebsd.org/changeset/base/222742

Log:
  Do not return EINVAL when user does `ipfw set N flush` on an empty set.
  
  MFC after:	2 weeks

Modified:
  head/sys/netinet/ipfw/ip_fw_sockopt.c

Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_sockopt.c	Mon Jun  6 09:36:46 2011	(r222741)
+++ head/sys/netinet/ipfw/ip_fw_sockopt.c	Mon Jun  6 10:39:38 2011	(r222742)
@@ -349,12 +349,13 @@ del_entry(struct ip_fw_chain *chain, uin
 		}
 
 		if (n == 0) {
-			/* A flush request (arg == 0) on empty ruleset
-			 * returns with no error. On the contrary,
+			/* A flush request (arg == 0 or cmd == 1) on empty
+			 * ruleset returns with no error. On the contrary,
 			 * if there is no match on a specific request,
 			 * we return EINVAL.
 			 */
-			error = (arg == 0) ? 0 : EINVAL;
+			if (arg != 0 && cmd != 1)
+				error = EINVAL;
 			break;
 		}
 



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