mirror of
https://github.com/ntop/n2n.git
synced 2024-09-20 00:51:10 +02:00
clarified error message (#634)
This commit is contained in:
parent
408f24d778
commit
54ba76e3bc
|
@ -497,11 +497,11 @@ static int setOption (int optkey, char *optargument, n2n_tuntap_priv_config_t *e
|
|||
break;
|
||||
}
|
||||
|
||||
case 'l': /* supernode-list */
|
||||
case 'l': /* supernode-list */ {
|
||||
if(optargument) {
|
||||
if(edge_conf_add_supernode(conf, optargument) != 0) {
|
||||
traceEvent(TRACE_WARNING, "Too many supernodes!");
|
||||
exit(1);
|
||||
traceEvent(TRACE_WARNING, "Failed to add supernode '%s'", optargument);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -55,9 +55,13 @@ int edge_verify_conf (const n2n_edge_conf_t *conf) {
|
|||
if(conf->community_name[0] == 0)
|
||||
return(-1);
|
||||
|
||||
// REVISIT: are the following two conditions equal? if so, remove one. but note that sn_num is used elsewhere
|
||||
if(conf->sn_num == 0)
|
||||
return(-2);
|
||||
|
||||
if(HASH_COUNT(conf->supernodes) == 0)
|
||||
return(-5);
|
||||
|
||||
if(conf->register_interval < 1)
|
||||
return(-3);
|
||||
|
||||
|
@ -65,9 +69,6 @@ int edge_verify_conf (const n2n_edge_conf_t *conf) {
|
|||
((conf->encrypt_key != NULL) && (conf->transop_id == N2N_TRANSFORM_ID_NULL)))
|
||||
return(-4);
|
||||
|
||||
if(HASH_COUNT(conf->supernodes) == 0)
|
||||
return(-5);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@ -3064,7 +3065,7 @@ int edge_conf_add_supernode (n2n_edge_conf_t *conf, const char *ip_and_port) {
|
|||
rv = supernode2sock(sock, ip_and_port);
|
||||
|
||||
if(rv != 0) {
|
||||
traceEvent(TRACE_WARNING, "Invalid socket");
|
||||
traceEvent(TRACE_WARNING, "Invalid supernode address");
|
||||
free(sock);
|
||||
return(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user