- p = flx_dns_packet_new();
- flx_dns_packet_set_field(p, DNS_FIELD_FLAGS, DNS_FLAGS(1, 0, 0, 0, 0, 0, 0, 0, 0, 0));
- flx_dns_packet_append_record(p, rr, FALSE);
- flx_dns_packet_set_field(p, DNS_FIELD_ANCOUNT, 1);
- flx_interface_send_packet(i, protocol, p);
- flx_dns_packet_free(p);
+ if (!flx_interface_is_relevant(i))
+ return;
+
+ if ((protocol == AF_INET || protocol == AF_UNSPEC) && i->n_ipv4_addrs > 0)
+ flx_packet_scheduler_post_response(i->ipv4_scheduler, rr);
+
+ if ((protocol == AF_INET6 || protocol == AF_UNSPEC) && i->n_ipv6_addrs > 0)
+ flx_packet_scheduler_post_response(i->ipv6_scheduler, rr);