mirror of
https://github.com/ntop/n2n.git
synced 2024-09-20 00:51:10 +02:00
fixed supernode's federation behavior (auth error) (#707)
This commit is contained in:
parent
2e1991ecf3
commit
aac58a88ec
|
@ -1641,6 +1641,7 @@ static int process_udp (n2n_sn_t * sss,
|
||||||
if(comm->is_federation == IS_FEDERATION) {
|
if(comm->is_federation == IS_FEDERATION) {
|
||||||
skip_add = SN_ADD;
|
skip_add = SN_ADD;
|
||||||
p = add_sn_to_list_by_mac_or_sock(&(sss->federation->edges), &(ack.sock), reg.edgeMac, &skip_add);
|
p = add_sn_to_list_by_mac_or_sock(&(sss->federation->edges), &(ack.sock), reg.edgeMac, &skip_add);
|
||||||
|
p->last_seen = now;
|
||||||
// communication with other supernodes happens via standard udp port
|
// communication with other supernodes happens via standard udp port
|
||||||
p->socket_fd = sss->sock;
|
p->socket_fd = sss->sock;
|
||||||
}
|
}
|
||||||
|
@ -1676,12 +1677,14 @@ static int process_udp (n2n_sn_t * sss,
|
||||||
sock_to_cstr(sockbuf, &(ack.sock)));
|
sock_to_cstr(sockbuf, &(ack.sock)));
|
||||||
|
|
||||||
ret_value = update_edge_no_change;
|
ret_value = update_edge_no_change;
|
||||||
|
if(comm->is_federation != IS_FEDERATION) { /* REVISIT: auth among supernodes is not implemented yet */
|
||||||
if(cmn.flags & N2N_FLAGS_SOCKET) {
|
if(cmn.flags & N2N_FLAGS_SOCKET) {
|
||||||
ret_value = update_edge(sss, ®, comm, &(ack.sock), socket_fd, &(ack.auth), SN_ADD_SKIP, now);
|
ret_value = update_edge(sss, ®, comm, &(ack.sock), socket_fd, &(ack.auth), SN_ADD_SKIP, now);
|
||||||
} else {
|
} else {
|
||||||
// do not add in case of null mac (edge asking for ip address)
|
// do not add in case of null mac (edge asking for ip address)
|
||||||
ret_value = update_edge(sss, ®, comm, &(ack.sock), socket_fd, &(ack.auth), is_null_mac(reg.edgeMac) ? SN_ADD_SKIP : SN_ADD, now);
|
ret_value = update_edge(sss, ®, comm, &(ack.sock), socket_fd, &(ack.auth), is_null_mac(reg.edgeMac) ? SN_ADD_SKIP : SN_ADD, now);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(ret_value == update_edge_auth_fail) {
|
if(ret_value == update_edge_auth_fail) {
|
||||||
cmn2.pc = n2n_register_super_nak;
|
cmn2.pc = n2n_register_super_nak;
|
||||||
|
@ -2287,8 +2290,6 @@ int run_sn_loop (n2n_sn_t *sss, int *keep_running) {
|
||||||
// reset, await new prepended length
|
// reset, await new prepended length
|
||||||
conn->expected = sizeof(uint16_t);
|
conn->expected = sizeof(uint16_t);
|
||||||
conn->position = 0;
|
conn->position = 0;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user