Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPPoS unable to set authentication,will always fail. (IDFGH-5284) #7047

Closed
persan666 opened this issue May 19, 2021 · 6 comments
Closed

PPPoS unable to set authentication,will always fail. (IDFGH-5284) #7047

persan666 opened this issue May 19, 2021 · 6 comments
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@persan666
Copy link

Environment

  • Development Kit: [none]
  • Module or chip used: [ESP32-WROVER-B]
  • IDF version (run git describe --tags to find it):
    // v4.3-beta3-195-g6be10fab0
  • Build System: [CMake]
  • Compiler version (run xtensa-esp32-elf-gcc --version to find it):
    // xtensa-esp32-elf-gcc (crosstool-NG esp-2020r3) 8.4.0
  • Operating System: [Windows]
  • (Windows only) environment type: [ESP Command Prompt].
  • Using an IDE?: [Yes (Eclipse)]
  • Power Supply: [Battery]

Problem Description

Unable to set authentication for PPPoS.
The call to 'esp_netif_ppp_set_auth' will always fail and return invalid parameter even though the parameters are correct.
The evaluation of macro '_IS_NETIF_POINT2POINT_TYPE' evaluates to true if the parameters are correct.

This is the implementation which not work:

esp_err_t esp_netif_ppp_set_auth(esp_netif_t *netif, esp_netif_auth_type_t authtype, const char *user, const char *passwd)
{
    if (_IS_NETIF_POINT2POINT_TYPE(netif, PPP_LWIP_NETIF)) {
        return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
    }
#if PPP_AUTH_SUPPORT
    lwip_peer2peer_ctx_t *ppp_ctx = (lwip_peer2peer_ctx_t *)netif->related_data;
    assert(ppp_ctx->base.netif_type == PPP_LWIP_NETIF);
    pppapi_set_auth(ppp_ctx->ppp, authtype, user, passwd);
#else
    ESP_LOGE(TAG, "%s failed: No authorisation enabled in menuconfig", __func__);
    return ESP_ERR_ESP_NETIF_IF_NOT_READY;
#endif
    return ESP_OK;
}

And should be changed to something like this (Notice the '!' before the macro '_IS_NETIF_POINT2POINT_TYPE'):

esp_err_t esp_netif_ppp_set_auth(esp_netif_t *netif, esp_netif_auth_type_t authtype, const char *user, const char *passwd)
{
    if (!_IS_NETIF_POINT2POINT_TYPE(netif, PPP_LWIP_NETIF)) {
        return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
    }
#if PPP_AUTH_SUPPORT
    lwip_peer2peer_ctx_t *ppp_ctx = (lwip_peer2peer_ctx_t *)netif->related_data;
    assert(ppp_ctx->base.netif_type == PPP_LWIP_NETIF);
    pppapi_set_auth(ppp_ctx->ppp, authtype, user, passwd);
#else
    ESP_LOGE(TAG, "%s failed: No authorisation enabled in menuconfig", __func__);
    return ESP_ERR_ESP_NETIF_IF_NOT_READY;
#endif
    return ESP_OK;
}

Expected Behavior

Should not return error if the parameters are correct

Actual Behavior

return error if the parameters are correct

@espressif-bot espressif-bot added the Status: Opened Issue is new label May 19, 2021
@github-actions github-actions bot changed the title PPPoS unable to set authentication,will always fail. PPPoS unable to set authentication,will always fail. (IDFGH-5284) May 19, 2021
@RobNuttall
Copy link
Contributor

We're also seeing this issue on 4.3-beta3

@AxelLin
Copy link
Contributor

AxelLin commented May 19, 2021

@david-cermak
This needs an urgent fix, the bad commit is 1a41545.

@david-cermak
Copy link
Collaborator

Thanks for reporting this bug!
Will fix and backport to the v4.3 (the SLIP interface was only added from 4.3)

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new labels Jun 1, 2021
@AxelLin
Copy link
Contributor

AxelLin commented Jun 4, 2021

v4.3-rc still includes this bug.

@AxelLin
Copy link
Contributor

AxelLin commented Jun 15, 2021

Unfortunately, the v4.3 release does not include this fix.

@persan666
Copy link
Author

I have postpone my own software release just due to this bug. Now I have to deliver a dirty one for my customers unfortunately.

What was the reason for not including this fix in the 4.3 release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

5 participants