X-Git-Url: http://git.openwrt.org/?p=project%2Fmdnsd.git;a=blobdiff_plain;f=dns.c;fp=dns.c;h=51a015056d3a4d41d9c80e56488ff97f090905a7;hp=b19ad17719b7e542a29011e1c68017e2fb0bb146;hb=9f1cc226e4be47d32e4df796c94cbee1437960aa;hpb=943bedb9dae8ff083e18795a7f82c7071988ea03 diff --git a/dns.c b/dns.c index b19ad17..51a0150 100644 --- a/dns.c +++ b/dns.c @@ -351,15 +351,14 @@ parse_answer(struct interface *iface, uint8_t *buffer, int len, uint8_t **b, int static void parse_question(struct interface *iface, struct sockaddr *from, char *name, struct dns_question *q) { - struct sockaddr *to; + struct sockaddr *to = NULL; char *host; /* TODO: Multicast if more than one quarter of TTL has passed */ - if ((q->class & CLASS_UNICAST) && iface->multicast) { - iface = iface->peer; + if (q->class & CLASS_UNICAST) { to = from; - } else { - to = NULL; + if (iface->multicast) + iface = iface->peer; } DBG(1, "Q -> %s %s\n", dns_type_string(q->type), name);