mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-27 12:05:15 +00:00
after update to OSX 10.8 I've gotten these error:
route: writing to routing socket: Can't assign requested address add net 192.168.99.2: gateway 192.168.99.2: Can't assign requested address This change fix that!
This commit is contained in:
parent
d9d4c1dba6
commit
e1e438497a
@ -475,15 +475,19 @@ tun_setip(const char *ip, const char *other_ip, int netbits)
|
|||||||
|
|
||||||
fprintf(stderr, "Setting IP of %s to %s\n", if_name, ip);
|
fprintf(stderr, "Setting IP of %s to %s\n", if_name, ip);
|
||||||
#ifndef LINUX
|
#ifndef LINUX
|
||||||
|
struct in_addr netip;
|
||||||
|
netip.s_addr = inet_addr(ip);
|
||||||
|
netip.s_addr = netip.s_addr & net.s_addr;
|
||||||
r = system(cmdline);
|
r = system(cmdline);
|
||||||
if(r != 0) {
|
if(r != 0) {
|
||||||
return r;
|
return r;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
snprintf(cmdline, sizeof(cmdline),
|
snprintf(cmdline, sizeof(cmdline),
|
||||||
"/sbin/route add %s/%d %s",
|
"/sbin/route add %s/%d %s",
|
||||||
ip, netbits, ip);
|
inet_ntoa(netip), netbits, ip);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "Adding route %s/%d to %s\n", ip, netbits, ip);
|
fprintf(stderr, "Adding route %s/%d to %s\n", inet_ntoa(netip), netbits, ip);
|
||||||
#endif
|
#endif
|
||||||
return system(cmdline);
|
return system(cmdline);
|
||||||
#else /* WINDOWS32 */
|
#else /* WINDOWS32 */
|
||||||
|
Loading…
Reference in New Issue
Block a user