Fast handoff of roaming MAC addresses.
In switch mode, if a known MAC address is claimed by a second node before it expired at the first node, it is likely that this is because a computer has roamed from the LAN of the first node to that of the second node. To ensure packets for that computer are routed to the second node, the first node should delete its corresponding Subnet as soon as possible, without waiting for the normal expiry timeout.
This commit is contained in:
parent
e00b44cb98
commit
6f6f426b35
1 changed files with 6 additions and 1 deletions
|
@ -45,7 +45,7 @@ bool add_subnet_h(connection_t *c) {
|
|||
char subnetstr[MAX_STRING_SIZE];
|
||||
char name[MAX_STRING_SIZE];
|
||||
node_t *owner;
|
||||
subnet_t s = {0}, *new;
|
||||
subnet_t s = {0}, *new, *old;
|
||||
|
||||
if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) {
|
||||
logger(LOG_ERR, "Got bad %s from %s (%s)", "ADD_SUBNET", c->name,
|
||||
|
@ -142,6 +142,11 @@ bool add_subnet_h(connection_t *c) {
|
|||
if(!tunnelserver)
|
||||
forward_request(c);
|
||||
|
||||
/* Fast handoff of roaming MAC addresses */
|
||||
|
||||
if(s.type == SUBNET_MAC && owner != myself && (old = lookup_subnet(myself, &s)) && old->expires)
|
||||
old->expires = now;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue