Make broadcast addresses configurable.
This adds a new option, BroadcastSubnet, that allows the user to declare broadcast subnets, i.e. subnets which are considered broadcast addresses by the tinc routing layer. Previously only the global IPv4 and IPv6 broadcast addresses were supported by virtue of being hardcoded. This is useful when using tinc in router mode with Ethernet virtual devices, as it can be used to provide broadcast support for a local broadcast address (e.g. 10.42.255.255) instead of just the global address (255.255.255.255). This is implemented by removing hardcoded broadcast addresses and introducing "broadcast subnets", which are subnets with a NULL owner. By default, behavior is unchanged; this is accomplished by adding the global broadcast addresses for Ethernet, IPv4 and IPv6 at start time.
This commit is contained in:
parent
b54fde6747
commit
46a5aa0d67
5 changed files with 58 additions and 38 deletions
|
|
@ -347,11 +347,14 @@ int reload_configuration(void) {
|
|||
|
||||
if(strictsubnets) {
|
||||
for splay_each(subnet_t, subnet, subnet_tree)
|
||||
subnet->expires = 1;
|
||||
if (subnet->owner)
|
||||
subnet->expires = 1;
|
||||
|
||||
load_all_subnets();
|
||||
|
||||
for splay_each(subnet_t, subnet, subnet_tree) {
|
||||
if (!subnet->owner)
|
||||
continue;
|
||||
if(subnet->expires == 1) {
|
||||
send_del_subnet(everyone, subnet);
|
||||
if(subnet->owner->status.reachable)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue