mirror of
https://github.com/ntop/n2n.git
synced 2024-09-20 00:51:10 +02:00
made gratuitous arp being sent at the right time (#635)
This commit is contained in:
parent
54ba76e3bc
commit
c73e59341d
|
@ -950,7 +950,7 @@ int main (int argc, char* argv[]) {
|
||||||
runlevel = 2;
|
runlevel = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
eee->last_sup = 1; /* to prevent gratuitous arp packet */
|
eee->last_sup = 0; /* if it wasn't zero yet */
|
||||||
eee->curr_sn = eee->conf.supernodes;
|
eee->curr_sn = eee->conf.supernodes;
|
||||||
|
|
||||||
while(runlevel < 5) {
|
while(runlevel < 5) {
|
||||||
|
@ -1072,7 +1072,6 @@ int main (int argc, char* argv[]) {
|
||||||
eee->last_sweep = now_time - SWEEP_TIME + 2 * BOOTSTRAP_TIMEOUT;
|
eee->last_sweep = now_time - SWEEP_TIME + 2 * BOOTSTRAP_TIMEOUT;
|
||||||
eee->sn_wait = 1;
|
eee->sn_wait = 1;
|
||||||
eee->last_register_req = 0;
|
eee->last_register_req = 0;
|
||||||
eee->last_sup = 0; /* to allow gratuitous arp packet after regular REGISTER_SUPER_ACK */
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if(eee->tuntap_priv_conf.daemon) {
|
if(eee->tuntap_priv_conf.daemon) {
|
||||||
|
|
|
@ -2229,14 +2229,18 @@ void readFromIPSocket (n2n_edge_t * eee, int in_sock) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!eee->last_sup) {
|
// update last_sup only on 'real' REGISTER_SUPER_ACKs, not on bootstrap ones (null_mac)
|
||||||
// indicates successful connection between the edge and a supernode
|
// this allows reliable in/out PACKET drop if not really registered with a supernode yet
|
||||||
traceEvent(TRACE_NORMAL, "[OK] Edge Peer <<< ================ >>> Super Node");
|
if(!is_null_mac(ra.edgeMac)) {
|
||||||
// send gratuitous ARP only upon first registration with supernode
|
if(!eee->last_sup) {
|
||||||
send_grat_arps(eee);
|
// indicates successful connection between the edge and a supernode
|
||||||
|
traceEvent(TRACE_NORMAL, "[OK] Edge Peer <<< ================ >>> Super Node");
|
||||||
|
// send gratuitous ARP only upon first registration with supernode
|
||||||
|
send_grat_arps(eee);
|
||||||
|
}
|
||||||
|
eee->last_sup = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
eee->last_sup = now;
|
|
||||||
eee->sn_wait = 0;
|
eee->sn_wait = 0;
|
||||||
eee->sup_attempts = N2N_EDGE_SUP_ATTEMPTS; /* refresh because we got a response */
|
eee->sup_attempts = N2N_EDGE_SUP_ATTEMPTS; /* refresh because we got a response */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user