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

af_packet: bug #2422. #3174

Closed
wants to merge 1 commit into from
Closed

af_packet: bug #2422. #3174

wants to merge 1 commit into from

Conversation

gozzy
Copy link
Contributor

@gozzy gozzy commented Jan 18, 2018

This commit fixes a bug 2422

Make sure these boxes are signed before submitting your Pull Request -- thank you.

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

Describe changes:

  • mmap'ed ring buffer is unmaped when a socket is closed
  • AFPCreateSocket:
    • If an interface is not up, it does not try to apply any settings to a socket. This reduces a number of error messages while an interface is down.
    • Interface is considered active if both IFF_UP and IFF_RUNNING are present.

@gozzy gozzy requested a review from a team as a code owner January 18, 2018 09:14
This commit fixes a leak of mmap'ed ring buffer that was not
unmaped when a socket was closed. In addition, the leak could
break an inline channel on certain configurations.

Also slightly changed AFPCreateSocket():
1. If an interface is not up, it does not try to apply any
   settings to a socket. This reduces a number of error messages
   while an interface is down.
2. Interface is considered active if both IFF_UP and IFF_RUNNING
   are present.
@gozzy
Copy link
Contributor Author

gozzy commented Jan 19, 2018

Anyone? :)

Copy link
Contributor

@regit regit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could have been done in two commits as there is two different functional changes.

@@ -1533,9 +1536,9 @@ static int AFPGetIfnumByDev(int fd, const char *ifname, int verbose)
strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));

if (ioctl(fd, SIOCGIFINDEX, &ifr) == -1) {
if (verbose)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid mixing fix and whitespace commit. But it is ok for this time ;)

@regit regit mentioned this pull request Jan 23, 2018
2 tasks
@victorjulien
Copy link
Member

Merged through #3184, thanks!

@gozzy gozzy deleted the afpacket_iface_check branch February 16, 2018 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants