From 1e5eeb16ec111fe0c1577c5b894c685d26be37ca Mon Sep 17 00:00:00 2001 From: "suren.gabrielyan" Date: Fri, 5 Feb 2021 17:56:09 +0400 Subject: [PATCH] mdns: Removed freeRTOS dependancies from fuzzer tests * Original commit: espressif/esp-idf@55716945a9908e057743d69e1d59399df03e49bd --- components/mdns/test_afl_fuzz_host/esp32_compat.h | 3 +++ components/mdns/test_afl_fuzz_host/esp_attr.h | 3 +++ .../mdns/test_afl_fuzz_host/esp_netif_loopback_mock.c | 8 ++------ .../mdns/test_afl_fuzz_host/esp_netif_objects_mock.c | 2 -- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/mdns/test_afl_fuzz_host/esp32_compat.h b/components/mdns/test_afl_fuzz_host/esp32_compat.h index e8a998e29..7f7383b9f 100644 --- a/components/mdns/test_afl_fuzz_host/esp32_compat.h +++ b/components/mdns/test_afl_fuzz_host/esp32_compat.h @@ -52,6 +52,7 @@ #define portMAX_DELAY 0xFFFFFFFF #define portTICK_PERIOD_MS 1 +#define ESP_LOGW(a,b) #define ESP_LOGD(a,b) #define ESP_LOGE(a,b,c) #define ESP_LOGV(a,b,c,d) @@ -60,6 +61,8 @@ #define __ESP_SYSTEM_H__ #define INC_TASK_H +#define pdMS_TO_TICKS(a) a +#define portTICK_RATE_MS 10 #define xSemaphoreTake(s,d) #define xTaskDelete(a) #define vTaskDelete(a) free(a) diff --git a/components/mdns/test_afl_fuzz_host/esp_attr.h b/components/mdns/test_afl_fuzz_host/esp_attr.h index 149f25c00..49bb7515d 100644 --- a/components/mdns/test_afl_fuzz_host/esp_attr.h +++ b/components/mdns/test_afl_fuzz_host/esp_attr.h @@ -2,5 +2,8 @@ #define IRAM_ATTR #define FLAG_ATTR(TYPE) #define QUEUE_H +#define __ARCH_CC_H__ #define __XTENSA_API_H__ #define SSIZE_MAX INT_MAX +#define LWIP_HDR_IP6_ADDR_H +#define LWIP_HDR_IP4_ADDR_H diff --git a/components/mdns/test_afl_fuzz_host/esp_netif_loopback_mock.c b/components/mdns/test_afl_fuzz_host/esp_netif_loopback_mock.c index 57c04b216..72ada5f9d 100644 --- a/components/mdns/test_afl_fuzz_host/esp_netif_loopback_mock.c +++ b/components/mdns/test_afl_fuzz_host/esp_netif_loopback_mock.c @@ -11,13 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "esp32_compat.h" -// mock the types to decouple from lwip -typedef void * esp_netif_t; -typedef enum { DHCP_MOCK } esp_netif_dhcp_status_t; -typedef tcpip_adapter_ip_info_t esp_netif_ip_info_t; -typedef ip6_addr_t esp_ip6_addr_t; +#include "esp32_compat.h" +#include "esp_netif_lwip_internal.h" esp_err_t esp_netif_get_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_info) { diff --git a/components/mdns/test_afl_fuzz_host/esp_netif_objects_mock.c b/components/mdns/test_afl_fuzz_host/esp_netif_objects_mock.c index 9d0213082..124144992 100644 --- a/components/mdns/test_afl_fuzz_host/esp_netif_objects_mock.c +++ b/components/mdns/test_afl_fuzz_host/esp_netif_objects_mock.c @@ -15,8 +15,6 @@ #include "esp_netif.h" #include "sys/queue.h" #include "esp_log.h" -#include "freertos/FreeRTOS.h" -#include "freertos/semphr.h" #include "esp_netif_private.h" #include