Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Socket USBHostWANDongle lwip-sys lwip
Fork of VodafoneUSBModem by
Revision 38:d19354028042, committed 2012-09-19
- Comitter:
- donatien
- Date:
- Wed Sep 19 15:33:13 2012 +0000
- Parent:
- 37:c1fd83bd31b4
- Child:
- 40:9c6c87297a37
- Commit message:
- Use DNS servers provided by the network
Changed in this revision
| ip/PPPIPInterface.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ip/PPPIPInterface.cpp Wed Sep 19 10:18:48 2012 +0000
+++ b/ip/PPPIPInterface.cpp Wed Sep 19 15:33:13 2012 +0000
@@ -43,6 +43,9 @@
extern "C" {
#include "lwip/ip_addr.h"
#include "lwip/inet.h"
+#include "lwip/err.h"
+#include "lwip/dns.h"
+
#include "netif/ppp/ppp.h"
}
@@ -331,6 +334,16 @@
DBG("Remote IP address: %s", inet_ntoa(addrs->his_ipaddr));
DBG("Primary DNS: %s", inet_ntoa(addrs->dns1));
DBG("Secondary DNS: %s", inet_ntoa(addrs->dns2));
+ //Setup DNS
+ if (addrs->dns1.addr != 0)
+ {
+ dns_setserver(0, (struct ip_addr*)&(addrs->dns1));
+ }
+ if (addrs->dns2.addr != 0)
+ {
+ dns_setserver(1, (struct ip_addr*)&(addrs->dns1));
+ }
+
pIf->setConnected(true);
pIf->setIPAddress(inet_ntoa(addrs->our_ipaddr));
break;
