]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
8 years agoflow-manager: optimize hash walking 2266/head
Victor Julien [Sat, 14 May 2016 06:56:49 +0000 (08:56 +0200)] 
flow-manager: optimize hash walking

Until now the flow manager would walk the entire flow hash table on an
interval. It would thus touch all flows, leading to a lot of memory
and cache pressure. In scenario's where the number of tracked flows run
into the hundreds on thousands, and the memory used can run into many
hundreds of megabytes or even gigabytes, this would lead to serious
performance degradation.

This patch introduces a new approach. A timestamp per flow bucket
(hash row) is maintained by the flow manager. It holds the timestamp
of the earliest possible timeout of a flow in the list. The hash walk
skips rows with timestamps beyond the current time.

As the timestamp depends on the flows in the hash row's list, and on
the 'state' of each flow in the list, any addition of a flow or
changing of a flow's state invalidates the timestamp. The flow manager
then has to walk the list again to set a new timestamp.

A utility function FlowUpdateState is introduced to change Flow states,
taking care of the bucket timestamp invalidation while at it.

Empty flow buckets use a special value so that we don't have to take
the flow bucket lock to find out the bucket is empty.

This patch also adds more performance counters:

flow_mgr.flows_checked         | Total    | 929
flow_mgr.flows_notimeout       | Total    | 391
flow_mgr.flows_timeout         | Total    | 538
flow_mgr.flows_removed         | Total    | 277
flow_mgr.flows_timeout_inuse   | Total    | 261
flow_mgr.rows_checked          | Total    | 1000000
flow_mgr.rows_skipped          | Total    | 998835
flow_mgr.rows_empty            | Total    | 290
flow_mgr.rows_maxlen           | Total    | 2

flow_mgr.flows_checked: number of flows checked for timeout in the
                        last pass
flow_mgr.flows_notimeout: number of flows out of flow_mgr.flows_checked
                        that didn't time out
flow_mgr.flows_timeout: number of out of flow_mgr.flows_checked that
                        did reach the time out
flow_mgr.flows_removed: number of flows out of flow_mgr.flows_timeout
                        that were really removed
flow_mgr.flows_timeout_inuse: number of flows out of flow_mgr.flows_timeout
                        that were still in use or needed work

flow_mgr.rows_checked: hash table rows checked
flow_mgr.rows_skipped: hash table rows skipped because non of the flows
                        would time out anyway

The counters below are only relating to rows that were not skipped.

flow_mgr.rows_empty:   empty hash rows
flow_mgr.rows_maxlen:  max number of flows per hash row. Best to keep low,
                        so increase hash-size if needed.
flow_mgr.rows_busy:    row skipped because it was locked by another thread

8 years agoflow: simplify timeout logic
Victor Julien [Fri, 13 May 2016 21:04:30 +0000 (23:04 +0200)] 
flow: simplify timeout logic

Instead of a single big FlowProto array containing timeouts separately
for normal and emergency cases, plus the 'Free' pointer for the
protoctx, split up these arrays.

An array made of FlowProtoTimeout for just the normal timeouts and an
mirror of that for emergency timeouts are used through a pointer that
will be set at init and by swapped by the emergency logic. It's swapped
back when the emergency is over.

The free funcs are moved to their own array.

This simplifies the timeout lookup code and shrinks the data that is
commonly used.

8 years agoflow: remove dead code
Victor Julien [Fri, 13 May 2016 20:13:59 +0000 (22:13 +0200)] 
flow: remove dead code

8 years agooffloading: make disabling offloading configurable
Victor Julien [Thu, 22 Sep 2016 10:38:54 +0000 (12:38 +0200)] 
offloading: make disabling offloading configurable

Add a generic 'capture' section to the YAML:

  # general settings affecting packet capture
  capture:
    # disable NIC offloading. It's restored when Suricata exists.
    # Enabled by default
    #disable-offloading: false
    #
    # disable checksum validation. Same as setting '-k none' on the
    # commandline
    #checksum-validation: none

