Skip to content

Commit ae052e5

Browse files
authored
Merge pull request #905 from david-cermak/fix/eppp_netif_rx_err
[eppp]: Fix tun netif to (optionally) return errors
2 parents 318e41b + 44524f5 commit ae052e5

File tree

5 files changed

+27
-5
lines changed

5 files changed

+27
-5
lines changed

components/eppp_link/.cz.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ commitizen:
33
bump_message: 'bump(eppp): $current_version -> $new_version'
44
pre_bump_hooks: python ../../ci/changelog.py eppp_link
55
tag_format: eppp-v$version
6-
version: 1.1.2
6+
version: 1.1.3
77
version_files:
88
- idf_component.yml

components/eppp_link/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [1.1.3](https://github.com/espressif/esp-protocols/commits/eppp-v1.1.3)
4+
5+
### Bug Fixes
6+
7+
- Fix test dependency issue on driver ([1ace92c2](https://github.com/espressif/esp-protocols/commit/1ace92c2))
8+
- Fix tun netif to (optionally) return errors ([7a6cf0f9](https://github.com/espressif/esp-protocols/commit/7a6cf0f9))
9+
310
## [1.1.2](https://github.com/espressif/esp-protocols/commits/eppp-v1.1.2)
411

512
### Bug Fixes

components/eppp_link/eppp_netif_tun.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@
1717
#include "esp_check.h"
1818
#include "esp_idf_version.h"
1919

20+
#if defined(CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS)
21+
typedef esp_err_t esp_netif_recv_ret_t;
22+
#define ESP_NETIF_OPTIONAL_RETURN_CODE(expr) expr
23+
#else
24+
typedef void esp_netif_recv_ret_t;
25+
#define ESP_NETIF_OPTIONAL_RETURN_CODE(expr)
26+
#endif // CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS
27+
2028
static const char *TAG = "eppp_tun_netif";
2129

22-
static void tun_input(void *h, void *buffer, unsigned int len, void *eb)
30+
static esp_netif_recv_ret_t tun_input(void *h, void *buffer, unsigned int len, void *eb)
2331
{
2432
__attribute__((unused)) esp_err_t ret = ESP_OK;
2533
struct netif *netif = h;
@@ -31,11 +39,12 @@ static void tun_input(void *h, void *buffer, unsigned int len, void *eb)
3139
ESP_GOTO_ON_FALSE(pbuf_remove_header(p, SIZEOF_ETH_HDR) == 0, ESP_FAIL, err, TAG, "pbuf_remove_header failed");
3240
memcpy(p->payload, buffer, len);
3341
ESP_GOTO_ON_FALSE(netif->input(p, netif) == ERR_OK, ESP_FAIL, err, TAG, "failed to input packet to lwip");
34-
return;
42+
return ESP_NETIF_OPTIONAL_RETURN_CODE(ESP_OK);
3543
err:
3644
if (p) {
3745
pbuf_free(p);
3846
}
47+
return ESP_NETIF_OPTIONAL_RETURN_CODE(ret);
3948
}
4049

4150
static err_t tun_output(struct netif *netif, struct pbuf *p)

components/eppp_link/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.1.2
1+
version: 1.1.3
22
url: https://github.com/espressif/esp-protocols/tree/master/components/eppp_link
33
description: The component provides a general purpose PPP connectivity, typically used as WiFi-PPP router
44
dependencies:
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER "5.3")
2+
set(driver_deps esp_driver_gpio esp_driver_spi esp_driver_uart esp_driver_sdio)
3+
else()
4+
set(driver_deps driver)
5+
endif()
6+
17
idf_component_register(SRCS app_main.c
28
INCLUDE_DIRS "."
39
REQUIRES test_utils
4-
PRIV_REQUIRES unity nvs_flash esp_netif driver esp_event)
10+
PRIV_REQUIRES unity nvs_flash esp_netif esp_event ${driver_deps})

0 commit comments

Comments
 (0)