Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9ab4c954ce2b2b3c485bee7e425fda05946893be
Commit:     9ab4c954ce2b2b3c485bee7e425fda05946893be
Parent:     a18aa31b7774d8b36048e256a02d9d689533fc96
Author:     Paul Moore <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 12 11:10:16 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Fri Dec 14 13:54:35 2007 -0800

    [XFRM]: Display the audited SPI value in host byte order.
    
    Currently the IPsec protocol SPI values are written to the audit log in
    network byte order which is different from almost all other values which
    are recorded in host byte order.  This patch corrects this inconsistency
    by writing the SPI values to the audit record in host byte order.
    
    Signed-off-by: Paul Moore <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/xfrm/xfrm_state.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index cf43c49..1af522b 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -2028,6 +2028,7 @@ void
 xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid)
 {
        struct audit_buffer *audit_buf;
+       u32 spi;
        extern int audit_enabled;
 
        if (audit_enabled == 0)
@@ -2037,8 +2038,8 @@ xfrm_audit_state_add(struct xfrm_state *x, int result, 
u32 auid, u32 sid)
                return;
        audit_log_format(audit_buf, " op=SAD-add res=%u",result);
        xfrm_audit_common_stateinfo(x, audit_buf);
-       audit_log_format(audit_buf, " spi=%lu(0x%lx)",
-                        (unsigned long)x->id.spi, (unsigned long)x->id.spi);
+       spi = ntohl(x->id.spi);
+       audit_log_format(audit_buf, " spi=%u(0x%x)", spi, spi);
        audit_log_end(audit_buf);
 }
 EXPORT_SYMBOL_GPL(xfrm_audit_state_add);
@@ -2047,6 +2048,7 @@ void
 xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid)
 {
        struct audit_buffer *audit_buf;
+       u32 spi;
        extern int audit_enabled;
 
        if (audit_enabled == 0)
@@ -2056,8 +2058,8 @@ xfrm_audit_state_delete(struct xfrm_state *x, int result, 
u32 auid, u32 sid)
                return;
        audit_log_format(audit_buf, " op=SAD-delete res=%u",result);
        xfrm_audit_common_stateinfo(x, audit_buf);
-       audit_log_format(audit_buf, " spi=%lu(0x%lx)",
-                        (unsigned long)x->id.spi, (unsigned long)x->id.spi);
+       spi = ntohl(x->id.spi);
+       audit_log_format(audit_buf, " spi=%u(0x%x)", spi, spi);
        audit_log_end(audit_buf);
 }
 EXPORT_SYMBOL_GPL(xfrm_audit_state_delete);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to