Browse Source

Update sn_utils.c

pull/439/head
francesco_carli 4 years ago
committed by GitHub
parent
commit
31269dde52
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/sn_utils.c

4
src/sn_utils.c

@ -205,9 +205,6 @@ static int try_broadcast(n2n_sn_t * sss,
/** Initialise some fields of the community structure **/ /** Initialise some fields of the community structure **/
int comm_init(struct sn_community *comm, char *cmn){ int comm_init(struct sn_community *comm, char *cmn){
comm = (struct sn_community*)malloc(sizeof(struct sn_community));
memset(comm, 0, sizeof(struct sn_community));
strncpy((char*)comm->community, cmn, N2N_COMMUNITY_SIZE-1); strncpy((char*)comm->community, cmn, N2N_COMMUNITY_SIZE-1);
comm->community[N2N_COMMUNITY_SIZE-1] = '\0'; comm->community[N2N_COMMUNITY_SIZE-1] = '\0';
comm->is_federation = IS_NO_FEDERATION; comm->is_federation = IS_NO_FEDERATION;
@ -983,6 +980,7 @@ static int process_udp(n2n_sn_t * sss,
if(!comm && (!sss->lock_communities || (match == 1))) { if(!comm && (!sss->lock_communities || (match == 1))) {
comm = (struct sn_community*)calloc(1,sizeof(struct sn_community));
comm_init(comm,(char *)cmn.community); comm_init(comm,(char *)cmn.community);
if(comm) { if(comm) {

Loading…
Cancel
Save