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.hor...@netronome.com> Signed-off-by: Joe Stringer <j...@ovn.org> --- .../compat/include/net/netfilter/nf_conntrack_labels.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 */ -- 2.1.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev