- if (q->ao->sys->parseaddr(&p, &s[0].addr)) goto next_row;
- if (*p != ':') break; p++;
- s[0].port = strtoul(p, 0, 16);
- if (!sockeq(q->ao, &q->s[i], &s[0]) &&
- (i != R || !gwp || q->s[R].port != s[0].port))
+ /* Compare an address (in the current field) with the local or remote
+ * address in the query, as indicated by `i'. The address field looks
+ * like `ADDR:PORT', where the ADDR is in some mad format which
+ * `sys->parseaddr' knows how to unpick. If the remote address in the
+ * query is our gateway then don't check the remote address in the
+ * field (but do check the port number).
+ */
+ if (q->ao->sys->parseaddr(&p, &s[i].addr)) goto next_row;
+ 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, &q->s[i], &s[i]))