audit: use define's for audit version
authorEric Paris <eparis@redhat.com>
Mon, 13 Jan 2014 21:48:45 +0000 (16:48 -0500)
committerEric Paris <eparis@redhat.com>
Tue, 14 Jan 2014 03:33:36 +0000 (22:33 -0500)
Give names to the audit versions.  Just something for a userspace
programmer to know what the version provides.

Signed-off-by: Eric Paris <eparis@redhat.com>
include/uapi/linux/audit.h
kernel/audit.c

index 14afb0d22902ff5c9f5b614aa84f4222b0977a7c..3e1fbe933016dd6620e260550382205568482f2a 100644 (file)
@@ -320,6 +320,11 @@ enum {
 #define AUDIT_STATUS_RATE_LIMIT                0x0008
 #define AUDIT_STATUS_BACKLOG_LIMIT     0x0010
 #define AUDIT_STATUS_BACKLOG_WAIT_TIME 0x0020
+
+#define AUDIT_VERSION_BACKLOG_LIMIT    1
+#define AUDIT_VERSION_BACKLOG_WAIT_TIME        2
+#define AUDIT_VERSION_LATEST AUDIT_VERSION_BACKLOG_WAIT_TIME
+
                                /* Failure-to-log actions */
 #define AUDIT_FAIL_SILENT      0
 #define AUDIT_FAIL_PRINTK      1
index 57d47f08ed15d92f8f89048f5de4ef0bfe003bbc..b6717231d3d40e25a44e02cc4caf676926b7c91d 100644 (file)
@@ -792,7 +792,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                s.backlog_limit         = audit_backlog_limit;
                s.lost                  = atomic_read(&audit_lost);
                s.backlog               = skb_queue_len(&audit_skb_queue);
-               s.version               = 2;
+               s.version               = AUDIT_VERSION_LATEST;
                s.backlog_wait_time     = audit_backlog_wait_time;
                audit_send_reply(NETLINK_CB(skb).portid, seq, AUDIT_GET, 0, 0,
                                 &s, sizeof(s));