Skip to content

Commit 172c69e

Browse files
kjbraceyadbridge
authored andcommitted
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 09e1456 commit 172c69e

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
@@ -452,7 +452,7 @@ const char *nsapi_ppp_get_gw_addr(FileHandle *stream)
452452

453453
static char gwaddr[IPADDR_STRLEN_MAX];
454454
if (stream == my_stream) {
455-
if (my_interface->get_netmask(gwaddr, IPADDR_STRLEN_MAX)) {
455+
if (my_interface->get_gateway(gwaddr, IPADDR_STRLEN_MAX)) {
456456
return gwaddr;
457457
}
458458
}

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)