Fix: Suppress netsh output
This commit is contained in:
1 parent
9269bc9c61
commit
fc32d756e6
1 file changed
+2
-2
+2
-2
@@ -212,7 +212,7 @@ int tun_route_add(uint32_t ifindex, uint32_t network, uint8_t prefix_len) {
|
||||
char cmd[256];
|
||||
struct in_addr dest_addr;
|
||||
dest_addr.s_addr = dest;
|
||||
snprintf(cmd, sizeof(cmd), "netsh interface ip add route %s/%d interface=%lu store=active",
|
||||
snprintf(cmd, sizeof(cmd), "netsh interface ip add route %s/%d interface=%lu store=active >NUL 2>&1",
|
||||
inet_ntoa(dest_addr), prefix_len, (unsigned long)ifindex);
|
||||
int sys_ret = system(cmd);
|
||||
if (sys_ret == 0) {
|
||||
@@ -257,7 +257,7 @@ int tun_route_del(uint32_t ifindex, uint32_t network, uint8_t prefix_len) {
|
||||
struct in_addr dest_addr;
|
||||
dest_addr.s_addr = htonl(network);
|
||||
char cmd[256];
|
||||
snprintf(cmd, sizeof(cmd), "netsh interface ip delete route %s/%d interface=%lu store=active",
|
||||
snprintf(cmd, sizeof(cmd), "netsh interface ip delete route %s/%d interface=%lu store=active >NUL 2>&1",
|
||||
inet_ntoa(dest_addr), prefix_len, (unsigned long)ifindex);
|
||||
int sys_ret = system(cmd);
|
||||
if (sys_ret == 0) {
|
||||
|
||||
Reference in new issue
Block a user