8 years agooffloading: reduce verbosity to 'perf'
Victor Julien [Tue, 21 Jun 2016 08:05:40 +0000 (10:05 +0200)] 
offloading: reduce verbosity to 'perf'

8 years agooffloading: implement restoring settings for BSD
Victor Julien [Tue, 21 Jun 2016 05:59:51 +0000 (07:59 +0200)] 
offloading: implement restoring settings for BSD

8 years agooffloading: restore settings on exit
Victor Julien [Tue, 21 Jun 2016 07:35:33 +0000 (09:35 +0200)] 
offloading: restore settings on exit

8 years agoaf-packet: optionally disable offloading
Victor Julien [Mon, 20 Jun 2016 21:02:02 +0000 (23:02 +0200)] 
af-packet: optionally disable offloading

8 years agooffloading: Linux ethtool offloading support
Victor Julien [Mon, 20 Jun 2016 21:00:38 +0000 (23:00 +0200)] 
offloading: Linux ethtool offloading support

8 years agopcap: optionally disable offloading
Victor Julien [Mon, 20 Jun 2016 18:18:43 +0000 (20:18 +0200)] 
pcap: optionally disable offloading

8 years agonetmap: optionally disable offloading
Victor Julien [Mon, 20 Jun 2016 18:17:30 +0000 (20:17 +0200)] 
netmap: optionally disable offloading

8 years agodevice: add global flag for disabling offloading
Victor Julien [Mon, 20 Jun 2016 18:15:37 +0000 (20:15 +0200)] 
device: add global flag for disabling offloading

Add global flag to disable offloading or just warn on it.

8 years agooffloading: preparation for disabling offload on BSD
Victor Julien [Mon, 20 Jun 2016 18:11:55 +0000 (20:11 +0200)] 
offloading: preparation for disabling offload on BSD

Add functions for setting IFCAP flags.

8 years agodetect-ssl-state: use new unit test macros
Jason Ish [Wed, 21 Sep 2016 20:19:55 +0000 (14:19 -0600)] 
detect-ssl-state: use new unit test macros

8 years agossl: issue 1231 - support ssl state negation
Jason Ish [Tue, 30 Sep 2014 22:20:56 +0000 (16:20 -0600)] 
ssl: issue 1231 - support ssl state negation

Snort compatible SSL state negation. Adds "," as a state
separator, but keeps "|" for compatibility with existing
Suricata rules.

8 years agossl: store current state separately from cumulative state
Jason Ish [Thu, 2 Oct 2014 05:27:39 +0000 (23:27 -0600)] 
ssl: store current state separately from cumulative state

The ssl_state keyword needs the current state, not the cumulative state
in order be compatible with Snort's implementation.

8 years agodetect-pcre: use new unit test macros
Jason Ish [Wed, 21 Sep 2016 15:43:42 +0000 (09:43 -0600)] 
detect-pcre: use new unit test macros

8 years agopcre: fix missing quote in pcre unit test
Jason Ish [Mon, 19 Sep 2016 16:45:05 +0000 (10:45 -0600)] 
pcre: fix missing quote in pcre unit test

8 years agofile-hashing: restore 'force-md5'
Victor Julien [Thu, 22 Sep 2016 08:45:29 +0000 (10:45 +0200)] 
file-hashing: restore 'force-md5'

We don't want to break existing setups.

Do issue a warning that a new option is available.

8 years agofile: introduce common flags handling function
Victor Julien [Thu, 22 Sep 2016 08:26:56 +0000 (10:26 +0200)] 
file: introduce common flags handling function

8 years agocommon: introduce BIT_U16
Victor Julien [Thu, 22 Sep 2016 08:26:12 +0000 (10:26 +0200)] 
common: introduce BIT_U16

