tunmap: prep new nft ruleset: log only mapping id

Instead of logging a full nft chain/rule name like 'tunmap123', log only
the id '123'.

Rationale: with the new nft rulesets, there will be four distinct
identifiers:
 tunmap-pre-123a
 tunmap-pre-123b
 tunmap-post-123a
 tunmap-post-123b
so let's simplify.

Related: SYS#6327 SYS#6264
Change-Id: Ic46ae5bd824a211668d4ac9a77b3597eaca17146
This commit is contained in:
Neels Hofmeyr 2023-02-03 03:03:29 +01:00
parent 091603c4a4
commit fbe70076eb
1 changed files with 4 additions and 4 deletions

View File

@ -125,13 +125,13 @@ static int up_gtp_action_enable_disable(struct up_gtp_action *a, bool enable)
if (enable && a->tunmap.id != 0) {
LOG_UP_GTP_ACTION(a, LOGL_ERROR,
"Cannot enable: nft GTP tunnel mapping rule has been enabled before"
" as " NFT_CHAIN_NAME_PREFIX_TUNMAP "%u\n", a->tunmap.id);
" as nft rule id %u\n", a->tunmap.id);
return -EALREADY;
}
if (!enable && a->tunmap.id == 0) {
LOG_UP_GTP_ACTION(a, LOGL_ERROR,
"Cannot disable: nft GTP tunnel mapping rule has not been enabled"
" (no " NFT_CHAIN_NAME_PREFIX_TUNMAP " id)\n");
" (no nft rule id)\n");
return -ENOENT;
}
if (enable)
@ -140,11 +140,11 @@ static int up_gtp_action_enable_disable(struct up_gtp_action *a, bool enable)
rc = upf_nft_tunmap_delete(&a->tunmap);
if (rc) {
LOG_UP_GTP_ACTION(a, LOGL_ERROR,
"Failed to %s nft GTP tunnel mapping " NFT_CHAIN_NAME_PREFIX_TUNMAP "%u:"
"Failed to %s nft GTP tunnel mapping %u:"
" %d %s\n", enable ? "enable" : "disable", a->tunmap.id, rc, strerror(-rc));
return rc;
}
LOG_UP_GTP_ACTION(a, LOGL_NOTICE, "%s nft GTP tunnel mapping " NFT_CHAIN_NAME_PREFIX_TUNMAP "%u\n",
LOG_UP_GTP_ACTION(a, LOGL_NOTICE, "%s nft GTP tunnel mapping %u\n",
enable ? "Enabled" : "Disabled", a->tunmap.id);
if (!enable)
a->tunmap.id = 0;