[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] 1.4 evdns: can have duplicate transaction ids



It seems libevent 1.4 evdns can issue duplicate transaction ids,
if the double id is first one in the list.

See attached patch for quick fix.

-- 
marko
diff --git a/evdns.c b/evdns.c
index c85f6ea..e4213ff 100644
--- a/evdns.c
+++ b/evdns.c
@@ -1119,9 +1119,10 @@ transaction_id_pick(void) {
 				if (req->trans_id == trans_id) break;
 				req = req->next;
 			} while (req != started_at);
+			if (req->trans_id == trans_id) continue;
 		}
 		/* we didn't find it, so this is a good id */
-		if (req == started_at) return trans_id;
+		return trans_id;
 	}
 }