Dear all,
I set up named server, and my dig client can connect to the server successfully. For a UDP packet, I wish to add an artificial rdataset to name list of Additional Section. Note that this question may look similar to my previous posts, but it is a total different question (I have solved the old questions): This is all I wrote so far: dns_message_t *msg = client->message; dns_namelist_t *section = &msg->sections[DNS_SECTION_ADDITIONAL]; dns_name_t *name = ISC_LIST_HEAD(*section); if(name != NULL) { dns_rdata_t myrdata = DNS_RDATA_INIT; dns_rdataset_t myrdataset; dns_rdatalist_t myrdatalist; dns_rdata_init(&myrdata); dns_rdataset_init(&myrdataset); dns_rdatalist_init(&myrdatalist); myrdatalist.rdclass = dns_rdataclass_in; myrdatalist.type = dns_rdatatype_txt; myrdatalist.ttl = 0; unsigned char mydata[] = "abc"; myrdata.data = (unsigned char *)mydata; myrdata.length = 4; myrdata.rdclass = dns_rdataclass_in; myrdata.type = dns_rdatatype_txt; RUNTIME_CHECK(dns_rdatalist_tordataset(&myrdatalist, &myrdataset) == ISC_R_SUCCESS); ISC_LIST_PREPEND(name->list, &myrdataset, link); //segmentation fault! } I am able to compile successfully without any warning. There was a segmentation fault happened due to ISC_LIST_APPEND. Does anyone have an idea of the error? I apologize if this question should not be asked here. If so, can anyone point me to a forum for asking the question? Thanks! Regards, Jun Xiang Tee
_______________________________________________ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users