Skip to content

Commit 45e24d4

Browse files
committed
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.
1 parent 5d8570b commit 45e24d4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

features/FEATURE_LWIP/lwip-interface/ppp_lwip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ const char *nsapi_ppp_get_gw_addr(FileHandle *stream)
434434

435435
static char gwaddr[IPADDR_STRLEN_MAX];
436436
if (stream == my_stream) {
437-
if (my_interface->get_netmask(gwaddr, IPADDR_STRLEN_MAX)) {
437+
if (my_interface->get_gateway(gwaddr, IPADDR_STRLEN_MAX)) {
438438
return gwaddr;
439439
}
440440
}

features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ const char *PPPCellularInterface::get_netmask()
749749

750750
const char *PPPCellularInterface::get_gateway()
751751
{
752-
return nsapi_ppp_get_ip_addr(_fh);
752+
return nsapi_ppp_get_gw_addr(_fh);
753753
}
754754

755755
/** Power down modem

0 commit comments

Comments
 (0)