Correct PPPCellularInterface::get_gateway()

Two cascading copy-paste errors stopped this working:

  * PPPCellularInterface::get_gateway() called
    nsapi_ppp_get_ip_address();
  * nsapi_ppp_get_gateway() called the interface's get_netmask().

First bug has always been there - second one was introduced in 5.9.

AT_CellularNetwork currently lacks calls to get both netmask and gateway
- this patch would be needed for that when added.
pull/7161/head
Kevin Bracey 2018-06-07 13:39:10 +03:00
parent 5d8570be39
commit 45e24d4682
2 changed files with 2 additions and 2 deletions

View File

@ -434,7 +434,7 @@ const char *nsapi_ppp_get_gw_addr(FileHandle *stream)
static char gwaddr[IPADDR_STRLEN_MAX]; static char gwaddr[IPADDR_STRLEN_MAX];
if (stream == my_stream) { if (stream == my_stream) {
if (my_interface->get_netmask(gwaddr, IPADDR_STRLEN_MAX)) { if (my_interface->get_gateway(gwaddr, IPADDR_STRLEN_MAX)) {
return gwaddr; return gwaddr;
} }
} }

View File

@ -749,7 +749,7 @@ const char *PPPCellularInterface::get_netmask()
const char *PPPCellularInterface::get_gateway() const char *PPPCellularInterface::get_gateway()
{ {
return nsapi_ppp_get_ip_addr(_fh); return nsapi_ppp_get_gw_addr(_fh);
} }
/** Power down modem /** Power down modem