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;
                }
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to