8 years agofile-hashing: added configuration options and common parsing code
Duarte Silva [Tue, 24 May 2016 17:58:13 +0000 (19:58 +0200)] 
file-hashing: added configuration options and common parsing code

8 years agofile-hashing: added support for SHA-256 file hashing
Duarte Silva [Fri, 29 Apr 2016 20:23:55 +0000 (22:23 +0200)] 
file-hashing: added support for SHA-256 file hashing

8 years agofile-hashing: added support for SHA-1 file hashing
Duarte Silva [Fri, 29 Apr 2016 19:51:12 +0000 (21:51 +0200)] 
file-hashing: added support for SHA-1 file hashing

8 years agofile-hashing: common code added
Duarte Silva [Fri, 29 Apr 2016 19:23:12 +0000 (21:23 +0200)] 
file-hashing: common code added

Moved and adapted code from detect-filemd5 to util-detect-file-hash,
generalised code to work with SHA-1 and SHA-256 and added necessary
flags and other constants.

8 years agotls: add unit tests for tls_cert_issuer
Mats Klepsland [Mon, 8 Aug 2016 08:04:17 +0000 (10:04 +0200)] 
tls: add unit tests for tls_cert_issuer

8 years agotls: add unit tests for tls_cert_subject
Mats Klepsland [Mon, 8 Aug 2016 07:52:51 +0000 (09:52 +0200)] 
tls: add unit tests for tls_cert_subject

8 years agotls: add (mpm) keyword tls_cert_subject
Mats Klepsland [Thu, 21 Jul 2016 08:28:33 +0000 (10:28 +0200)] 
tls: add (mpm) keyword tls_cert_subject

This keyword is a replacement for tls.subject.

8 years agotls: add (mpm) keyword tls_cert_issuer
Mats Klepsland [Thu, 21 Jul 2016 07:24:40 +0000 (09:24 +0200)] 
tls: add (mpm) keyword tls_cert_issuer

This keyword is a replacement for tls.issuerdn.

8 years agoiponly: fix unittests 2250/head
Victor Julien [Fri, 10 Jun 2016 13:49:21 +0000 (15:49 +0200)] 
iponly: fix unittests

8 years agodetect: optimize rule address parsing
Victor Julien [Fri, 10 Jun 2016 10:32:25 +0000 (12:32 +0200)] 
detect: optimize rule address parsing

Many rules have the same address vars, so instead of parsing them
each time use a hash to store the string and the parsed result.

Rules now reference the stored result in the hash table.

8 years agoutil-decode-mime: remove quote from boundary= string.
Tom DeCanio [Fri, 16 Sep 2016 12:24:50 +0000 (05:24 -0700)] 
util-decode-mime: remove quote from boundary= string.

remove quote from the end of the boundary= string.  This was throwing off
the mime parser so that it wouldn't always catch mime boundaries causing
things like missed attachments.

8 years agounix-socket: add auto mode
Eric Leblond [Tue, 31 May 2016 13:02:12 +0000 (15:02 +0200)] 
unix-socket: add auto mode

When running in live mode, the new default 'auto' value of
unix-command.enabled causes unix-command to be activated. This
will allow users of live capture to benefit from the feature and
result in no side effect for user running in offline capture.

8 years agoutil-time: new function to know if live or offline
Eric Leblond [Tue, 31 May 2016 12:47:58 +0000 (14:47 +0200)] 
util-time: new function to know if live or offline

8 years agoconfigure: set correct cppflags for enabled nfqueue
Andreas Herz [Sun, 12 Jun 2016 18:55:16 +0000 (20:55 +0200)] 
configure: set correct cppflags for enabled nfqueue

This change sets the correct CPPFLAGS received by PKG_CHECK to resolve
building issues with some systems like OpenSuse.

8 years agorule-reload: remember pending USR2 signals
Andreas Herz [Sat, 23 Jul 2016 19:59:12 +0000 (21:59 +0200)] 
rule-reload: remember pending USR2 signals

