feature: add ip-alias option.

This commit is contained in:
Nick Peng
2023-08-16 22:47:47 +08:00
parent c19a39a447
commit 1054229efb
10 changed files with 638 additions and 96 deletions

View File

@@ -376,23 +376,21 @@ bool Server::Start(const std::string &conf, enum CONF_TYPE type)
}
smartdns_reg_post_func(Server::StartPost, this);
smartdns_main(args.size(), argv, fds[1]);
smartdns_main(args.size(), argv, fds[1], 0);
_exit(1);
} else if (pid < 0) {
return false;
}
} else if (mode_ == CREATE_MODE_THREAD) {
thread_ = std::thread([&]() {
std::vector<std::string> args = {
"smartdns", "-f", "-x", "-c", conf_file_, "-p", "-",
};
std::vector<std::string> args = {"smartdns", "-f", "-x", "-c", conf_file_, "-p", "-", "-S"};
char *argv[args.size() + 1];
for (size_t i = 0; i < args.size(); i++) {
argv[i] = (char *)args[i].c_str();
}
smartdns_reg_post_func(Server::StartPost, this);
smartdns_main(args.size(), argv, fds[1]);
smartdns_main(args.size(), argv, fds[1], 1);
smartdns_reg_post_func(nullptr, nullptr);
});
} else {