static void dnss_receive_udp_packet_handler(void *arg, struct udp_pcb *udp_pcb,
struct pbuf *udp_packet_buffer, struct ip_addr *sender_addr, uint16_t sender_port)
{
	int ret=0;
	struct dns_hdr *dns_rsp;

/*
	printf("\n%s: Receive DNS query,ip = %d.%d.%d.%d, port = %d(%x)\n",__func__,\
			sender_addr->addr & 0xff,\
			sender_addr->addr>>8 & 0xff,\
			sender_addr->addr>>16 & 0xff,\
			sender_addr->addr>>24 & 0xff,\
			sender_port,sender_port);
*/

	dns_rsp = (struct dns_hdr*) udp_packet_buffer->payload;

	dns_rsp->flags1 |= 0x80; // 0x80 : Response;
	dns_rsp->flags2 = 0x05;  //0x05 : Reply code (Query Refused)

	ret = udp_sendto(udp_pcb, udp_packet_buffer, sender_addr, sender_port);

	/* free the UDP connection, so we can accept new clients */
	udp_disconnect(udp_pcb);

	/* Free the packet buffer */
	pbuf_free(udp_packet_buffer);
}
static void dnss_receive_udp_packet_handler(void *arg, struct udp_pcb *udp_pcb,
struct pbuf *udp_packet_buffer, struct ip_addr *sender_addr, uint16_t sender_port)
{
	int ret=0;
	struct dns_hdr *dns_rsp;

 

	dns_rsp = (struct dns_hdr*) udp_packet_buffer->payload;

	dns_rsp->flags1 |= 0x80;  
	dns_rsp->flags2 = 0x05;   

	ret = udp_sendto(udp_pcb, udp_packet_buffer, sender_addr, sender_port);

	 
	udp_disconnect(udp_pcb);

	 
	pbuf_free(udp_packet_buffer);
}