We did ignore additional USR2 signals while a rule-reload was running.
This changes the counter to be incremented with every additional USR2
signal so we don't ignore them anymore but it's still limited to prevent
huge overload or even overflow.

8 years agodefrag: use frag_pkt_too_large instead of frag_too_large
Jason Ish [Mon, 19 Sep 2016 13:47:24 +0000 (07:47 -0600)] 
defrag: use frag_pkt_too_large instead of frag_too_large

The rules were using the wrong decoder event type, which was
only set in the unlikely event of a complete overlap, which
really had nothing to do with being too large.

Remove FRAG_TOO_LARGE as its no longer being used, an overlap
event is already set in the case where this event would be set.

8 years agodecoder-event: BUG_ON on table mismatches
Victor Julien [Mon, 12 Sep 2016 16:15:01 +0000 (18:15 +0200)] 
decoder-event: BUG_ON on table mismatches

Abort when the event enum and the name<>event table are not matching.

8 years agosetup-app-layer-logger.sh: update for logging changes 2245/head
Jason Ish [Mon, 12 Sep 2016 16:39:14 +0000 (10:39 -0600)] 
setup-app-layer-logger.sh: update for logging changes

8 years agologging: proper failure on memory allocation error
Jason Ish [Wed, 24 Aug 2016 14:39:39 +0000 (08:39 -0600)] 
logging: proper failure on memory allocation error

unwinds all previous logger allocations

8 years agoflow-vars: remove flow locks
Jason Ish [Fri, 15 Jul 2016 14:14:03 +0000 (08:14 -0600)] 
flow-vars: remove flow locks

Code is now entered under flow lock.

8 years agoflow-bits: remove flow locks
Jason Ish [Fri, 15 Jul 2016 14:13:16 +0000 (08:13 -0600)] 
flow-bits: remove flow locks

Code is now entered under flow lock.

8 years agolua: remove flow locking from the lua layer
Jason Ish [Thu, 14 Jul 2016 15:53:59 +0000 (09:53 -0600)] 
lua: remove flow locking from the lua layer

8 years agostream: remove lock from StreamTcpSegmentForEach
Jason Ish [Wed, 13 Jul 2016 23:07:45 +0000 (17:07 -0600)] 
stream: remove lock from StreamTcpSegmentForEach

This is only entered from logging functions which are already
called with a locked flow.

8 years agologging: remove the packetqueue's from the logging path
Jason Ish [Wed, 13 Jul 2016 16:48:14 +0000 (10:48 -0600)] 
logging: remove the packetqueue's from the logging path

They are not referenced by any loggers, and they probably
shouldn't be either.

8 years agologging: hook into flow worker thread
Jason Ish [Mon, 20 Jun 2016 15:52:28 +0000 (09:52 -0600)] 
logging: hook into flow worker thread

8 years agooutput-streaming: free thread store on deinit
Jason Ish [Wed, 8 Jun 2016 19:56:35 +0000 (13:56 -0600)] 
output-streaming: free thread store on deinit

8 years agologging: rename registration functions to not have tmm
Jason Ish [Tue, 7 Jun 2016 23:20:23 +0000 (17:20 -0600)] 
logging: rename registration functions to not have tmm

As the logging modules are no longer threading modules, rename
them so they don't look like they are being registered as
threading modules.

Also, move the registration to the output.c which will handle
registration of the loggers.

8 years agologging: convert pcap log to non-thread module
Jason Ish [Tue, 7 Jun 2016 20:56:17 +0000 (14:56 -0600)] 
logging: convert pcap log to non-thread module

8 years agologging: just return if no tx loggers
Jason Ish [Tue, 7 Jun 2016 20:55:18 +0000 (14:55 -0600)] 
logging: just return if no tx loggers

8 years agologging: use a single entry point for all loggers
Jason Ish [Mon, 6 Jun 2016 19:58:37 +0000 (13:58 -0600)] 
logging: use a single entry point for all loggers

