Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: conntrack: wrap two inline functions in config checks.

nf_conntrack_synproxy.h contains three inline functions. The contents
of two of them are wrapped in CONFIG_NETFILTER_SYNPROXY checks and just
return NULL if it is not enabled. The third does nothing if they return
NULL, so wrap its contents as well.

nf_ct_timeout_data is only called if CONFIG_NETFILTER_TIMEOUT is
enabled. Wrap its contents in a CONFIG_NETFILTER_TIMEOUT check like the
other inline functions in nf_conntrack_timeout.h.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Jeremy Sowden and committed by
Pablo Neira Ayuso
22e81d74 25d7cbcd

+6
+2
include/net/netfilter/nf_conntrack_synproxy.h
··· 32 32 static inline bool nf_ct_add_synproxy(struct nf_conn *ct, 33 33 const struct nf_conn *tmpl) 34 34 { 35 + #if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY) 35 36 if (tmpl && nfct_synproxy(tmpl)) { 36 37 if (!nfct_seqadj_ext_add(ct)) 37 38 return false; ··· 40 39 if (!nfct_synproxy_ext_add(ct)) 41 40 return false; 42 41 } 42 + #endif 43 43 44 44 return true; 45 45 }
+4
include/net/netfilter/nf_conntrack_timeout.h
··· 32 32 static inline unsigned int * 33 33 nf_ct_timeout_data(const struct nf_conn_timeout *t) 34 34 { 35 + #ifdef CONFIG_NF_CONNTRACK_TIMEOUT 35 36 struct nf_ct_timeout *timeout; 36 37 37 38 timeout = rcu_dereference(t->timeout); ··· 40 39 return NULL; 41 40 42 41 return (unsigned int *)timeout->data; 42 + #else 43 + return NULL; 44 + #endif 43 45 } 44 46 45 47 static inline