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

Reply via email to