Introduces a new thread module, TMM_LOGGER, which is the
root most logger.

Only handles loggers in the packet path, stats and flow
logging are not included.

The loggers are made up of a hierarchy of loggers. At the top we
have the root logger which is the main entry point to
logging. Under the root there exists parent loggers that are the
entry point for specific types of loggers such as packet logger,
transaction loggers, etc. Each parent logger may have 0 or more
loggers that actual handle the job of producing output to something
like a file.

8 years agologging: remove output priorities: not used
Jason Ish [Mon, 6 Jun 2016 20:38:56 +0000 (14:38 -0600)] 
logging: remove output priorities: not used

8 years agologging: remove dead code from output-json
Jason Ish [Fri, 3 Jun 2016 21:38:02 +0000 (15:38 -0600)] 
logging: remove dead code from output-json

The "parent" json logger was setup like a real logger, but
some of that code was never being called.

8 years agooutput.[ch]: consistent style
Jason Ish [Sun, 29 May 2016 06:11:03 +0000 (00:11 -0600)] 
output.[ch]: consistent style

- Clean up function declaration.
- Consistenly use typedefs for function points.

No functional changes.

8 years agologging: add profiling back for non-tmm loggers
Jason Ish [Sat, 28 May 2016 00:57:06 +0000 (18:57 -0600)] 
logging: add profiling back for non-tmm loggers

The loggers moved away from a TMM required a new
profiling support.

8 years agologging: convert lua output to non-thread module
Jason Ish [Tue, 31 May 2016 16:23:34 +0000 (10:23 -0600)] 
logging: convert lua output to non-thread module

8 years agologging: convert tls log to non-thread module
Jason Ish [Fri, 3 Jun 2016 16:48:10 +0000 (10:48 -0600)] 
logging: convert tls log to non-thread module

8 years agologging: convert alert debug log to non-thread module
Jason Ish [Fri, 27 May 2016 19:16:22 +0000 (13:16 -0600)] 
logging: convert alert debug log to non-thread module

8 years agologging: convert tcp data logging to non-thread module
Jason Ish [Fri, 27 May 2016 19:12:06 +0000 (13:12 -0600)] 
logging: convert tcp data logging to non-thread module

8 years agologging: convert tls store logging to non-thread module
Jason Ish [Fri, 27 May 2016 19:03:58 +0000 (13:03 -0600)] 
logging: convert tls store logging to non-thread module

8 years agologging: convert file data logging to non-thread module
Jason Ish [Fri, 27 May 2016 18:55:50 +0000 (12:55 -0600)] 
logging: convert file data logging to non-thread module

8 years agologging: convert file logging to non-thread module
Jason Ish [Fri, 27 May 2016 17:59:13 +0000 (11:59 -0600)] 
logging: convert file logging to non-thread module

8 years agologging: convert unified2 to non-thread module
Jason Ish [Fri, 27 May 2016 16:45:11 +0000 (10:45 -0600)] 
logging: convert unified2 to non-thread module

8 years agologging: convert stats loggers to non-thread module
Jason Ish [Fri, 27 May 2016 16:39:50 +0000 (10:39 -0600)] 
logging: convert stats loggers to non-thread module

8 years agologging: convert http log to non-thread module
Jason Ish [Fri, 27 May 2016 16:21:19 +0000 (10:21 -0600)] 
logging: convert http log to non-thread module

8 years agologging: convert alert syslog to non-thread module
Jason Ish [Fri, 27 May 2016 16:17:21 +0000 (10:17 -0600)] 
logging: convert alert syslog to non-thread module

8 years agologging: convert drop output to non-thread module
Jason Ish [Fri, 27 May 2016 16:10:02 +0000 (10:10 -0600)] 
logging: convert drop output to non-thread module

