Hello, I am using raw API, my system has two distinct network interfaces and there is a requirement, that (TCP) connections to certain remote addresses are made through certain network interfaces.
Furtermore, the destinations, that we must connect to might be specified as domain names, that obviously need resolving. The problem is, certain destinations must only be resolved via DNS queries, that are made through a particular network interface. For example, consider a situation, when we have a PPP netif and an ethernet netif (that is on a "local" network) and we need to connect to "foo.local" via ethernet netif. We obviously must make sure, that the DNS query is made through the ethernet interface. Hope, that makes sense. Now, I've looked through the DNS implementation and I see that there are basically two obstacles: * there is no way to specify, which interface the queries should go through (the pcb is bound to IP_ADDR_ANY without any way to override it) * the "resolver cache" (dns_table) obviously does not consider which interface the entry belongs to I am intentionally mentioning "interface" all throughout, but it can be substituted for "source address", since those are equivalent in this context. What is the best way to tackle this problem? Perhaps I should attempt to patch the dns implementation to add the "source address" argument to the relevant functions and make the entries dns_table aware of the source address of the query (falling back to IP_ADDR_ANY if source address is not specified)? Is there any other way to do this? Thanks, Mark _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
