🐞 ;; Warning: ID mismatch: expected ID x, got y

When I ran the following code, I would get at least one of the above
messages when run on the Linux CI container:

```bash
for i in $(seq 1 32); do
  dig @localhost asdf +short &
done
```

The error hasn't recurred after this change, in spite of running the
above code a dozen times.
This commit is contained in:
Brian Cunnie
2021-01-19 07:23:34 -08:00
parent 1b6d72cf49
commit c44b8e6d94

View File

@@ -13,9 +13,8 @@ func main() {
log.Fatal(err.Error())
}
query := make([]byte, 512)
for {
query := make([]byte, 512)
_, addr, err := conn.ReadFromUDP(query)
if err != nil {
log.Println(err.Error())