Unverified Commit b61ca686 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7817 netfilter: nft_flow_offload: reset dst in route object after setting up flow

parents 4f42e95a e40569cb
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -21,6 +21,16 @@ struct flow_offload_entry {
static DEFINE_MUTEX(flowtable_lock);
static LIST_HEAD(flowtables);

static struct dst_entry *nft_route_dst_fetch(struct nf_flow_route *route,
					     enum flow_offload_tuple_dir dir)
{
	struct dst_entry *dst = route->tuple[dir].dst;

	route->tuple[dir].dst = NULL;

	return dst;
}

static void
flow_offload_fill_dir(struct flow_offload *flow, struct nf_conn *ct,
		      struct nf_flow_route *route,
@@ -29,7 +39,7 @@ flow_offload_fill_dir(struct flow_offload *flow, struct nf_conn *ct,
	struct flow_offload_tuple *ft = &flow->tuplehash[dir].tuple;
	struct nf_conntrack_tuple *ctt = &ct->tuplehash[dir].tuple;
	struct dst_entry *other_dst = route->tuple[!dir].dst;
	struct dst_entry *dst = route->tuple[dir].dst;
	struct dst_entry *dst = nft_route_dst_fetch(route, dir);

	ft->dir = dir;