diff mbox series

[ovs-dev,V2,3/3] compat: Fix compile warning

Message ID 20201112231039.1973-4-gvrose8192@gmail.com
State Accepted
Headers show
Series Fix RHEL 7.7 build | expand

Commit Message

Gregory Rose Nov. 12, 2020, 11:10 p.m. UTC
In ../compat/nf_conntrack_reasm.c nf_frags_cache_name is declared
if OVS_NF_DEFRAG6_BACKPORT is defined.  However, later in the patch
it is only used if HAVE_INET_FRAGS_WITH_FRAGS_WORK is defined and
HAVE_INET_FRAGS_RND is not defined.  This will cause a compile warning
about unused variables.

Fix it up by using the same defines that enable its use to decide
if it should be declared and avoid the compiler warning.

Fixes: 4a90b277baca ("compat: Fixup ipv6 fragmentation on 4.9.135+ kernels")
Signed-off-by: Greg Rose <gvrose8192@gmail.com>

---
V2 No change
---
 datapath/linux/compat/nf_conntrack_reasm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Yi-Hung Wei Nov. 13, 2020, 7:24 p.m. UTC | #1
On Thu, Nov 12, 2020 at 3:10 PM Greg Rose <gvrose8192@gmail.com> wrote:
>
> In ../compat/nf_conntrack_reasm.c nf_frags_cache_name is declared
> if OVS_NF_DEFRAG6_BACKPORT is defined.  However, later in the patch
> it is only used if HAVE_INET_FRAGS_WITH_FRAGS_WORK is defined and
> HAVE_INET_FRAGS_RND is not defined.  This will cause a compile warning
> about unused variables.
>
> Fix it up by using the same defines that enable its use to decide
> if it should be declared and avoid the compiler warning.
>
> Fixes: 4a90b277baca ("compat: Fixup ipv6 fragmentation on 4.9.135+ kernels")
> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
>
> ---
> V2 No change
> ---
LGTM.

Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Ilya Maximets Nov. 16, 2020, 7:30 p.m. UTC | #2
On 11/13/20 8:24 PM, Yi-Hung Wei wrote:
> On Thu, Nov 12, 2020 at 3:10 PM Greg Rose <gvrose8192@gmail.com> wrote:
>>
>> In ../compat/nf_conntrack_reasm.c nf_frags_cache_name is declared
>> if OVS_NF_DEFRAG6_BACKPORT is defined.  However, later in the patch
>> it is only used if HAVE_INET_FRAGS_WITH_FRAGS_WORK is defined and
>> HAVE_INET_FRAGS_RND is not defined.  This will cause a compile warning
>> about unused variables.
>>
>> Fix it up by using the same defines that enable its use to decide
>> if it should be declared and avoid the compiler warning.
>>
>> Fixes: 4a90b277baca ("compat: Fixup ipv6 fragmentation on 4.9.135+ kernels")
>> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
>>
>> ---
>> V2 No change
>> ---
> LGTM.
> 
> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>

Thanks!

Applied to master and backported down to 2.6.



Best regards, Ilya Maximets.
Gregory Rose Nov. 17, 2020, 1:14 a.m. UTC | #3
On 11/16/2020 11:30 AM, Ilya Maximets wrote:
> On 11/13/20 8:24 PM, Yi-Hung Wei wrote:
>> On Thu, Nov 12, 2020 at 3:10 PM Greg Rose <gvrose8192@gmail.com> wrote:
>>>
>>> In ../compat/nf_conntrack_reasm.c nf_frags_cache_name is declared
>>> if OVS_NF_DEFRAG6_BACKPORT is defined.  However, later in the patch
>>> it is only used if HAVE_INET_FRAGS_WITH_FRAGS_WORK is defined and
>>> HAVE_INET_FRAGS_RND is not defined.  This will cause a compile warning
>>> about unused variables.
>>>
>>> Fix it up by using the same defines that enable its use to decide
>>> if it should be declared and avoid the compiler warning.
>>>
>>> Fixes: 4a90b277baca ("compat: Fixup ipv6 fragmentation on 4.9.135+ kernels")
>>> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
>>>
>>> ---
>>> V2 No change
>>> ---
>> LGTM.
>>
>> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
> 
> Thanks!
> 
> Applied to master and backported down to 2.6.

Thank you Ilya for this and the other two commits from this series.

- Greg

> 
> 
> 
> Best regards, Ilya Maximets.
>
diff mbox series

Patch

diff --git a/datapath/linux/compat/nf_conntrack_reasm.c b/datapath/linux/compat/nf_conntrack_reasm.c
index ced9fba98..77b4b2548 100644
--- a/datapath/linux/compat/nf_conntrack_reasm.c
+++ b/datapath/linux/compat/nf_conntrack_reasm.c
@@ -57,10 +57,13 @@ 
 #include <net/netns/generic.h>
 #include "datapath.h"
 
-#ifdef OVS_NF_DEFRAG6_BACKPORT
+#if defined(HAVE_INET_FRAGS_WITH_FRAGS_WORK) || !defined(HAVE_INET_FRAGS_RND)
 
 static const char nf_frags_cache_name[] = "ovs-frag6";
 
+#endif
+
+#ifdef OVS_NF_DEFRAG6_BACKPORT
 struct nf_ct_frag6_skb_cb
 {
 	struct inet6_skb_parm	h;