X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fifconfig.c;h=59aa94c3815f1b85fae15de79630a61aa53248d6;hb=01dc7836703ba3aa113f3d0102f13ba73319e50b;hp=5f6146181994a9bf05f67a4aa0275316852089d0;hpb=c926b3b84317b220828c3d8b6275754c5003dfcf;p=tinc diff --git a/src/ifconfig.c b/src/ifconfig.c index 5f614618..59aa94c3 100644 --- a/src/ifconfig.c +++ b/src/ifconfig.c @@ -1,6 +1,6 @@ /* ifconfig.c -- Generate platform specific interface configuration commands - Copyright (C) 2016-2017 Guus Sliepen + Copyright (C) 2016-2018 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -71,10 +71,12 @@ void ifconfig_dhcp(FILE *out) { } void ifconfig_dhcp6(FILE *out) { + (void)out; fprintf(stderr, "DHCPv6 requested, but not supported by tinc on this platform\n"); } void ifconfig_slaac(FILE *out) { + (void)out; // It's the default? } @@ -126,7 +128,7 @@ void ifconfig_address(FILE *out, const char *value) { return; } -#elif defined(HAVE_MINGW) || defined(HAVE_CYGWIN) +#elif defined(HAVE_MINGW) switch(address.type) { case SUBNET_MAC: @@ -134,11 +136,11 @@ void ifconfig_address(FILE *out, const char *value) { break; case SUBNET_IPV4: - fprintf(out, "netsh inetface ipv4 set address \"%%INTERFACE%%\" static %s\n", address_str); + fprintf(out, "netsh interface ipv4 set address \"%%INTERFACE%%\" static %s\n", address_str); break; case SUBNET_IPV6: - fprintf(out, "netsh inetface ipv6 set address \"%%INTERFACE%%\" %s\n", address_str); + fprintf(out, "netsh interface ipv6 set address \"%%INTERFACE%%\" %s\n", address_str); break; default: @@ -199,11 +201,11 @@ void ifconfig_route(FILE *out, const char *value) { if(*gateway_str) { switch(subnet.type) { case SUBNET_IPV4: - fprintf(out, "ip route add %s via %s dev \"$INTERFACE\"\n", subnet_str, gateway_str); + fprintf(out, "ip route add %s via %s dev \"$INTERFACE\" onlink\n", subnet_str, gateway_str); break; case SUBNET_IPV6: - fprintf(out, "ip route add %s via %s dev \"$INTERFACE\"\n", subnet_str, gateway_str); + fprintf(out, "ip route add %s via %s dev \"$INTERFACE\" onlink\n", subnet_str, gateway_str); break; default: @@ -224,7 +226,7 @@ void ifconfig_route(FILE *out, const char *value) { } } -#elif defined(HAVE_MINGW) || defined(HAVE_CYGWIN) +#elif defined(HAVE_MINGW) if(*gateway_str) { switch(subnet.type) {