From owner-svn-src-stable@FreeBSD.ORG Mon Jun 20 12:32:59 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6520F106566C; Mon, 20 Jun 2011 12:32:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54CD38FC15; Mon, 20 Jun 2011 12:32:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KCWxgM049854; Mon, 20 Jun 2011 12:32:59 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KCWxV3049852; Mon, 20 Jun 2011 12:32:59 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106201232.p5KCWxV3049852@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 20 Jun 2011 12:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223333 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 12:32:59 -0000 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; }