mirage / qubes-mirage-firewall

A Mirage firewall VM for QubesOS
BSD 2-Clause "Simplified" License
210 stars 28 forks source link

DNS: start task reading Lwt_mvar and distributing DNS replies to clients #162

Closed hannesm closed 1 year ago

hannesm commented 1 year ago

Before, a DNS request was sent and the first thing appearing in the Lwt_mvar was taken as reply. The issue with this was two-fold:

No, the separate task is a loop reading the mvar, using a Lwt_condition to signal the receive of that ID (potentially discarding if there's no client waiting). The DNS query registers itself (using the ID) in the map with a Lwt_condition, and waits to be notified (or a timeout occurs).

as outlined in #159

palainp commented 1 year ago

It works for me, I think we can merge it! Thanks for that @hannesm!

hannesm commented 1 year ago

this has been part of #163 and the 0.8.3 release