diff --git a/src/common/pf_lldp.c b/src/common/pf_lldp.c index 0037d010..16551dd2 100644 --- a/src/common/pf_lldp.c +++ b/src/common/pf_lldp.c @@ -1968,6 +1968,10 @@ int pf_lldp_recv ( pf_lldp_peer_info_t peer_data; int err = 0; + if (net->lldp_mutex == NULL) { + return -1; + } + err = pf_lldp_parse_packet (buf, buf_len, &peer_data); if (!err) diff --git a/src/ports/linux/pnal_eth.c b/src/ports/linux/pnal_eth.c index 832129bb..ff899f44 100644 --- a/src/ports/linux/pnal_eth.c +++ b/src/ports/linux/pnal_eth.c @@ -31,6 +31,7 @@ #include <stdlib.h> #include <string.h> +#include <unistd.h> struct pnal_eth_handle { @@ -59,6 +60,9 @@ static void os_eth_task (void * thread_arg) pnal_buf_t * p = pnal_buf_alloc (PNAL_BUF_MAX_SIZE); assert (p != NULL); + // Wait to init finish + sleep(1); + while (1) { readlen = recv (eth_handle->socket, p->payload, PNAL_BUF_MAX_SIZE, 0);