@@ -65,12 +65,13 @@ static err_t tun_output_v4(struct netif *netif, struct pbuf *p, const ip4_addr_t
65
65
LWIP_UNUSED_ARG (ipaddr );
66
66
return tun_output (netif , p );
67
67
}
68
+ #if LWIP_IPV6
68
69
static err_t tun_output_v6 (struct netif * netif , struct pbuf * p , const ip6_addr_t * ipaddr )
69
70
{
70
71
LWIP_UNUSED_ARG (ipaddr );
71
72
return tun_output (netif , p );
72
73
}
73
-
74
+ #endif
74
75
static err_t tun_init (struct netif * netif )
75
76
{
76
77
if (netif == NULL ) {
@@ -151,9 +152,12 @@ static void cmd_ping_on_ping_end(esp_ping_handle_t hdl, void *args)
151
152
}
152
153
if (IP_IS_V4 (& target_addr )) {
153
154
ESP_LOGD (TAG , "\n--- %s ping statistics ---\n" , inet_ntoa (* ip_2_ip4 (& target_addr )));
154
- } else {
155
+ }
156
+ #if LWIP_IPV6
157
+ else {
155
158
ESP_LOGD (TAG , "\n--- %s ping statistics ---\n" , inet6_ntoa (* ip_2_ip6 (& target_addr )));
156
159
}
160
+ #endif
157
161
ESP_LOGI (TAG , "%" PRIu32 " packets transmitted, %" PRIu32 " received, %" PRIu32 "%% packet loss, time %" PRIu32 "ms\n" ,
158
162
transmitted , received , loss , total_time_ms );
159
163
esp_ping_delete_session (hdl );
@@ -168,7 +172,11 @@ esp_err_t eppp_check_connection(esp_netif_t *netif)
168
172
ip_addr_t target_addr = {0 };
169
173
esp_netif_ip_info_t ip ;
170
174
esp_netif_get_ip_info (netif , & ip );
175
+ #if LWIP_IPV6
171
176
target_addr .u_addr .ip4 .addr = ip .gw .addr ;
177
+ #else
178
+ target_addr .addr = ip .gw .addr ;
179
+ #endif
172
180
config .target_addr = target_addr ;
173
181
esp_ping_callbacks_t cbs = {
174
182
.cb_args = netif ,
0 commit comments