fixed ip assignment, v0.3.1

This commit is contained in:
Friedrich Schöller 2009-08-08 17:20:56 +02:00
parent 085e76e34b
commit 05064b327e
2 changed files with 5 additions and 1 deletions

View File

@ -34,7 +34,7 @@
void usage()
{
printf(
"Hans - IP over ICMP version 0.3\n\n"
"Hans - IP over ICMP version 0.3.1\n\n"
"RUN AS SERVER\n"
" hans -s network [-fvr] [-p password] [-u unprivileged_user] [-d tun_device] [-m reference_mtu]\n\n"
"RUN AS CLIENT\n"

View File

@ -67,7 +67,11 @@ void Tun::setIp(uint32_t ip, uint32_t destIp, bool includeSubnet)
string ips = Utility::formatIp(ip);
string destIps = Utility::formatIp(destIp);
#ifdef LINUX
snprintf(cmdline, sizeof(cmdline), "/sbin/ifconfig %s %s netmask 255.255.255.0", device, ips.c_str());
#else
snprintf(cmdline, sizeof(cmdline), "/sbin/ifconfig %s %s %s netmask 255.255.255.255", device, ips.c_str(), destIps.c_str());
#endif
if (system(cmdline) != 0)
syslog(LOG_ERR, "could not set tun device ip address");