mirror of
https://github.com/norohind/hans.git
synced 2025-04-12 20:57:15 +03:00
Remove unused code
This commit is contained in:
parent
6ae989fdee
commit
7991b11a15
@ -137,7 +137,7 @@ bool Client::handleEchoData(const TunnelHeader &header, int dataLength, uint32_t
|
||||
|
||||
clientIp = ip;
|
||||
desiredIp = ip;
|
||||
tun->setIp(ip, (ip & 0xffffff00) + 1, false);
|
||||
tun->setIp(ip, (ip & 0xffffff00) + 1);
|
||||
}
|
||||
state = STATE_ESTABLISHED;
|
||||
|
||||
|
@ -39,7 +39,7 @@ Server::Server(int tunnelMtu, const char *deviceName, const char *passphrase, ui
|
||||
this->pollTimeout = pollTimeout;
|
||||
this->latestAssignedIpOffset = FIRST_ASSIGNED_IP_OFFSET - 1;
|
||||
|
||||
tun->setIp(this->network + 1, this->network + 2, true);
|
||||
tun->setIp(this->network + 1, this->network + 2);
|
||||
|
||||
dropPrivileges();
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ Tun::~Tun()
|
||||
tun_close(fd, device);
|
||||
}
|
||||
|
||||
void Tun::setIp(uint32_t ip, uint32_t destIp, bool includeSubnet)
|
||||
void Tun::setIp(uint32_t ip, uint32_t destIp)
|
||||
{
|
||||
char cmdline[512];
|
||||
string ips = Utility::formatIp(ip);
|
||||
@ -109,13 +109,6 @@ void Tun::setIp(uint32_t ip, uint32_t destIp, bool includeSubnet)
|
||||
snprintf(cmdline, sizeof(cmdline), "/sbin/ifconfig %s %s %s netmask 255.255.255.255", device, ips.c_str(), destIps.c_str());
|
||||
if (system(cmdline) != 0)
|
||||
syslog(LOG_ERR, "could not set tun device ip address");
|
||||
|
||||
if (includeSubnet)
|
||||
{
|
||||
snprintf(cmdline, sizeof(cmdline), "/sbin/route add %s/24 %s", destIps.c_str(), destIps.c_str());
|
||||
if (system(cmdline) != 0)
|
||||
syslog(LOG_ERR, "could not add route");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user