8 years agologging: convert json template output to non-thread module
Jason Ish [Fri, 27 May 2016 16:05:44 +0000 (10:05 -0600)] 
logging: convert json template output to non-thread module

8 years agotests: setup unit test framework earlier
Jason Ish [Fri, 27 May 2016 16:01:54 +0000 (10:01 -0600)] 
tests: setup unit test framework earlier

Allows tests to be registered early, in support of moving
outputs away from thread modules.

8 years agologging: convert json drop output to non-thread module
Jason Ish [Fri, 27 May 2016 08:05:30 +0000 (02:05 -0600)] 
logging: convert json drop output to non-thread module

8 years agologging: convert json smtp output to non-thread module
Jason Ish [Fri, 27 May 2016 08:01:52 +0000 (02:01 -0600)] 
logging: convert json smtp output to non-thread module

8 years agologging: convert json ssh output to non-thread module
Jason Ish [Fri, 27 May 2016 08:00:24 +0000 (02:00 -0600)] 
logging: convert json ssh output to non-thread module

8 years agologging: convert json netflow output to non-thread module
Jason Ish [Fri, 27 May 2016 07:54:36 +0000 (01:54 -0600)] 
logging: convert json netflow output to non-thread module

8 years agologging: convert json flow output to non-thread module
Jason Ish [Fri, 27 May 2016 07:52:01 +0000 (01:52 -0600)] 
logging: convert json flow output to non-thread module

8 years agologging: convert json alert output to non-thread module
Jason Ish [Fri, 27 May 2016 07:33:10 +0000 (01:33 -0600)] 
logging: convert json alert output to non-thread module

8 years agologging: convert json tls output to non-thread module
Jason Ish [Fri, 27 May 2016 07:18:22 +0000 (01:18 -0600)] 
logging: convert json tls output to non-thread module

8 years agologging: convert prelude output to non-thread module
Jason Ish [Fri, 27 May 2016 07:07:10 +0000 (01:07 -0600)] 
logging: convert prelude output to non-thread module

8 years agologging: convert eve http to non-thread module
Jason Ish [Fri, 27 May 2016 07:03:13 +0000 (01:03 -0600)] 
logging: convert eve http to non-thread module

8 years agologging: convert eve dns logging to non-thread module
Jason Ish [Fri, 27 May 2016 04:26:04 +0000 (22:26 -0600)] 
logging: convert eve dns logging to non-thread module

8 years agologging: convert fast log to a non-thread module
Jason Ish [Thu, 26 May 2016 16:45:55 +0000 (10:45 -0600)] 
logging: convert fast log to a non-thread module

8 years agologging: convert dns log to a non-thread module
Jason Ish [Thu, 26 May 2016 05:32:48 +0000 (23:32 -0600)] 
logging: convert dns log to a non-thread module

8 years agodetect: mark alproto in keyword reg deprecated
Victor Julien [Fri, 16 Sep 2016 16:29:18 +0000 (18:29 +0200)] 
detect: mark alproto in keyword reg deprecated

No existing code uses it, and it had been useless for some time.

8 years agogitignore: update to hide more local files
Victor Julien [Fri, 16 Sep 2016 16:27:47 +0000 (18:27 +0200)] 
gitignore: update to hide more local files

8 years agodetect: don't set alproto while registering keyword
Victor Julien [Fri, 16 Sep 2016 16:24:29 +0000 (18:24 +0200)] 
detect: don't set alproto while registering keyword

The field is not used except for some printing, and is wrong for
many keywords.

8 years agodetect file: enable HTTP inspection from validate func
Victor Julien [Fri, 16 Sep 2016 13:13:33 +0000 (15:13 +0200)] 
detect file: enable HTTP inspection from validate func

8 years agodetect file: enforce protocol in single place
Victor Julien [Fri, 16 Sep 2016 12:40:35 +0000 (14:40 +0200)] 
detect file: enforce protocol in single place

