pc_nic_drv: drop incoming packets on missing uplink

Fixes sporadic null-pointer dereferences like

  [init -> nic_drv] Error: illegal READ at address 0x204 by pager_object: pd='init -> nic_drv' thread='ep' ip=0x86467
This commit is contained in:
Christian Helmuth 2023-08-16 12:45:26 +02:00
parent bd0c680ec8
commit da53a11508

View File

@ -63,9 +63,13 @@ static rx_handler_result_t handle_rx(struct sk_buff **pskb)
struct sk_buff *skb = *pskb;
struct net_device *dev = skb->dev;
struct genode_uplink_tx_packet_context ctx = { .skb = skb };
struct genode_uplink *uplink = dev_genode_uplink(dev);
if (!uplink)
return RX_HANDLER_PASS;
{
bool progress = genode_uplink_tx_packet(dev_genode_uplink(dev),
bool progress = genode_uplink_tx_packet(uplink,
uplink_tx_packet_content,
&ctx);
if (!progress)