Skip to content

Commit 22e81d7

Browse files
a3a3elummakynes
authored andcommitted
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>
1 parent 25d7cbc commit 22e81d7

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎include/net/netfilter/nf_conntrack_synproxy.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ static inline struct nf_conn_synproxy *nfct_synproxy_ext_add(struct nf_conn *ct)
3232
static inline bool nf_ct_add_synproxy(struct nf_conn *ct,
3333
const struct nf_conn *tmpl)
3434
{
35+
#if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
3536
if (tmpl && nfct_synproxy(tmpl)) {
3637
if (!nfct_seqadj_ext_add(ct))
3738
return false;
3839

3940
if (!nfct_synproxy_ext_add(ct))
4041
return false;
4142
}
43+
#endif
4244

4345
return true;
4446
}

‎include/net/netfilter/nf_conntrack_timeout.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ struct nf_conn_timeout {
3232
static inline unsigned int *
3333
nf_ct_timeout_data(const struct nf_conn_timeout *t)
3434
{
35+
#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
3536
struct nf_ct_timeout *timeout;
3637

3738
timeout = rcu_dereference(t->timeout);
3839
if (timeout == NULL)
3940
return NULL;
4041

4142
return (unsigned int *)timeout->data;
43+
#else
44+
return NULL;
45+
#endif
4246
}
4347

4448
static inline

0 commit comments

Comments
 (0)