[S] Change in osmo-hnbgw[master]: warn earlier for missing nftables support
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/37076?usp=email ) Change subject: warn earlier for missing nftables support ...................................................................... warn earlier for missing nftables support Change-Id: Ib19a3f671b096c349c13ed650837c621ac7ecd20 --- M src/osmo-hnbgw/hnbgw_vty.c 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/76/37076/1 diff --git a/src/osmo-hnbgw/hnbgw_vty.c b/src/osmo-hnbgw/hnbgw_vty.c index d719c29..f20dbff 100644 --- a/src/osmo-hnbgw/hnbgw_vty.c +++ b/src/osmo-hnbgw/hnbgw_vty.c @@ -887,6 +887,7 @@ NFT_KPI_STR "Set a custom nft table name to use, instead of 'osmo-hnbgw'\n") { +#if ENABLE_NFTABLES const char *set_table_name = NULL; if (argc > 0) set_table_name = argv[0]; @@ -898,12 +899,18 @@ osmo_talloc_replace_string(g_hnbgw, &g_hnbgw->config.nft_kpi.table_name, set_table_name); return CMD_SUCCESS; +#else + /* This VTY cmd is trying to enable nft-kpi, but this binary does not support nftables. Error immediately. */ + vty_out(vty, "%% ERROR: Built without libnftables support, cannot enable nft-kpi%s", VTY_NEWLINE); + return CMD_WARNING; +#endif } DEFUN(cfg_hnbgw_no_nft_kpi, cfg_hnbgw_no_nft_kpi_cmd, "no nft-kpi", NO_STR NFT_KPI_STR) { + /* This function has no #if ENABLE_NFTABLES: always allow to switch off nft-kpi. */ if (vty->type == VTY_TERM) vty_out(vty, "%% WARNING: nft configuration changes need a restart of osmo-hnbgw%s", VTY_NEWLINE); g_hnbgw->config.nft_kpi.enable = false; -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/37076?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ib19a3f671b096c349c13ed650837c621ac7ecd20 Gerrit-Change-Number: 37076 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr@sysmocom.de> Gerrit-MessageType: newchange
participants (1)
-
neels