diff mbox

[ovs-dev,2/2] datapath: Define nf_connlabels_{put,get}.

Message ID 1449620047-5111-2-git-send-email-joe@ovn.org
State Accepted, archived
Headers show

Commit Message

Joe Stringer Dec. 9, 2015, 12:14 a.m. UTC
Previously this was only done when connlabels were enabled in the kernel
config, even if the functions didn't exist. Fix the compile error.

Reported-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
---
 .../compat/include/net/netfilter/nf_conntrack_labels.h     | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

Comments

Pravin B Shelar Dec. 10, 2015, 10:21 p.m. UTC | #1
On Tue, Dec 8, 2015 at 4:14 PM, Joe Stringer <joe@ovn.org> wrote:
> Previously this was only done when connlabels were enabled in the kernel
> config, even if the functions didn't exist. Fix the compile error.
>
> Reported-by: Simon Horman <simon.horman@netronome.com>
> Signed-off-by: Joe Stringer <joe@ovn.org>

Acked-by: Pravin B Shelar <pshelar@nicira.com>

Thanks.
diff mbox

Patch

diff --git a/datapath/linux/compat/include/net/netfilter/nf_conntrack_labels.h b/datapath/linux/compat/include/net/netfilter/nf_conntrack_labels.h
index e49a289c5388..88413e763c4e 100644
--- a/datapath/linux/compat/include/net/netfilter/nf_conntrack_labels.h
+++ b/datapath/linux/compat/include/net/netfilter/nf_conntrack_labels.h
@@ -5,8 +5,8 @@ 
 #include <linux/version.h>
 #include_next <net/netfilter/nf_conntrack_labels.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) && \
-    IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
+#if IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS)
 
 #ifndef NF_CT_LABELS_MAX_SIZE
 #define NF_CT_LABELS_MAX_SIZE ((XT_CONNLABEL_MAXBIT + 1) / BITS_PER_BYTE)
@@ -37,5 +37,13 @@  static inline void nf_connlabels_put(struct net *net)
 		net->ct.label_words = 0;
 }
 
-#endif
+#else /* CONFIG_NF_CONNTRACK_LABELS */
+static inline int nf_connlabels_get(struct net *net, unsigned int n_bits)
+{
+	return -ERANGE;
+}
+
+static inline void nf_connlabels_put(struct net *net) { }
+#endif /* CONFIG_NF_CONNTRACK_LABELS */
+#endif /* 4.3 */
 #endif /* _NF_CONNTRACK_LABELS_WRAPPER_H */