diff --git a/net/sixlowpan/sixlowpan_framelist.c b/net/sixlowpan/sixlowpan_framelist.c index 8995048b00..6aca006934 100644 --- a/net/sixlowpan/sixlowpan_framelist.c +++ b/net/sixlowpan/sixlowpan_framelist.c @@ -425,6 +425,7 @@ int sixlowpan_queue_frames(FAR struct ieee802154_driver_s *ieee, /* Add the next frame to the tail of the IOB queue */ qtail->io_flink = iob; + qtail = iob; /* Keep track of the total amount of data queue */ diff --git a/wireless/ieee802154/mac802154_loopback.c b/wireless/ieee802154/mac802154_loopback.c index 1f8dc4e8c3..9cb9f09641 100644 --- a/wireless/ieee802154/mac802154_loopback.c +++ b/wireless/ieee802154/mac802154_loopback.c @@ -185,23 +185,25 @@ static int lo_txpoll(FAR struct net_driver_s *dev) /* Find the tail of the IOB queue */ for (tail = NULL, iob = head; - iob != NULL; - tail = iob, iob = iob->io_flink); + iob != NULL; + tail = iob, iob = iob->io_flink); /* Loop while there frames to be sent, i.e., while the IOB list is not * emtpy. Sending, of course, just means relaying back through the network * for this driver. */ - while (!FRAME_IOB_EMPTY(&priv->lo_ieee)) + while (head != NULL) { /* Remove the IOB from the queue */ - FRAME_IOB_REMOVE(&priv->lo_ieee, iob); + iob = head; + head = iob->io_flink; + iob->io_flink = NULL; /* Is the queue now empty? */ - if (FRAME_IOB_EMPTY(&priv->lo_ieee)) + if (head == NULL) { tail = NULL; } @@ -239,8 +241,8 @@ static int lo_txpoll(FAR struct net_driver_s *dev) /* Find the new tail of the IOB queue */ for (tail = iob, iob = iob->io_flink; - iob != NULL; - tail = iob, iob = iob->io_flink); + iob != NULL; + tail = iob, iob = iob->io_flink); } priv->lo_txdone = true;