Re: [lwip-users] help with mDNS sending a DNS_RRTYPE_SRV query
Hi Antonio, didn't you already figure out a couple of mails back that the problem is that your stack is too small so you get a stack overflow in mdns_readname? The recursive function has a max depth check so you shouldn't be in an infinite recursive loop. BR /Jens On 2018-04-10 14:14, antonio wrote: Hi Erik, I am using a simulation like environment, and since I am using a loopback interface, and I am unable to see TX/RX packets through wireshark on the *loopback_if *127.0.0.1. However, I added my own hack functionality *err_t mdns_resolve(const char* hostname, ip_addr_t *addr, dns_found_callback fn_callback, void *cb_arg)*{ gethostbyname(hostname, addr,.); } is able to correctly resolve my own hostname and also neighbor devices. To do so, I added an additional function do DNS to help me resolve my own hostname. *err_t dns_add_mdns_entry(const char* hostname, const ip_addr_t *addr, u8_t dns_addrtype)* So after validating my hostname with MDNS, i.e, after conflict-free PROBING+ANNOUNCING, I call dns_add_mdns_entry, which adds my own entry to the LWIP DNS TABLE. -- Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users
Re: [lwip-users] help with mDNS sending a DNS_RRTYPE_SRV query
Hi Erik, I am using a simulation like environment, and since I am using a loopback interface, and I am unable to see TX/RX packets through wireshark on the *loopback_if *127.0.0.1. However, I added my own hack functionality *err_t mdns_resolve(const char* hostname, ip_addr_t *addr, dns_found_callback fn_callback, void *cb_arg)*{ gethostbyname(hostname, addr,.); } is able to correctly resolve my own hostname and also neighbor devices. To do so, I added an additional function do DNS to help me resolve my own hostname. *err_t dns_add_mdns_entry(const char* hostname, const ip_addr_t *addr, u8_t dns_addrtype)* So after validating my hostname with MDNS, i.e, after conflict-free PROBING+ANNOUNCING, I call dns_add_mdns_entry, which adds my own entry to the LWIP DNS TABLE. -- Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users
Re: [lwip-users] help with mDNS sending a DNS_RRTYPE_SRV query
Can you record it with wireshark and send a pcap file? /Erik On 9 April 2018 at 10:20, antoniowrote: > HI Simon, > > Let me see if I can be clear. > > I have an application using loopback interface. The goal is to test mDNS > functions and observe queries and responses., > > a) My application first tries a DNS_RRTYPE_A query, and I get a response. > here there is no problem. > > b) The problem happens whenever I send a DNS_RRTYPE_SRV query. Here, I > NEVER > get an answer, because, the receiver is unable to compose and send back an > answer. > > Debugging the code, I realize that the function mdns_add_srv_answer calls > mdns_add_answer and later function never returns :( . > > I hope my explanation clarifies you. > > Thanks in advance. > > > > > > -- > Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html > > ___ > lwip-users mailing list > lwip-users@nongnu.org > https://lists.nongnu.org/mailman/listinfo/lwip-users > ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users
Re: [lwip-users] help with mDNS sending a DNS_RRTYPE_SRV query
HI Simon, Let me see if I can be clear. I have an application using loopback interface. The goal is to test mDNS functions and observe queries and responses., a) My application first tries a DNS_RRTYPE_A query, and I get a response. here there is no problem. b) The problem happens whenever I send a DNS_RRTYPE_SRV query. Here, I NEVER get an answer, because, the receiver is unable to compose and send back an answer. Debugging the code, I realize that the function mdns_add_srv_answer calls mdns_add_answer and later function never returns :( . I hope my explanation clarifies you. Thanks in advance. -- Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users
Re: [lwip-users] help with mDNS sending a DNS_RRTYPE_SRV query
antonio wrote: > The problem is the function that requires recursion (*mdns_readname*). The > error is related to */Stack Overflow/.. * So this is not related to threads? Then please describe the actual problem you see. I'm getting lost in all the other things you write... Simon ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users
Re: [lwip-users] help with mDNS sending a DNS_RRTYPE_SRV query
On 05.04.2018 16:24, antonio wrote: > I have a small application using MDNS, and I use the loopback interface. > At the beginning the Thread1 starts the MDNS process, Q: Wait, why are you talking about threads? You are using the callback API of lwIP, right? There should not be more than one thread in that case. Hi Simon, The problem is the function that requires recursion (*mdns_readname*). The error is related to */Stack Overflow/.. * Since to build a *DNS_RRTYPE_A* responses does not use that function, then it works perfectly. Inside function mdns_add_srv_answer()... setting the last input parameter of mdns_add_answer() to NULL, solves this problem since it will not call mdns_write_domain, which in turn calls *mdns_readname*. But I am not happy with the ack. -- Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users
Re: [lwip-users] help with mDNS sending a DNS_RRTYPE_SRV query
On 05.04.2018 16:24, antonio wrote: I have a small application using MDNS, and I use the loopback interface. At the beginning the Thread1 starts the MDNS process, Wait, why are you talking about threads? You are using the callback API of lwIP, right? There should not be more than one thread in that case. Simon ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users
[lwip-users] help with mDNS sending a DNS_RRTYPE_SRV query
Hi all, I have a small problem. I have a small application using MDNS, and I use the loopback interface. At the beginning the Thread1 starts the MDNS process, and I can see that it sends 3 probes and 2 responses. All these messages are correctly received also. After that I call Thread2 Is able to send a DNS_RRTYPE_A query to myself and see the response.. >MDNS: thread_mdns_q Sending query... MDNS: Sending [PROBE] packet, len=28, unicast=0 +---MDNS--+ MDNS: Received IPv4 MDNS packet from 127.0.0.1, len 28 MDNS: Query for domain lwip.local. type 1 class 1 MDNS: Responding with A record MDNS: Sending [RESPONSE] packet, len=38, unicast=1 +---MDNS--+ MDNS: Received IPv4 MDNS packet from 127.0.0.1, len 38 MDNS: Answer for domain lwip.local. type 1 class 1 PROBLEM: However, when I try to send a DNS_RRTYPE_SRV query, the query is sent, and received.. The problem is that The REPLY(RESPONSE) is never sent back, because, the main reason is that the function mdns_write_domain gets stuck. >MDNS: thread_mdns_q Sending query... MDNS: Sending [PROBE] packet, len=39, unicast=0 +---MDNS--+ MDNS: Received IPv4 MDNS packet from 127.0.0.1, len 39 MDNS: Query for domain mySSH._ssh._tcp.local. type 255 class 1 MDNS: Responding with SRV record I don't know what I am doing wrong.. All hints and suggestions are welcome. Thanks in advance. -- Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users