Instead of trying to enforce the app layer protocol in each file
function, enforce it in the generic validation function.

8 years agoapp-layer: add function to check if app-layer supports files
Victor Julien [Fri, 16 Sep 2016 12:39:56 +0000 (14:39 +0200)] 
app-layer: add function to check if app-layer supports files

8 years agothreads: remove EngineKill & SURICATA_KILL
Victor Julien [Thu, 14 Jul 2016 08:36:54 +0000 (10:36 +0200)] 
threads: remove EngineKill & SURICATA_KILL

EngineStop and EngineKill were effectively doing the same, so
removed the kill variant.

8 years agothreads: failed thread is a fatal error now
Victor Julien [Thu, 14 Jul 2016 07:49:21 +0000 (09:49 +0200)] 
threads: failed thread is a fatal error now

8 years agothreading: remove thread restart logic
Victor Julien [Wed, 13 Jul 2016 19:07:11 +0000 (21:07 +0200)] 
threading: remove thread restart logic

Thread restarts never worked well and the rest of the engine was
never really expecting errors to lead to thread restarts. Either
and error is recoverable in the thread, or not at all.

So this patch removes the functionality completely.

8 years agoOpen Suricata 3.2 development branch
Victor Julien [Mon, 19 Sep 2016 10:37:12 +0000 (12:37 +0200)] 
Open Suricata 3.2 development branch

8 years agomagic: fix broken tests after CentOS6 update 2242/head
Victor Julien [Mon, 19 Sep 2016 07:12:28 +0000 (09:12 +0200)] 
magic: fix broken tests after CentOS6 update

8 years agompls: add missing event type + rule
Victor Julien [Mon, 12 Sep 2016 16:10:51 +0000 (18:10 +0200)] 
mpls: add missing event type + rule

8 years agobpf: fix file parsing memory handling
Victor Julien [Thu, 8 Sep 2016 08:39:51 +0000 (10:39 +0200)] 
bpf: fix file parsing memory handling

Fix improper fread string handling. Improve error handling.

Skip trailing spaces for slightly more pretty printing.

Coverity CID 400763.

Thanks to Steve Grubb for helping address this issue.

8 years agodetect: don't print (null) in --list-keywords=all
Victor Julien [Thu, 1 Sep 2016 13:06:11 +0000 (15:06 +0200)] 
detect: don't print (null) in --list-keywords=all

8 years agodetect: fix setup for some keywords
Eric Leblond [Fri, 16 Sep 2016 11:34:09 +0000 (13:34 +0200)] 
detect: fix setup for some keywords

Fix problems found by siginit.cocci.

8 years agococcinelle: add siginit test
Eric Leblond [Fri, 16 Sep 2016 09:47:20 +0000 (11:47 +0200)] 
coccinelle: add siginit test

Add a test that check an inversion during keyword setup where
we add a sigmatch to a signature and then do error handling on it.
This was causing a double free of some elements and ultimately a
segfault.

Proposed-by: Victor Julien <victor@inliniac.net>
8 years agodetect-flowbits: more unittest macro usage
Jason Ish [Thu, 15 Sep 2016 17:19:12 +0000 (11:19 -0600)] 
detect-flowbits: more unittest macro usage

Also cleanup some tests by removing extra code after a test was
determined to fail.

8 years agohostbits: use new unittest macros
Jason Ish [Thu, 15 Sep 2016 16:40:22 +0000 (10:40 -0600)] 
hostbits: use new unittest macros

8 years agohostbits: fail parse on unexpected trailing data
Jason Ish [Tue, 13 Sep 2016 23:09:58 +0000 (17:09 -0600)] 
hostbits: fail parse on unexpected trailing data

Address issue https://redmine.openinfosecfoundation.org/issues/1889
for hostbits. This involves updating the regular expresssion
to capture any trailing data as the regex already keeps
spaces out of the name.

A unit test was converted to new macros to find out which
line it was failing at after updating regex.