Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source/pcap: fix infinite loop if interface goes down - v1 #7580

Closed
wants to merge 1 commit into from

Conversation

jufajardini
Copy link
Contributor

When in live-pcap mode, if the sniffed interface went down and up again,
Suri would enter an infinite and keep running, while not registering new
events. This fixes that behavior by allowing Suri to retry to open the
pcap in case of a retry on an already activated capture
('PCAP_ERROR_ACTIVATED').

Bug #3846

Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/3846

Implementing change proposed by: #6274 as that PR seems to have gone stale (we don't have a CLA signed by the author)

@codecov
Copy link

codecov bot commented Jun 28, 2022

Codecov Report

Merging #7580 (c4636c9) into master (a898409) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #7580      +/-   ##
==========================================
- Coverage   75.80%   75.75%   -0.06%     
==========================================
  Files         658      658              
  Lines      186526   186525       -1     
==========================================
- Hits       141399   141293     -106     
- Misses      45127    45232     +105     
Flag Coverage Δ
fuzzcorpus 59.84% <0.00%> (-0.12%) ⬇️
suricata-verify 52.37% <0.00%> (-0.05%) ⬇️
unittests 60.72% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

ERROR:

ERROR: QA failed on ips_afp_drop_chk.

Pipeline 8015

victorjulien
victorjulien previously approved these changes Jun 29, 2022
When in live-pcap mode, if the sniffed interface went down and up again,
Suri would enter an infinite and keep running, while not registering new
events. This fixes that behavior by allowing Suri to retry to open the
pcap in case of a retry on an already activated capture
('PCAP_ERROR_ACTIVATED').

This change is based on Zhiyuan Liao's work.

Bug OISF#3846
@victorjulien
Copy link
Member

Merged in #7586, thanks!

@jufajardini jufajardini deleted the bug-3846/v1 branch June 29, 2022 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants