From owner-svn-src-head@FreeBSD.ORG Mon Jun 6 10:39:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 992F8106566B; Mon, 6 Jun 2011 10:39:38 +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 890A38FC13; Mon, 6 Jun 2011 10:39:38 +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 p56Adc9r027204; Mon, 6 Jun 2011 10:39:38 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p56Adccf027202; Mon, 6 Jun 2011 10:39:38 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106061039.p56Adccf027202@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 6 Jun 2011 10:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222742 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 10:39:38 -0000 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; }