Add the LocalDiscoveryAddress option.
When LocalDiscovery is enabled, tinc normally sends broadcast packets during PMTU discovery to the broadcast address (255.255.255.255 or ff02::1). This option lets tinc use a different address. At the moment only one LocalDiscoveryAddress can be specified.
This commit is contained in:
parent
e92b2004e2
commit
b811e980e3
5 changed files with 35 additions and 5 deletions
|
|
@ -444,6 +444,7 @@ bool setup_myself_reloadable(void) {
|
|||
char *fmode = NULL;
|
||||
char *bmode = NULL;
|
||||
char *afname = NULL;
|
||||
char *address = NULL;
|
||||
char *space;
|
||||
bool choice;
|
||||
|
||||
|
|
@ -534,6 +535,16 @@ bool setup_myself_reloadable(void) {
|
|||
get_config_bool(lookup_config(config_tree, "DirectOnly"), &directonly);
|
||||
get_config_bool(lookup_config(config_tree, "LocalDiscovery"), &localdiscovery);
|
||||
|
||||
memset(&localdiscovery_address, 0, sizeof localdiscovery_address);
|
||||
if(get_config_string(lookup_config(config_tree, "LocalDiscoveryAddress"), &address)) {
|
||||
struct addrinfo *ai = str2addrinfo(address, myport, SOCK_DGRAM);
|
||||
free(address);
|
||||
if(!ai)
|
||||
return false;
|
||||
memcpy(&localdiscovery_address, ai->ai_addr, ai->ai_addrlen);
|
||||
}
|
||||
|
||||
|
||||
if(get_config_string(lookup_config(config_tree, "Mode"), &rmode)) {
|
||||
if(!strcasecmp(rmode, "router"))
|
||||
routing_mode = RMODE_ROUTER;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue