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

unix-socket: reset to ready state on startup - v2 #6091

Closed
wants to merge 1 commit into from

Conversation

jasonish
Copy link
Member

Rebase of #5928.
Changes: None, just commit message

Tested to confirm that it also fixes new issue:
https://redmine.openinfosecfoundation.org/issues/4434

Note: This initializes all files in the default-log-directory as mentioned in ticket 4434. I think that is best solved as another issue, which is less important than what we are fixing here.

As part of commit ea15282,
some initialization was moved to happen even in unix socket mode,
however, this initialization does setup some loggers that can only have
one instance enabled (anomaly, drop, file-store).

This will cause these loggers to error out on the first pcap, but work
on subsequent runs of the pcap as some deinitialization is done after
each pcap.

This fix just runs the post pcap-file deinitialization routine to
reset some of the initialization done on startup, like is done after
running each pcap in unix socket mode.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4225

Additionally this prevents alerts from being logged two times
on the first run of a pcap through the unix socket:

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4434

As part of commit ea15282,
some initialization was moved to happen even in unix socket mode,
however, this initialization does setup some loggers that can only have
one instance enabled (anomaly, drop, file-store).

This will cause these loggers to error out on the first pcap, but work
on subsequent runs of the pcap as some deinitialization is done after
each pcap.

This fix just runs the post pcap-file deinitialization routine to
reset some of the initialization done on startup, like is done after
running each pcap in unix socket mode.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4225

Additionally this prevents alerts from being logged two times
on the first run of a pcap through the unix socket:

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4434
@codecov
Copy link

codecov bot commented Apr 27, 2021

Codecov Report

Merging #6091 (07af8fb) into master (7fb56a9) will decrease coverage by 0.02%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #6091      +/-   ##
==========================================
- Coverage   77.02%   77.00%   -0.03%     
==========================================
  Files         612      612              
  Lines      187684   187684              
==========================================
- Hits       144566   144521      -45     
- Misses      43118    43163      +45     
Flag Coverage Δ
fuzzcorpus 53.02% <50.00%> (+<0.01%) ⬆️
suricata-verify 50.21% <50.00%> (-0.06%) ⬇️
unittests 63.26% <0.00%> (-0.01%) ⬇️

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

@han-guang-xue
Copy link

Could you please tell me where to submit any bugs in your program

@han-guang-xue
Copy link

Can you tell me how to turn on non-optimized compilation for this project

@jasonish
Copy link
Member Author

Can you tell me how to turn on non-optimized compilation for this project

Please see https://suricata-ids.org/support/ for links to the bug tracker, etc.

@victorjulien victorjulien mentioned this pull request May 4, 2021
@victorjulien
Copy link
Member

Merged in #6101, thanks!

@jasonish jasonish deleted the unix-socket-init-reset/v2 branch May 4, 2021 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants