nft: ensure to assign rule id only once

Make sure an assigned id is not overwritten.

So far this function was guaranteed to be called only once. But I would
like to allow getting the nftables ruleset string more than once in a
future patch. Prepare that.

Change-Id: I4e8c48c01fb2f5d4cfd223fe03abbf15b1a55670
This commit is contained in:
Neels Janosch Hofmeyr
2022-12-07 23:51:21 +01:00
parent bd737c14fa
commit 08af1f15f8
2 changed files with 7 additions and 2 deletions

View File

@@ -42,6 +42,7 @@ struct upf_nft_tunmap_desc {
struct osmo_sockaddr gtp_remote_addr;
uint32_t remote_teid;
} core;
/* id as in ruleset name 'tunmap<id>'. If zero, no id has been assigned yet. */
uint32_t id;
};