modified: blockip/src/install.c
This commit is contained in:
@@ -153,6 +153,14 @@ int install_service(void) {
|
||||
/* 安装nftables */
|
||||
check_and_install_nftables();
|
||||
|
||||
/* 清空bip相关nft表和集合,防止历史残留 */
|
||||
char nft_clear_cmd[MAX_COMMAND_LEN];
|
||||
snprintf(nft_clear_cmd, sizeof(nft_clear_cmd),
|
||||
"nft flush table '%s'; "
|
||||
"nft delete table '%s' 2>/dev/null;",
|
||||
NFT_TABLE, NFT_TABLE);
|
||||
system(nft_clear_cmd);
|
||||
|
||||
/* 初始化规则 */
|
||||
init_nftables_rules();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user