diff options
authorAlexander Couzens <lynxis@fe80.eu>2016-05-31 14:42:38 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-06-06 00:45:10 +0200
commit86540de7f37d841b9a45cc6c67a68f714c1866dc (patch)
parentcc077ae0bc26257428adb14d913ab28adc181a01 (diff)
gtp/queue/queue_seqdel(): fix element check which was always true
Fix an apparent typo that prevented queue iteration to find the correct item to be removed. Instead, the first item was always returned. Calling code has been analyzed to find that mostly this fault is not visible, since usually, the first item is indeed the correct item to be returned. See mail thread http://lists.osmocom.org/pipermail/osmocom-net-gprs/2016-June/000618.html Date: Wed Jun 1 11:51:38 UTC 2016 Subject: "[PATCH] gtp/queue/queue_seqdel(): fix element check which always was true"
1 files changed, 1 insertions, 2 deletions
diff --git a/gtp/queue.c b/gtp/queue.c
index 5b4d849..fbfa1ec 100644
--- a/gtp/queue.c
+++ b/gtp/queue.c
@@ -105,8 +105,7 @@ static int queue_seqdel(struct queue_t *queue, struct qmsg_t *qmsg)
printf("Begin queue_seqdel seq = %d\n", (int)qmsg->seq);
for (qmsg2 = queue->hashseq[hash]; qmsg2; qmsg2 = qmsg2->seqnext) {
- /* FIXME: this is always true !?! */
- if (qmsg == qmsg) {
+ if (qmsg == qmsg2) {
if (!qmsg_prev)
queue->hashseq[hash] = qmsg2->seqnext;