Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jun 2011 12:32:59 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r223333 - stable/8/sys/netinet/ipfw
Message-ID:  <201106201232.p5KCWxV3049852@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon Jun 20 12:32:59 2011
New Revision: 223333
URL: http://svn.freebsd.org/changeset/base/223333

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

Modified:
  stable/8/sys/netinet/ipfw/ip_fw_sockopt.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet/ipfw/ip_fw_sockopt.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw_sockopt.c	Mon Jun 20 12:22:30 2011	(r223332)
+++ stable/8/sys/netinet/ipfw/ip_fw_sockopt.c	Mon Jun 20 12:32:59 2011	(r223333)
@@ -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?201106201232.p5KCWxV3049852>