[En-Nut-Discussion] Problem with PPP and DNS

Krzysztof Sawicki krzysztof.sawicki at mobile.put.edu.pl
Thu Apr 11 17:05:23 CEST 2013


Hi, everyone!

I noticed that DNS configuration (DNS servers' IP) obtained via PPP 
connection is not used by for example NutDnsGetHostByName function. I 
don't know if my patch is correct, but works :)

Index: /home/ksawicki/tmp/nutos-svn/nut/net/ipcpin.c
===================================================================
--- /home/ksawicki/tmp/nutos-svn/nut/net/ipcpin.c	(revision 5087)
+++ /home/ksawicki/tmp/nutos-svn/nut/net/ipcpin.c	(working copy)
@@ -282,13 +282,19 @@
              break;
          case IPCP_MS_DNS1:
              if (xcpo->xcpo_.ul)
-                dcb->dcb_ip_dns1 = xcpo->xcpo_.ul;
+            {
+            	dcb->dcb_ip_dns1 = xcpo->xcpo_.ul;
+            	NutDnsConfig2(0,0,dcb->dcb_ip_dns1,0);
+            }
              break;
          case IPCP_MS_DNS2:
              /* Fixed secondary DNS bug, thanks to Tarmo Fimberg
                 and Jelle Martijn Kok. */
              if (xcpo->xcpo_.ul)
+            {
                  dcb->dcb_ip_dns2 = xcpo->xcpo_.ul;
+                NutDnsConfig2(0,0,0,dcb->dcb_ip_dns2);
+            }
              break;
          }
          xcpl -= xcpo->xcpo_len;

-- 
Krzysztof Sawicki
Mobile Systems Research Labs, Poznan University of Technology


More information about the En-Nut-Discussion mailing list