* field (but do check the port number).
*/
if (q->ao->sys->parseaddr(&p, &s[i].addr)) goto next_row;
- if (*p != ':') break; p++;
+ if (*p != ':') break;
+ p++;
s[i].port = strtoul(p, 0, 16);
if ((i == R && gwp) ?
q->s[R].port != s[i].port :
!sockeq(q->ao, &s[i^1], &q->s[R]))
continue;
+ /* As a trap for the unwary, this file contains unhelpful entries which
+ * just mirror the source/destination addresses. If this is one of
+ * those, we'll be stuck in a cycle talking to ourselves.
+ */
+ if (sockeq(q->ao, &s[i], &s[i^3]))
+ continue;
+
/* We win. The remaining address must be the client host. We should
* proxy this query.
*/