Skip to content

Commit

Permalink
squash: fixed release in case of no one interested
Browse files Browse the repository at this point in the history
  • Loading branch information
haukepetersen committed Mar 10, 2015
1 parent 84360d4 commit 25de728
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions sys/net/link_layer/ng_nomac/ng_nomac.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,11 @@ static void _event_cb(ng_netdev_event_t event, void *data)
pkt = (ng_pktsnip_t *)data;
/* find out, who to send the packet to */
sendto = ng_netreg_lookup(pkt->type, NG_NETREG_DEMUX_CTX_ALL);

#if ENABLE_DEBUG
/* throw away packet if no one is interested */
if (sendto == NULL) {
DEBUG("nomac: unable to forward packet of type %i\n", pkt->type);
ng_pktbuf_release(pkt);
}
#endif

/* send the packet to everyone interested in it's type */
ng_pktbuf_hold(pkt, ng_netreg_num(pkt->type, NG_NETREG_DEMUX_CTX_ALL) - 1);
while (sendto != NULL) {
Expand Down

0 comments on commit 25de728

Please sign in to comment.