mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 23:12:09 +00:00
bridgeif/slipif/zepif: check that input callback is not NULL
This commit is contained in:
parent
38614e4f3e
commit
25497bb387
@ -418,6 +418,7 @@ bridgeif_init(struct netif *netif)
|
|||||||
mem_size_t alloc_len;
|
mem_size_t alloc_len;
|
||||||
|
|
||||||
LWIP_ASSERT("netif != NULL", (netif != NULL));
|
LWIP_ASSERT("netif != NULL", (netif != NULL));
|
||||||
|
LWIP_ASSERT("bridgeif needs an input callback", (netif->input != NULL));
|
||||||
#if !BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT
|
#if !BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT
|
||||||
if (netif->input == tcpip_input) {
|
if (netif->input == tcpip_input) {
|
||||||
LWIP_DEBUGF(BRIDGEIF_DEBUG | LWIP_DBG_ON, ("bridgeif does not need tcpip_input, use netif_input/ethernet_input instead"));
|
LWIP_DEBUGF(BRIDGEIF_DEBUG | LWIP_DBG_ON, ("bridgeif does not need tcpip_input, use netif_input/ethernet_input instead"));
|
||||||
|
@ -362,6 +362,8 @@ slipif_init(struct netif *netif)
|
|||||||
struct slipif_priv *priv;
|
struct slipif_priv *priv;
|
||||||
u8_t sio_num;
|
u8_t sio_num;
|
||||||
|
|
||||||
|
LWIP_ASSERT("slipif needs an input callback", netif->input != NULL);
|
||||||
|
|
||||||
/* netif->state contains serial port number */
|
/* netif->state contains serial port number */
|
||||||
sio_num = LWIP_PTR_NUMERIC_CAST(u8_t, netif->state);
|
sio_num = LWIP_PTR_NUMERIC_CAST(u8_t, netif->state);
|
||||||
|
|
||||||
|
@ -224,6 +224,8 @@ zepif_init(struct netif *netif)
|
|||||||
struct zepif_init *init_state = (struct zepif_init *)netif->state;
|
struct zepif_init *init_state = (struct zepif_init *)netif->state;
|
||||||
struct zepif_state *state = (struct zepif_state *)mem_malloc(sizeof(struct zepif_state));
|
struct zepif_state *state = (struct zepif_state *)mem_malloc(sizeof(struct zepif_state));
|
||||||
|
|
||||||
|
LWIP_ASSERT("zepif needs an input callback", netif->input != NULL);
|
||||||
|
|
||||||
if (state == NULL) {
|
if (state == NULL) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user