Skip to content

Commit

Permalink
Merge pull request #206 from flaviojs/fix-data-race-atm_bridge_recv_pkt
Browse files Browse the repository at this point in the history
Fix data race in atm_bridge_recv_pkt.
  • Loading branch information
grossmj authored Mar 29, 2024
2 parents 0a8b031 + 4808490 commit e7bca8c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/atm_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ static int atm_bridge_recv_cell(netio_desc_t *nio,
static int atm_bridge_recv_pkt(netio_desc_t *nio,u_char *pkt,ssize_t len,
atm_bridge_t *t)
{
return(atm_aal5_send_rfc1483b(t->atm_nio,t->vpi,t->vci,pkt,len));
int res;

ATM_BRIDGE_LOCK(t);
res = atm_aal5_send_rfc1483b(t->atm_nio,t->vpi,t->vci,pkt,len);
ATM_BRIDGE_UNLOCK(t);
return(res);
}

/* Create a virtual ATM bridge */
Expand Down

0 comments on commit e7bca8c

Please sign in to comment.