lwip: Fix fuzzer layers after dhcps update

This commit is contained in:
David Cermak 2022-01-24 09:58:06 +01:00
parent c005b04d1c
commit adc00d1813
3 changed files with 12 additions and 5 deletions

View File

@ -7,3 +7,4 @@
#define SSIZE_MAX INT_MAX
#undef assert
#define assert(x)
#define sys_prot_t int

View File

@ -1,11 +1,10 @@
#include "no_warn_host.h"
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/pbuf.h"
#include "lwip/udp.h"
#include "esp_netif.h"
#include "lwip/timeouts.h"
#include <string.h>
#include <stdio.h>
const ip_addr_t ip_addr_any;
const ip_addr_t ip_addr_broadcast;
@ -234,3 +233,7 @@ void mem_free(void *rmem)
{
free(rmem);
}
void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
{
}

View File

@ -29,8 +29,9 @@ int main(int argc, char** argv)
dhcp_test_init_di();
IP4_ADDR(&server_ip, 192,168,4,1);
dhcps_set_new_lease_cb(dhcp_test_dhcps_cb);
dhcps_start(&mynetif, server_ip);
dhcps_t *dhcps = dhcps_new();
dhcps_set_new_lease_cb(dhcps, dhcp_test_dhcps_cb);
dhcps_start(dhcps, &mynetif, server_ip);
#ifdef INSTR_IS_OFF
p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
@ -62,7 +63,9 @@ int main(int argc, char** argv)
p->tot_len = len;
p->next = NULL;
dhcp_test_handle_dhcp(NULL, NULL, p, &ip_addr_any, 0);
dhcp_test_handle_dhcp(dhcps, NULL, p, &ip_addr_any, 0);
}
dhcps_stop(dhcps, &mynetif);
dhcps_delete(dhcps);
return 0;
}