--- accounting.bak	2007-02-10 23:01:53.000000000 +0100
+++ accounting	2007-02-25 14:27:53.000000000 +0100
@@ -96,6 +96,12 @@
 #					#removed from Netfilter in kernel
 #					#version 2.6.14).
 #
+#       MARK -- (Optional)      If you wish to restrict this entry to packets
+#                               marked with a particular mark value.
+#                               mark/mask values are acceptable.
+#                               You can prepend "!" to the mark value to invert
+#                               the sense of this rule.
+#
 #	In all of the above columns except ACTION and CHAIN, the values "-",
 #	"any" and "all" may be used as wildcards. Trailing omitted columns are
 #	also treated as wildcards.
@@ -104,6 +110,6 @@
 # additional information about how to use this file.
 #
 #####################################################################################
-#ACTION	CHAIN	SOURCE		DESTINATION	PROTO	DEST		SOURCE	USER/
+#ACTION	CHAIN	SOURCE		DESTINATION	PROTO	DEST		SOURCE	USER/	MARK
 #							PORT(S)		PORT(S)	GROUP
 #LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
--- compiler.bak	2007-02-25 12:44:26.000000000 +0100
+++ compiler	2007-02-25 14:27:42.000000000 +0100
@@ -2795,11 +2795,11 @@
     user1=
 
     accounting_error() {
-	error_message "WARNING: Invalid Accounting rule" $action $chain $source $dest $proto $port $sport $user
+	error_message "WARNING: Invalid Accounting rule" $action $chain $source $dest $proto $port $sport $user $mark
     }
 
     accounting_interface_error() {
-	error_message "WARNING: Unknown interface $1 in " $action $chain $source $dest $proto $port $sport $user
+	error_message "WARNING: Unknown interface $1 in " $action $chain $source $dest $proto $port $sport $user $mark
     }
 
     accounting_interface_verify() {
@@ -2955,6 +2955,18 @@
 	    ;;
     esac
 
+    [ -n "$mark" ] && case $mark in
+        -|any|all)
+            mark=
+            ;;
+        !*)
+            rule="$rule -m mark ! --mark ${mark#*!}"
+            ;;
+        *)
+            rule="$rule -m mark --mark $mark"
+            ;;
+    esac
+
     case $action in
 	COUNT)
 	    ;;
@@ -3001,8 +3013,8 @@
 
     strip_file accounting $1
 
-    while read action chain source dest proto port sport user ; do
-	expandv action chain source dest proto port sport user
+    while read action chain source dest proto port sport user mark ; do
+	expandv action chain source dest proto port sport user mark
 	process_accounting_rule
     done < $TMP_DIR/accounting
 
