Subject: Re: [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c

From: Paul Moore <[email-masked]>
Date: Wed, 29 Oct 2008 09:49:09 -0400

On Wednesday 29 October 2008 4:06:09 am Manish Katiyar wrote:
> Below patch fixes the following warning.
> net/netlabel/netlabel_addrlist.c:335: warning: unused variable 'dir'
> net/netlabel/netlabel_addrlist.c:369: warning: unused variable 'dir'
>
>
> Signed-off-by: Manish Katiyar <[email-masked]>

Hi Manish,

Good catch, I ran compile tests with different SECURITY/NETLABEL/IPV6 
options enabled/disabled but forgot about AUDIT.  I appreciate your 
help finding this and submitting a possible solution but I think the 
better approach would be to conditionally compile out the 
netlbl_af{4,6}list_audit_addr() functions similarly to what we do with 
several of the NetLabel kernel API functions in include/net/netlabel.h, 
see netlbl_enabled() for a simple example.

If you have the time to revise this patch that would be great, just CC 
me on the posting and I'll look it over.  If you don't have time that 
is okay too, just let me know so I can fix it.

Thanks!

> ---
>  net/netlabel/netlabel_addrlist.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/net/netlabel/netlabel_addrlist.c
> b/net/netlabel/netlabel_addrlist.c index b0925a3..65fbec1 100644
> --- a/net/netlabel/netlabel_addrlist.c
> +++ b/net/netlabel/netlabel_addrlist.c
> @@ -332,7 +332,9 @@ void netlbl_af4list_audit_addr(struct
> audit_buffer *audit_buf,
>  					__be32 addr, __be32 mask)
>  {
>  	u32 mask_val = ntohl(mask);
> +#ifdef CONFIG_AUDIT
>  	char *dir = (src ? "src" : "dst");
> +#endif
>
>  	if (dev != NULL)
>  		audit_log_format(audit_buf, " netif=%s", dev);
> @@ -366,7 +368,9 @@ void netlbl_af6list_audit_addr(struct
> audit_buffer *audit_buf,
>  				 const struct in6_addr *addr,
>  				 const struct in6_addr *mask)
>  {
> +#ifdef CONFIG_AUDIT
>  	char *dir = (src ? "src" : "dst");
> +#endif
>
>  	if (dev != NULL)
>  		audit_log_format(audit_buf, " netif=%s", dev);

-- 
paul moore
linux @ hp