Author: ae
Date: Sun Aug 14 18:34:16 2016
New Revision: 304089
URL: https://svnweb.freebsd.org/changeset/base/304089

Log:
  Add an ability to attach comment to check-state rules.
  
  MFC after:    1 week

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==============================================================================
--- head/sbin/ipfw/ipfw2.c      Sun Aug 14 18:30:30 2016        (r304088)
+++ head/sbin/ipfw/ipfw2.c      Sun Aug 14 18:34:16 2016        (r304089)
@@ -4120,8 +4120,17 @@ chkarg:
                cmd = next_cmd(cmd, &cblen);
        }
 
-       if (have_state) /* must be a check-state, we are done */
+       if (have_state) { /* must be a check-state, we are done */
+               if (*av != NULL &&
+                   match_token(rule_options, *av) == TOK_COMMENT) {
+                       /* check-state has a comment */
+                       av++;
+                       fill_comment(cmd, av, cblen);
+                       cmd = next_cmd(cmd, &cblen);
+                       av[0] = NULL;
+               }
                goto done;
+       }
 
 #define OR_START(target)                                       \
        if (av[0] && (*av[0] == '(' || *av[0] == '{')) {        \
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to