Skip to content

Commit

Permalink
Fix pfring_send_last_rx_packet checks with non standard drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Jan 15, 2024
1 parent a9aabda commit 644f7fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions userland/lib/pfring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1391,11 +1391,10 @@ int pfring_send_last_rx_packet(pfring *ring, int tx_interface_id) {
We can't send the last packet with multithread as the concept of "last"
does not apply here having threads that compete for packets
*/
if(unlikely(ring->reentrant || (!ring->long_header)))
return(PF_RING_ERROR_NOT_SUPPORTED);

if(ring && ring->send_last_rx_packet)
if(ring && ring->send_last_rx_packet) {
return(ring->send_last_rx_packet(ring, tx_interface_id));
}

return(PF_RING_ERROR_NOT_SUPPORTED);
}
Expand Down
3 changes: 3 additions & 0 deletions userland/lib/pfring_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,9 @@ int pfring_mod_send_last_rx_packet(pfring *ring, int tx_interface_id) {
if(!ring->tx.enabled_rx_packet_send)
return(PF_RING_ERROR_WRONG_CONFIGURATION);

if(unlikely(ring->reentrant || (!ring->long_header)))
return(PF_RING_ERROR_NOT_SUPPORTED);

if(ring->tx.last_received_hdr == NULL)
return(PF_RING_ERROR_NO_PKT_AVAILABLE); /* We have not yet read a single packet */

Expand Down

0 comments on commit 644f7fc

Please sign in to comment.