Răsfoiți Sursa

PPP, documentation: Fix example code

Fix the example code in status_cb() because dns_getserver() returns
const ip_addr_t *.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Axel Lin 9 ani în urmă
părinte
comite
e040132d92
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      doc/ppp.txt

+ 3 - 3
doc/ppp.txt

@@ -79,7 +79,7 @@ static void status_cb(ppp_pcb *pcb, int err_code, void *ctx) {
   switch(err_code) {
     case PPPERR_NONE: {
 #if LWIP_DNS
-      ip_addr_t ns;
+      const ip_addr_t *ns;
 #endif /* LWIP_DNS */
       printf("status_cb: Connected\n");
 #if PPP_IPV4_SUPPORT
@@ -88,9 +88,9 @@ static void status_cb(ppp_pcb *pcb, int err_code, void *ctx) {
       printf("   netmask     = %s\n", ipaddr_ntoa(&pppif->netmask));
 #if LWIP_DNS
       ns = dns_getserver(0);
-      printf("   dns1        = %s\n", ipaddr_ntoa(&ns));
+      printf("   dns1        = %s\n", ipaddr_ntoa(ns));
       ns = dns_getserver(1);
-      printf("   dns2        = %s\n", ipaddr_ntoa(&ns));
+      printf("   dns2        = %s\n", ipaddr_ntoa(ns));
 #endif /* LWIP_DNS */
 #endif /* PPP_IPV4_SUPPORT */
 #if PPP_IPV6_SUPPORT