From: wenxu <we...@ucloud.cn>

Add nat attribute in the ct_metadata action. This tell driver the offload
conntrack entry is nat one or not.

Signed-off-by: wenxu <we...@ucloud.cn>
---
 include/net/flow_offload.h | 1 +
 net/sched/act_ct.c         | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index 95d6337..e3f09dd 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -244,6 +244,7 @@ struct flow_action_entry {
                        unsigned long cookie;
                        u32 mark;
                        u32 labels[4];
+                       bool nat;
                } ct_metadata;
                struct {                                /* 
FLOW_ACTION_MPLS_PUSH */
                        u32             label;
diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
index 9adff83..f70ab543 100644
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -183,6 +183,7 @@ static void tcf_ct_flow_table_add_action_meta(struct 
nf_conn *ct,
                                             IP_CT_ESTABLISHED_REPLY;
        /* aligns with the CT reference on the SKB nf_ct_set */
        entry->ct_metadata.cookie = (unsigned long)ct | ctinfo;
+       entry->ct_metadata.nat = ct->status & IPS_NAT_MASK;
 
        act_ct_labels = entry->ct_metadata.labels;
        ct_labels = nf_ct_labels_find(ct);
-- 
1.8.3.1

Reply via email to