Tell invited node about Mode and Broadcast settings.
Since these settings really should be the same for all nodes in a VPN.
This commit is contained in:
parent
57991e2642
commit
82575bd44d
1 changed files with 13 additions and 1 deletions
|
@ -381,7 +381,19 @@ int cmd_invite(int argc, char *argv[]) {
|
|||
if(netname)
|
||||
fprintf(f, "NetName = %s\n", netname);
|
||||
fprintf(f, "ConnectTo = %s\n", myname);
|
||||
// TODO: copy Broadcast and Mode
|
||||
|
||||
// Copy Broadcast and Mode
|
||||
FILE *tc = fopen(tinc_conf, "r");
|
||||
if(tc) {
|
||||
char buf[1024];
|
||||
while(fgets(buf, sizeof buf, tc)) {
|
||||
if((!strncasecmp(buf, "Mode", 4) && strchr(" \t=", buf[4]))
|
||||
|| (!strncasecmp(buf, "Broadcast", 9) && strchr(" \t=", buf[9])))
|
||||
fputs(buf, f);
|
||||
}
|
||||
fclose(tc);
|
||||
}
|
||||
|
||||
fprintf(f, "#---------------------------------------------------------------#\n");
|
||||
fprintf(f, "Name = %s\n", myname);
|
||||
|
||||
|
|
Loading…
Reference in a new issue