projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Run ip link up before adding addresses and routes
[tinc]
/
src
/
ifconfig.c
diff --git
a/src/ifconfig.c
b/src/ifconfig.c
index
d4f1386
..
9913b81
100644
(file)
--- a/
src/ifconfig.c
+++ b/
src/ifconfig.c
@@
-28,6
+28,9
@@
static long start;
#ifndef HAVE_WINDOWS
void ifconfig_header(FILE *out) {
fprintf(out, "#!/bin/sh\n");
#ifndef HAVE_WINDOWS
void ifconfig_header(FILE *out) {
fprintf(out, "#!/bin/sh\n");
+#ifdef HAVE_LINUX
+ fprintf(out, "ip link set \"$INTERFACE\" up\n");
+#endif
start = ftell(out);
}
start = ftell(out);
}
@@
-50,12
+53,17
@@
void ifconfig_slaac(FILE *out) {
bool ifconfig_footer(FILE *out) {
if(ftell(out) == start) {
bool ifconfig_footer(FILE *out) {
if(ftell(out) == start) {
- fprintf(out, "echo 'Unconfigured tinc-up script, please edit '$0'!'\n\n#ifconfig $INTERFACE <your vpn IP address> netmask <netmask of whole VPN>\n");
- return false;
- } else {
+ fprintf(out,
#ifdef HAVE_LINUX
#ifdef HAVE_LINUX
- fprintf(out, "ip link set \"$INTERFACE\" up\n");
+ "#ip addr add <your vpn IP address>/<prefix of whole VPN> dev $INTERFACE\n"
#else
#else
+ "#ifconfig $INTERFACE <your vpn IP address>/<prefix of whole VPN>\n"
+#endif
+ "\n"
+ "echo \"Unconfigured tinc-up script, please edit '$0'!\" >&2\n");
+ return false;
+ } else {
+#ifndef HAVE_LINUX
fprintf(out, "ifconfig \"$INTERFACE\" up\n");
#endif
return true;
fprintf(out, "ifconfig \"$INTERFACE\" up\n");
#endif
return true;