* [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c
@ 2008-10-29 8:06 Manish Katiyar
2008-10-29 13:49 ` Paul Moore
0 siblings, 1 reply; 7+ messages in thread
From: Manish Katiyar @ 2008-10-29 8:06 UTC (permalink / raw)
To: kernel-janitors, netdev, paul.moore; +Cc: mkatiyar
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 <mkatiyar@gmail.com>
---
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);
--
1.5.4.3
Thanks -
Manish
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c
2008-10-29 8:06 [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c Manish Katiyar
@ 2008-10-29 13:49 ` Paul Moore
[not found] ` <ea11fea30810290818p2ae6c11eo5e38baf631867fb1@mail.gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Paul Moore @ 2008-10-29 13:49 UTC (permalink / raw)
To: Manish Katiyar; +Cc: kernel-janitors, netdev
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 <mkatiyar@gmail.com>
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c
[not found] ` <200810291135.25056.paul.moore@hp.com>
@ 2008-10-29 18:27 ` Manish Katiyar
[not found] ` <200810291543.49225.paul.moore@hp.com>
0 siblings, 1 reply; 7+ messages in thread
From: Manish Katiyar @ 2008-10-29 18:27 UTC (permalink / raw)
To: Paul Moore, netdev, kernel-janitors; +Cc: mkatiyar
On Wed, Oct 29, 2008 at 9:05 PM, Paul Moore <paul.moore@hp.com> wrote:
> On Wednesday 29 October 2008 11:18:36 am you wrote:
>> On Wed, Oct 29, 2008 at 7:19 PM, Paul Moore <paul.moore@hp.com> wrote:
>> > 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 <mkatiyar@gmail.com>
>> >
>> > 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.
>>
>> Hi Paul,
>>
>> Thanks a lot. I didn't understand your suggestion, but this is also
>> the first time I am looking in net directory :-).
>
> There is a first time for everything :)
>
>> Even if you compile
>> netlbl_af{4,6}list_audit_add conditionally based on CONFIG_IPV6 and
>> others, you still need to have CONFIG_AUDIT for audit_log_format().
>> Isn't it ??
>
> Yes, but the idea is to conditionally compile the
> netlbl_af{4,6}list_audit_add() functions based on CONFIG_AUDIT. Below
> is a simple example using myfunc():
>
> In the source file you define the function:
>
> void myfunc(int myarg)
> {
> /* bunch of audit stuff */
> }
>
> In the header file you have a conditional prototype declaration:
>
> #ifdef CONFIG_AUDIT
> void myfunc(int myarg);
> #else
> static inline void myfunc(int myarg)
> {
> return;
> }
> #endif
>
> This way the code compiles correctly regardless of if CONFIG_AUDIT is
> defined and has the benefit of not including unnecessary code in the
> kernel binary.
Hi Paul,
Does this look better ?? Appreciate your help. Patch compile tested.
Enable netlabel auditing functions only when CONFIG_AUDIT is set
Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
---
net/netlabel/netlabel_addrlist.c | 2 ++
net/netlabel/netlabel_addrlist.h | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/net/netlabel/netlabel_addrlist.c b/net/netlabel/netlabel_addrlist.c
index b0925a3..830afef 100644
--- a/net/netlabel/netlabel_addrlist.c
+++ b/net/netlabel/netlabel_addrlist.c
@@ -311,6 +311,7 @@ struct netlbl_af6list *netlbl_af6list_remove(const
struct in6_addr *addr,
}
#endif /* IPv6 */
+#ifdef CONFIG_AUDIT
/*
* Audit Helper Functions
*/
@@ -386,3 +387,4 @@ void netlbl_af6list_audit_addr(struct audit_buffer
*audit_buf,
}
}
#endif /* IPv6 */
+#endif /* CONFIG_AUDIT */
diff --git a/net/netlabel/netlabel_addrlist.h b/net/netlabel/netlabel_addrlist.h
index 0242bea..7fa730a 100644
--- a/net/netlabel/netlabel_addrlist.h
+++ b/net/netlabel/netlabel_addrlist.h
@@ -120,9 +120,18 @@ struct netlbl_af4list *netlbl_af4list_search(__be32 addr,
struct netlbl_af4list *netlbl_af4list_search_exact(__be32 addr,
__be32 mask,
struct list_head *head);
+
+#ifdef CONFIG_AUDIT
void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
int src, const char *dev,
__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)
@@ -179,11 +188,22 @@ struct netlbl_af6list
*netlbl_af6list_search(const struct in6_addr *addr,
struct netlbl_af6list *netlbl_af6list_search_exact(const struct in6_addr *addr,
const struct in6_addr *mask,
struct list_head *head);
+
+#ifdef CONFIG_AUDIT
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);
+#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
--
1.5.4.3
Thanks -
Manish
>
>> > 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.
>>
>> Since this is not my area of expertise, I would rather not like to
>> introduce more bugs in kernel. But yes I can try my best to learn and
>> try to fix it if you are willing to lend a helping hand (which might
>> be iterative and irritating for you due to my stupid questions).
>
> I'm more than happy to help but all I ask is that we keep the discussion
> on the mailing lists so that others could benefit from the discussion.
> However, if this isn't something you are comfortable with just let me
> know.
>
> --
> paul moore
> linux @ hp
>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c
[not found] ` <200810291543.49225.paul.moore@hp.com>
@ 2008-10-30 2:10 ` Manish Katiyar
2008-10-30 12:12 ` Paul Moore
0 siblings, 1 reply; 7+ messages in thread
From: Manish Katiyar @ 2008-10-30 2:10 UTC (permalink / raw)
To: Paul Moore, netdev, kernel-janitors
On Thu, Oct 30, 2008 at 1:13 AM, Paul Moore <paul.moore@hp.com> wrote:
> On Wednesday 29 October 2008 2:27:44 pm you wrote:
>> Hi Paul,
>>
>> Does this look better ?? Appreciate your help. Patch compile tested.
>>
>> Enable netlabel auditing functions only when CONFIG_AUDIT is set
>>
>> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
>
> Much better, just some style nits noted below that need to be
> addressed ...
Hi Paul,
Updated patch below as per your comments.
Enable netlabel auditing functions only when CONFIG_AUDIT is set
Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
---
net/netlabel/netlabel_addrlist.c | 2 ++
net/netlabel/netlabel_addrlist.h | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/net/netlabel/netlabel_addrlist.c b/net/netlabel/netlabel_addrlist.c
index b0925a3..3fe73c2 100644
--- a/net/netlabel/netlabel_addrlist.c
+++ b/net/netlabel/netlabel_addrlist.c
@@ -327,6 +327,7 @@ struct netlbl_af6list *netlbl_af6list_remove(const
struct in6_addr *addr,
* Write the IPv4 address and address mask, if necessary, to @audit_buf.
*
*/
+#ifdef CONFIG_AUDIT
void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
int src, const char *dev,
__be32 addr, __be32 mask)
@@ -386,3 +387,4 @@ void netlbl_af6list_audit_addr(struct audit_buffer
*audit_buf,
}
}
#endif /* IPv6 */
+#endif /* CONFIG_AUDIT */
diff --git a/net/netlabel/netlabel_addrlist.h b/net/netlabel/netlabel_addrlist.h
index 0242bea..3212965 100644
--- a/net/netlabel/netlabel_addrlist.h
+++ b/net/netlabel/netlabel_addrlist.h
@@ -120,9 +120,19 @@ struct netlbl_af4list *netlbl_af4list_search(__be32 addr,
struct netlbl_af4list *netlbl_af4list_search_exact(__be32 addr,
__be32 mask,
struct list_head *head);
+
+#ifdef CONFIG_AUDIT
void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
int src, const char *dev,
__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)
@@ -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,
const struct in6_addr *mask,
struct list_head *head);
+
+#ifdef CONFIG_AUDIT
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);
+#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
--
1.5.4.3
Thanks -
Manish
>
>> ---
>> net/netlabel/netlabel_addrlist.c | 2 ++
>> net/netlabel/netlabel_addrlist.h | 20 ++++++++++++++++++++
>> 2 files changed, 22 insertions(+), 0 deletions(-)
>>
>> diff --git a/net/netlabel/netlabel_addrlist.c
>> b/net/netlabel/netlabel_addrlist.c index b0925a3..830afef 100644
>> --- a/net/netlabel/netlabel_addrlist.c
>> +++ b/net/netlabel/netlabel_addrlist.c
>> @@ -311,6 +311,7 @@ struct netlbl_af6list
>> *netlbl_af6list_remove(const struct in6_addr *addr,
>> }
>> #endif /* IPv6 */
>>
>> +#ifdef CONFIG_AUDIT
>> /*
>> * Audit Helper Functions
>> */
>
> Why don't you move the #ifdef down here past the comment. Not a big
> deal but you need to respin the patch to fix another problem so why not
> fix this up too.
>
>> @@ -386,3 +387,4 @@ void netlbl_af6list_audit_addr(struct
>> audit_buffer *audit_buf,
>> }
>> }
>> #endif /* IPv6 */
>> +#endif /* CONFIG_AUDIT */
>> diff --git a/net/netlabel/netlabel_addrlist.h
>> b/net/netlabel/netlabel_addrlist.h index 0242bea..7fa730a 100644
>> --- a/net/netlabel/netlabel_addrlist.h
>> +++ b/net/netlabel/netlabel_addrlist.h
>> @@ -120,9 +120,18 @@ struct netlbl_af4list
>> *netlbl_af4list_search(__be32 addr, struct netlbl_af4list
>> *netlbl_af4list_search_exact(__be32 addr, __be32 mask,
>> struct list_head *head);
>> +
>> +#ifdef CONFIG_AUDIT
>> void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
>> int src, const char *dev,
>> __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
>
> The curly braces for the function body need to be on a line of their
> own. See the two example below:
>
> void bad_style_func(void) {
> return;
> }
>
> void good_style_func(void)
> {
> return;
> }
>
>> #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
>>
>> @@ -179,11 +188,22 @@ struct netlbl_af6list
>> *netlbl_af6list_search(const struct in6_addr *addr,
>> struct netlbl_af6list *netlbl_af6list_search_exact(const struct
>> in6_addr *addr, const struct in6_addr *mask,
>> struct list_head *head);
>> +
>> +#ifdef CONFIG_AUDIT
>> 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);
>> +#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
>
> Same curly brace problem.
>
> --
> paul moore
> linux @ hp
>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c
2008-10-30 2:10 ` Manish Katiyar
@ 2008-10-30 12:12 ` Paul Moore
2008-10-30 13:33 ` Manish Katiyar
0 siblings, 1 reply; 7+ messages in thread
From: Paul Moore @ 2008-10-30 12:12 UTC (permalink / raw)
To: Manish Katiyar; +Cc: netdev, kernel-janitors
On Wednesday 29 October 2008 10:10:36 pm Manish Katiyar wrote:
> On Thu, Oct 30, 2008 at 1:13 AM, Paul Moore <paul.moore@hp.com> wrote:
> > On Wednesday 29 October 2008 2:27:44 pm you wrote:
> >> Hi Paul,
> >>
> >> Does this look better ?? Appreciate your help. Patch compile
> >> tested.
> >>
> >> Enable netlabel auditing functions only when CONFIG_AUDIT is set
> >>
> >> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
> >
> > Much better, just some style nits noted below that need to be
> > addressed ...
>
> Hi Paul,
>
> Updated patch below as per your comments.
>
> Enable netlabel auditing functions only when CONFIG_AUDIT is set
>
> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Thanks for sticking with this, I appreciate it. There is still one
small style nit (see below) but it is really my fault for not being
more specific. Unless you object I'll go ahead and fix it up when I
apply the patch.
I'll send a git pull request out to netdev later today, including your
patch, as there are two other labeled networking patches that need to
make the next 2.6.28-rcX release.
> ---
> net/netlabel/netlabel_addrlist.c | 2 ++
> net/netlabel/netlabel_addrlist.h | 22 ++++++++++++++++++++++
> 2 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/net/netlabel/netlabel_addrlist.c
> b/net/netlabel/netlabel_addrlist.c index b0925a3..3fe73c2 100644
> --- a/net/netlabel/netlabel_addrlist.c
> +++ b/net/netlabel/netlabel_addrlist.c
> @@ -327,6 +327,7 @@ struct netlbl_af6list
> *netlbl_af6list_remove(const struct in6_addr *addr,
> * Write the IPv4 address and address mask, if necessary, to
> @audit_buf. *
> */
> +#ifdef CONFIG_AUDIT
> void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
> int src, const char *dev,
> __be32 addr, __be32 mask)
When I said to move the #ifdef below the comment, I meant below
the "Audit Helper Functions" comment but before the function's kdoc
comment header.
--
paul moore
linux @ hp
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c
2008-10-30 12:12 ` Paul Moore
@ 2008-10-30 13:33 ` Manish Katiyar
2008-10-30 13:39 ` Paul Moore
0 siblings, 1 reply; 7+ messages in thread
From: Manish Katiyar @ 2008-10-30 13:33 UTC (permalink / raw)
To: Paul Moore; +Cc: netdev, kernel-janitors
On Thu, Oct 30, 2008 at 5:42 PM, Paul Moore <paul.moore@hp.com> wrote:
> On Wednesday 29 October 2008 10:10:36 pm Manish Katiyar wrote:
>> On Thu, Oct 30, 2008 at 1:13 AM, Paul Moore <paul.moore@hp.com> wrote:
>> > On Wednesday 29 October 2008 2:27:44 pm you wrote:
>> >> Hi Paul,
>> >>
>> >> Does this look better ?? Appreciate your help. Patch compile
>> >> tested.
>> >>
>> >> Enable netlabel auditing functions only when CONFIG_AUDIT is set
>> >>
>> >> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
>> >
>> > Much better, just some style nits noted below that need to be
>> > addressed ...
>>
>> Hi Paul,
>>
>> Updated patch below as per your comments.
>>
>> Enable netlabel auditing functions only when CONFIG_AUDIT is set
>>
>> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
>
> Thanks for sticking with this, I appreciate it. There is still one
> small style nit (see below) but it is really my fault for not being
> more specific. Unless you object I'll go ahead and fix it up when I
> apply the patch.
>
> I'll send a git pull request out to netdev later today, including your
> patch, as there are two other labeled networking patches that need to
> make the next 2.6.28-rcX release.
>
>> ---
>> net/netlabel/netlabel_addrlist.c | 2 ++
>> net/netlabel/netlabel_addrlist.h | 22 ++++++++++++++++++++++
>> 2 files changed, 24 insertions(+), 0 deletions(-)
>>
>> diff --git a/net/netlabel/netlabel_addrlist.c
>> b/net/netlabel/netlabel_addrlist.c index b0925a3..3fe73c2 100644
>> --- a/net/netlabel/netlabel_addrlist.c
>> +++ b/net/netlabel/netlabel_addrlist.c
>> @@ -327,6 +327,7 @@ struct netlbl_af6list
>> *netlbl_af6list_remove(const struct in6_addr *addr,
>> * Write the IPv4 address and address mask, if necessary, to
>> @audit_buf. *
>> */
>> +#ifdef CONFIG_AUDIT
>> void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
>> int src, const char *dev,
>> __be32 addr, __be32 mask)
>
> When I said to move the #ifdef below the comment, I meant below
> the "Audit Helper Functions" comment but before the function's kdoc
> comment header.
Hi Paul,
Below is the updated patch.
Enable netlabel auditing functions only when CONFIG_AUDIT is set
Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
---
net/netlabel/netlabel_addrlist.c | 2 ++
net/netlabel/netlabel_addrlist.h | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/net/netlabel/netlabel_addrlist.c b/net/netlabel/netlabel_addrlist.c
index b0925a3..249f6b9 100644
--- a/net/netlabel/netlabel_addrlist.c
+++ b/net/netlabel/netlabel_addrlist.c
@@ -315,6 +315,7 @@ struct netlbl_af6list *netlbl_af6list_remove(const
struct in6_addr *addr,
* Audit Helper Functions
*/
+#ifdef CONFIG_AUDIT
/**
* netlbl_af4list_audit_addr - Audit an IPv4 address
* @audit_buf: audit buffer
@@ -386,3 +387,4 @@ void netlbl_af6list_audit_addr(struct audit_buffer
*audit_buf,
}
}
#endif /* IPv6 */
+#endif /* CONFIG_AUDIT */
diff --git a/net/netlabel/netlabel_addrlist.h b/net/netlabel/netlabel_addrlist.h
index 0242bea..3212965 100644
--- a/net/netlabel/netlabel_addrlist.h
+++ b/net/netlabel/netlabel_addrlist.h
@@ -120,9 +120,19 @@ struct netlbl_af4list *netlbl_af4list_search(__be32 addr,
struct netlbl_af4list *netlbl_af4list_search_exact(__be32 addr,
__be32 mask,
struct list_head *head);
+
+#ifdef CONFIG_AUDIT
void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
int src, const char *dev,
__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)
@@ -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,
const struct in6_addr *mask,
struct list_head *head);
+
+#ifdef CONFIG_AUDIT
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);
+#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
--
1.5.4.3
Thanks -
Manish
>
> --
> paul moore
> linux @ hp
>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c
2008-10-30 13:33 ` Manish Katiyar
@ 2008-10-30 13:39 ` Paul Moore
0 siblings, 0 replies; 7+ messages in thread
From: Paul Moore @ 2008-10-30 13:39 UTC (permalink / raw)
To: Manish Katiyar; +Cc: netdev, kernel-janitors
On Thursday 30 October 2008 9:33:55 am Manish Katiyar wrote:
> Hi Paul,
>
> Below is the updated patch.
>
> Enable netlabel auditing functions only when CONFIG_AUDIT is set
>
> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Thanks a lot, I'll apply this and send a pull request later today.
> ---
> net/netlabel/netlabel_addrlist.c | 2 ++
> net/netlabel/netlabel_addrlist.h | 22 ++++++++++++++++++++++
> 2 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/net/netlabel/netlabel_addrlist.c
> b/net/netlabel/netlabel_addrlist.c index b0925a3..249f6b9 100644
> --- a/net/netlabel/netlabel_addrlist.c
> +++ b/net/netlabel/netlabel_addrlist.c
> @@ -315,6 +315,7 @@ struct netlbl_af6list
> *netlbl_af6list_remove(const struct in6_addr *addr,
> * Audit Helper Functions
> */
>
> +#ifdef CONFIG_AUDIT
> /**
> * netlbl_af4list_audit_addr - Audit an IPv4 address
> * @audit_buf: audit buffer
> @@ -386,3 +387,4 @@ void netlbl_af6list_audit_addr(struct
> audit_buffer *audit_buf,
> }
> }
> #endif /* IPv6 */
> +#endif /* CONFIG_AUDIT */
> diff --git a/net/netlabel/netlabel_addrlist.h
> b/net/netlabel/netlabel_addrlist.h index 0242bea..3212965 100644
> --- a/net/netlabel/netlabel_addrlist.h
> +++ b/net/netlabel/netlabel_addrlist.h
> @@ -120,9 +120,19 @@ struct netlbl_af4list
> *netlbl_af4list_search(__be32 addr, struct netlbl_af4list
> *netlbl_af4list_search_exact(__be32 addr, __be32 mask,
> struct list_head *head);
> +
> +#ifdef CONFIG_AUDIT
> void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
> int src, const char *dev,
> __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)
>
> @@ -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, const struct in6_addr *mask,
> struct list_head *head);
> +
> +#ifdef CONFIG_AUDIT
> 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);
> +#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
--
paul moore
linux @ hp
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-10-30 13:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29 8:06 [PATCH] : Fix compilation warnings in net/netlabel/netlabel_addrlist.c Manish Katiyar
2008-10-29 13:49 ` Paul Moore
[not found] ` <ea11fea30810290818p2ae6c11eo5e38baf631867fb1@mail.gmail.com>
[not found] ` <200810291135.25056.paul.moore@hp.com>
2008-10-29 18:27 ` Manish Katiyar
[not found] ` <200810291543.49225.paul.moore@hp.com>
2008-10-30 2:10 ` Manish Katiyar
2008-10-30 12:12 ` Paul Moore
2008-10-30 13:33 ` Manish Katiyar
2008-10-30 13:39 ` Paul Moore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).