Commit 47b676c0 authored by Manish Katiyar's avatar Manish Katiyar Committed by Paul Moore

netlabel: Fix compilation warnings in net/netlabel/netlabel_addrlist.c

Enable netlabel auditing functions only when CONFIG_AUDIT is set
Signed-off-by: default avatarManish Katiyar <mkatiyar@gmail.com>
Signed-off-by: default avatarPaul Moore <paul.moore@hp.com>
parent f8a02479
...@@ -315,6 +315,7 @@ struct netlbl_af6list *netlbl_af6list_remove(const struct in6_addr *addr, ...@@ -315,6 +315,7 @@ struct netlbl_af6list *netlbl_af6list_remove(const struct in6_addr *addr,
* Audit Helper Functions * Audit Helper Functions
*/ */
#ifdef CONFIG_AUDIT
/** /**
* netlbl_af4list_audit_addr - Audit an IPv4 address * netlbl_af4list_audit_addr - Audit an IPv4 address
* @audit_buf: audit buffer * @audit_buf: audit buffer
...@@ -386,3 +387,4 @@ void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf, ...@@ -386,3 +387,4 @@ void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf,
} }
} }
#endif /* IPv6 */ #endif /* IPv6 */
#endif /* CONFIG_AUDIT */
...@@ -120,9 +120,19 @@ struct netlbl_af4list *netlbl_af4list_search(__be32 addr, ...@@ -120,9 +120,19 @@ struct netlbl_af4list *netlbl_af4list_search(__be32 addr,
struct netlbl_af4list *netlbl_af4list_search_exact(__be32 addr, struct netlbl_af4list *netlbl_af4list_search_exact(__be32 addr,
__be32 mask, __be32 mask,
struct list_head *head); struct list_head *head);
#ifdef CONFIG_AUDIT
void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf, void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
int src, const char *dev, int src, const char *dev,
__be32 addr, __be32 mask); __be32 addr, __be32 mask);
#else
static inline void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
int src, const char *dev,
__be32 addr, __be32 mask)
{
return;
}
#endif
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
...@@ -179,11 +189,23 @@ struct netlbl_af6list *netlbl_af6list_search(const struct in6_addr *addr, ...@@ -179,11 +189,23 @@ struct netlbl_af6list *netlbl_af6list_search(const struct in6_addr *addr,
struct netlbl_af6list *netlbl_af6list_search_exact(const struct in6_addr *addr, struct netlbl_af6list *netlbl_af6list_search_exact(const struct in6_addr *addr,
const struct in6_addr *mask, const struct in6_addr *mask,
struct list_head *head); struct list_head *head);
#ifdef CONFIG_AUDIT
void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf, void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf,
int src, int src,
const char *dev, const char *dev,
const struct in6_addr *addr, const struct in6_addr *addr,
const struct in6_addr *mask); const struct in6_addr *mask);
#else
static inline void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf,
int src,
const char *dev,
const struct in6_addr *addr,
const struct in6_addr *mask)
{
return;
}
#endif
#endif /* IPV6 */ #endif /* IPV6 */
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment