aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/conntrack.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/openvswitch/conntrack.c')
-rw-r--r--net/openvswitch/conntrack.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index 0be3ab5bde26..626629944450 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -29,7 +29,7 @@
29#include <net/netfilter/ipv6/nf_defrag_ipv6.h> 29#include <net/netfilter/ipv6/nf_defrag_ipv6.h>
30#include <net/ipv6_frag.h> 30#include <net/ipv6_frag.h>
31 31
32#ifdef CONFIG_NF_NAT_NEEDED 32#if IS_ENABLED(CONFIG_NF_NAT)
33#include <net/netfilter/nf_nat.h> 33#include <net/netfilter/nf_nat.h>
34#endif 34#endif
35 35
@@ -75,7 +75,7 @@ struct ovs_conntrack_info {
75 struct md_mark mark; 75 struct md_mark mark;
76 struct md_labels labels; 76 struct md_labels labels;
77 char timeout[CTNL_TIMEOUT_NAME_MAX]; 77 char timeout[CTNL_TIMEOUT_NAME_MAX];
78#ifdef CONFIG_NF_NAT_NEEDED 78#if IS_ENABLED(CONFIG_NF_NAT)
79 struct nf_nat_range2 range; /* Only present for SRC NAT and DST NAT. */ 79 struct nf_nat_range2 range; /* Only present for SRC NAT and DST NAT. */
80#endif 80#endif
81}; 81};
@@ -721,7 +721,7 @@ static bool skb_nfct_cached(struct net *net,
721 return ct_executed; 721 return ct_executed;
722} 722}
723 723
724#ifdef CONFIG_NF_NAT_NEEDED 724#if IS_ENABLED(CONFIG_NF_NAT)
725/* Modelled after nf_nat_ipv[46]_fn(). 725/* Modelled after nf_nat_ipv[46]_fn().
726 * range is only used for new, uninitialized NAT state. 726 * range is only used for new, uninitialized NAT state.
727 * Returns either NF_ACCEPT or NF_DROP. 727 * Returns either NF_ACCEPT or NF_DROP.
@@ -903,7 +903,7 @@ static int ovs_ct_nat(struct net *net, struct sw_flow_key *key,
903 903
904 return err; 904 return err;
905} 905}
906#else /* !CONFIG_NF_NAT_NEEDED */ 906#else /* !CONFIG_NF_NAT */
907static int ovs_ct_nat(struct net *net, struct sw_flow_key *key, 907static int ovs_ct_nat(struct net *net, struct sw_flow_key *key,
908 const struct ovs_conntrack_info *info, 908 const struct ovs_conntrack_info *info,
909 struct sk_buff *skb, struct nf_conn *ct, 909 struct sk_buff *skb, struct nf_conn *ct,
@@ -1330,7 +1330,7 @@ static int ovs_ct_add_helper(struct ovs_conntrack_info *info, const char *name,
1330 return 0; 1330 return 0;
1331} 1331}
1332 1332
1333#ifdef CONFIG_NF_NAT_NEEDED 1333#if IS_ENABLED(CONFIG_NF_NAT)
1334static int parse_nat(const struct nlattr *attr, 1334static int parse_nat(const struct nlattr *attr,
1335 struct ovs_conntrack_info *info, bool log) 1335 struct ovs_conntrack_info *info, bool log)
1336{ 1336{
@@ -1467,7 +1467,7 @@ static const struct ovs_ct_len_tbl ovs_ct_attr_lens[OVS_CT_ATTR_MAX + 1] = {
1467 .maxlen = sizeof(struct md_labels) }, 1467 .maxlen = sizeof(struct md_labels) },
1468 [OVS_CT_ATTR_HELPER] = { .minlen = 1, 1468 [OVS_CT_ATTR_HELPER] = { .minlen = 1,
1469 .maxlen = NF_CT_HELPER_NAME_LEN }, 1469 .maxlen = NF_CT_HELPER_NAME_LEN },
1470#ifdef CONFIG_NF_NAT_NEEDED 1470#if IS_ENABLED(CONFIG_NF_NAT)
1471 /* NAT length is checked when parsing the nested attributes. */ 1471 /* NAT length is checked when parsing the nested attributes. */
1472 [OVS_CT_ATTR_NAT] = { .minlen = 0, .maxlen = INT_MAX }, 1472 [OVS_CT_ATTR_NAT] = { .minlen = 0, .maxlen = INT_MAX },
1473#endif 1473#endif
@@ -1547,7 +1547,7 @@ static int parse_ct(const struct nlattr *attr, struct ovs_conntrack_info *info,
1547 return -EINVAL; 1547 return -EINVAL;
1548 } 1548 }
1549 break; 1549 break;
1550#ifdef CONFIG_NF_NAT_NEEDED 1550#if IS_ENABLED(CONFIG_NF_NAT)
1551 case OVS_CT_ATTR_NAT: { 1551 case OVS_CT_ATTR_NAT: {
1552 int err = parse_nat(a, info, log); 1552 int err = parse_nat(a, info, log);
1553 1553
@@ -1677,7 +1677,7 @@ err_free_ct:
1677 return err; 1677 return err;
1678} 1678}
1679 1679
1680#ifdef CONFIG_NF_NAT_NEEDED 1680#if IS_ENABLED(CONFIG_NF_NAT)
1681static bool ovs_ct_nat_to_attr(const struct ovs_conntrack_info *info, 1681static bool ovs_ct_nat_to_attr(const struct ovs_conntrack_info *info,
1682 struct sk_buff *skb) 1682 struct sk_buff *skb)
1683{ 1683{
@@ -1783,7 +1783,7 @@ int ovs_ct_action_to_attr(const struct ovs_conntrack_info *ct_info,
1783 return -EMSGSIZE; 1783 return -EMSGSIZE;
1784 } 1784 }
1785 1785
1786#ifdef CONFIG_NF_NAT_NEEDED 1786#if IS_ENABLED(CONFIG_NF_NAT)
1787 if (ct_info->nat && !ovs_ct_nat_to_attr(ct_info, skb)) 1787 if (ct_info->nat && !ovs_ct_nat_to_attr(ct_info, skb))
1788 return -EMSGSIZE; 1788 return -EMSGSIZE;
1789#endif 1789#endif