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

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

parents b2559a3f c14303f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ nf_flow_table_offload_del_cb(struct nf_flowtable *flow_table,
}

int flow_offload_route_init(struct flow_offload *flow,
			    const struct nf_flow_route *route);
			    struct nf_flow_route *route);

int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow);
void flow_offload_refresh(struct nf_flowtable *flow_table,
+13 −3
Original line number Diff line number Diff line
@@ -74,13 +74,23 @@ struct flow_offload *flow_offload_alloc(struct nf_conn *ct)
}
EXPORT_SYMBOL_GPL(flow_offload_alloc);

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 int flow_offload_fill_route(struct flow_offload *flow,
				   const struct nf_flow_route *route,
				   struct nf_flow_route *route,
				   enum flow_offload_tuple_dir dir)
{
	struct flow_offload_tuple *flow_tuple = &flow->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);

	if (!dst_hold_safe(route->tuple[dir].dst))
		return -1;
@@ -101,7 +111,7 @@ static int flow_offload_fill_route(struct flow_offload *flow,
}

int flow_offload_route_init(struct flow_offload *flow,
			    const struct nf_flow_route *route)
			    struct nf_flow_route *route)
{
	int err;