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

Move memset() out of PACKET_INITIALIZE() to prepare for porting Tilera mPIPE #358

Closed
wants to merge 2 commits into from

Conversation

ken-tilera
Copy link
Contributor

The memset() inside PACKET_INITIALIZE() is redundant in some cases and
it is cleaner to do as part of the memory allocation. This simplifies
changes for integrating Tilera mPIPE support because the size of memory
cleared in that case is different from SIZE_OF_PACKET.

For the cases where Packets are directly allocated and then call
PACKET_INITIALIZE() without memset() first, this patch adds memset() calls.

A further change would use GetPacketFromAlloc() directly.

The memset() inside PACKET_INITIALIZE() is redundant in some cases and
it is cleaner to do as part of the memory allocation. This simplifies
changes for integrating Tilera mPIPE support because the size of memory
cleared in that case is different from SIZE_OF_PACKET.

For the cases where Packets are directly allocated and then call
PACKET_INITIALIZE() without memset() first, this patch adds memset() calls.

A further change would use GetPacketFromAlloc() directly.
The PKT_ALLOC flag was being cleared by PACKET_RECYCLE(), which could
then result in a packet being pushed back to the Packet ring buffer
incorrectly.
@inliniac
Copy link
Contributor

Merged into master, thanks Ken. Btw, please rebase against master before submitting.

@inliniac inliniac closed this May 15, 2013
@inliniac
Copy link
Contributor

It made our buildbot unhappy: https://buildbot.suricata-ids.org/builders/build%20deb6/builds/117/steps/shell_4/logs/stdio

One of our coccinelle checks fails:

Packet zeroed at /var/cache/buildbot/slave/build_deb6/build/src/decode.c:92 but pkt field is not set afterward.
make[3]: *** [check] Error 1

Guess we'll have to update the check.

@ken-tilera
Copy link
Contributor Author

Hi Victor,

Thanks. I thought I had rebased, but clearly I had not. I’m new to git. I have more changes coming, but wanted to start with small ones.

Regards,
-Ken

From: Victor Julien [mailto:notifications@github.com]
Sent: Wednesday, May 15, 2013 6:56 AM
To: inliniac/suricata
Cc: Kenneth Steele
Subject: Re: [suricata] Move memset() out of PACKET_INITIALIZE() to prepare for porting Tilera mPIPE (#358)

Merged into master, thanks Ken. Btw, please rebase against master before submitting.


Reply to this email directly or view it on GitHubhttps://github.com//pull/358#issuecomment-17931947.

@ken-tilera
Copy link
Contributor Author

Hi Victor,

What is the policy for updating Copy Right dates on Suricata files? I have been updating to 2013 for files that I edit.

Regards,
-Ken

From: Victor Julien [mailto:notifications@github.com]
Sent: Wednesday, May 15, 2013 6:56 AM
To: inliniac/suricata
Cc: Kenneth Steele
Subject: Re: [suricata] Move memset() out of PACKET_INITIALIZE() to prepare for porting Tilera mPIPE (#358)

Merged into master, thanks Ken. Btw, please rebase against master before submitting.


Reply to this email directly or view it on GitHubhttps://github.com//pull/358#issuecomment-17931947.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants