Browse Source

Lock calls to netif->input() in VirtualTap

pull/8/head
staphen 4 years ago
parent
commit
3045fa6a0f
No known key found for this signature in database
GPG Key ID: E6D757EEF0CE235F
  1. 4
      src/VirtualTap.cpp

4
src/VirtualTap.cpp

@ -454,18 +454,22 @@ void zts_lwip_eth_rx(
if (Utils::ntoh(ethhdr.type) == 0x800 || Utils::ntoh(ethhdr.type) == 0x806) {
if (tap->netif4) {
LOCK_TCPIP_CORE();
if ((err = ((struct netif*)tap->netif4)->input(p, (struct netif*)tap->netif4)) != ERR_OK) {
// DEBUG_ERROR("packet input error (%d)", err);
pbuf_free(p);
}
UNLOCK_TCPIP_CORE();
}
}
if (Utils::ntoh(ethhdr.type) == 0x86DD) {
if (tap->netif6) {
LOCK_TCPIP_CORE();
if ((err = ((struct netif*)tap->netif6)->input(p, (struct netif*)tap->netif6)) != ERR_OK) {
// DEBUG_ERROR("packet input error (%d)", err);
pbuf_free(p);
}
UNLOCK_TCPIP_CORE();
}
}
}

Loading…
Cancel
Save