Hello,
There were some recent changes in the Nordic PDN library - function pdn_dynamic_info_get
that led to the changes in slm_ppp.c
and the way the application gets MTU and DNS information. Because of these changes,the application stopped sending the DNS server from the network over PPP to the client, even though it's enabled in the configuration.
Could you confirm this behavior, or am I missing something?
Here is part of the original code and the modified code below.
static int ppp_start_internal(void) { int ret; unsigned int mtu; struct ppp_context *const ctx = net_if_l2_data(ppp_iface); if (!configure_ppp_link_ip_addresses(ctx)) { return -EADDRNOTAVAIL; } ret = pdn_dynamic_params_get(PDP_CID, &ctx->ipcp.my_options.dns1_address, &ctx->ipcp.my_options.dns2_address, &mtu); if (ret) { return ret; } if (mtu) { /* Set the PPP MTU to that of the LTE link. */ mtu = MIN(mtu, sizeof(ppp_data_buf)); } else { LOG_DBG("Could not retrieve MTU, using fallback value."); mtu = CONFIG_SLM_PPP_FALLBACK_MTU; BUILD_ASSERT(sizeof(ppp_data_buf) >= CONFIG_SLM_PPP_FALLBACK_MTU); } net_if_set_mtu(ppp_iface, mtu); LOG_DBG("MTU set to %u.", mtu);
static void ppp_set_mtu(void)
{
const unsigned int mtu = ppp_retrieve_mtu();
net_if_set_mtu(ppp_iface, mtu);
LOG_DBG("MTU set to %u.", mtu);
}
static int ppp_start(void)
{
if (ppp_state == PPP_STATE_RUNNING) {
LOG_INF("PPP already running");
return 0;
}
ppp_state = PPP_STATE_STARTING;
int ret;
struct ppp_context *const ctx = net_if_l2_data(ppp_iface);
if (!configure_ppp_link_ip_addresses(ctx)) {
ret = -EADDRNOTAVAIL;
goto error;
}
ppp_set_mtu();
Thanks,
Petr