]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
5 years agostream: support debug notice message in tfo 4122/head
Victor Julien [Fri, 23 Aug 2019 13:02:52 +0000 (15:02 +0200)] 
stream: support debug notice message in tfo

5 years agodoc: install eBPF files in share directory
Eric Leblond [Mon, 15 Jul 2019 07:29:21 +0000 (09:29 +0200)] 
doc: install eBPF files in share directory

Following proposal by Sascha Steinbiss, let's use /usr/share/suricata
to store the eBPF files.

5 years agobypass: fix build on Windows
Eric Leblond [Sat, 13 Jul 2019 08:47:40 +0000 (10:47 +0200)] 
bypass: fix build on Windows

For the sake of unittests, we need to build capture bypass so we
end up with a Windows build of flow bypass.

5 years agodoc: fix English and some typos
Eric Leblond [Wed, 10 Jul 2019 14:00:23 +0000 (16:00 +0200)] 
doc: fix English and some typos

5 years agodoc: pointer to bpfctrl
Eric Leblond [Sat, 6 Jul 2019 14:30:43 +0000 (16:30 +0200)] 
doc: pointer to bpfctrl

As bpfctrl is currently the easiest way to manage pinned maps,
let's point to it. We will switch doc to suricatacl once support
has been added.

5 years agodoc: improve doc on compiling with eBPF support
Eric Leblond [Sun, 23 Jun 2019 14:58:09 +0000 (16:58 +0200)] 
doc: improve doc on compiling with eBPF support

5 years agodoc: improve XDP cpu redirect documentation
Eric Leblond [Sat, 22 Jun 2019 06:58:36 +0000 (08:58 +0200)] 
doc: improve XDP cpu redirect documentation

5 years agoebpf: add tunnel aware load balancing
Eric Leblond [Sun, 23 Jun 2019 13:07:51 +0000 (15:07 +0200)] 
ebpf: add tunnel aware load balancing

This patch decapsulates GRE tunnel in xdp_lb

5 years agoebpf: add XDP load balancing code
Eric Leblond [Sat, 22 Jun 2019 06:32:15 +0000 (08:32 +0200)] 
ebpf: add XDP load balancing code

This patch uses CPU redirect map to do load balancing. This is a
simplified version of xdp_filter that includes code for bypass.

5 years agodoc: only balance by ip pair
Eric Leblond [Fri, 21 Jun 2019 21:01:33 +0000 (23:01 +0200)] 
doc: only balance by ip pair

As there is some issue with defrag, let's recommend to only do
IP pair load-balacing for RSS

5 years agodoc: document filter.bpf changes
Eric Leblond [Fri, 21 Jun 2019 18:22:47 +0000 (20:22 +0200)] 
doc: document filter.bpf changes

Also adds some info to explain maps.

5 years agobypass: introduce CAPTURE_OFFLOAD
Eric Leblond [Thu, 20 Jun 2019 11:08:44 +0000 (13:08 +0200)] 
bypass: introduce CAPTURE_OFFLOAD

This define is used to remove reference to capture bypass in case
no capture method implementing this is active.

This patch also introduces CAPTURE_OFFLOAD_MANAGER that is defined
if we need the flow bypass manager code.

5 years agoflow-hash: generalize function
Eric Leblond [Thu, 20 Jun 2019 11:02:51 +0000 (13:02 +0200)] 
flow-hash: generalize function

THis patch generalizes the function to get a flow by its flowkey
by removing the call setting it to capture bypassed state.

5 years agoebpf: improve parsing in filter.bpf
Eric Leblond [Wed, 19 Jun 2019 07:57:38 +0000 (09:57 +0200)] 
ebpf: improve parsing in filter.bpf

Parse VLAN and only filter on IPv4. This patch also change the type
of the counter to get a per CPU hash.

5 years agodetect: fix FP on ICMP unreachable errors 4115/head
Victor Julien [Thu, 22 Aug 2019 09:28:36 +0000 (11:28 +0200)] 
detect: fix FP on ICMP unreachable errors

ICMP unreachable errors are linked to the flow they send an error for.
This would lead to the detection engine calling the TX inspection
engines on them.

The stream inspect engine would default to a match for non-UDP
and non-TCP as for ICMP we're not expected to use a TX inspect engine
for stream data.

This all would lead to a false positive match.

This patch fixes this by making sure the TX engines are not called if
the packet protocol and flow protocol are not the same.

Bug #2769.

5 years agomain: fix typo in output
Jeff Lucovsky [Thu, 15 Aug 2019 22:56:21 +0000 (18:56 -0400)] 
main: fix typo in output

5 years agostream/tcp: correct spelling typos
Jeff Lucovsky [Wed, 14 Aug 2019 23:20:21 +0000 (19:20 -0400)] 
stream/tcp: correct spelling typos

5 years agostream/tcp: support TCP fast open
Victor Julien [Sat, 1 Sep 2018 16:54:40 +0000 (18:54 +0200)] 
stream/tcp: support TCP fast open

5 years agodecode/tcp: TCP fast open option decoding
Victor Julien [Sat, 1 Sep 2018 08:22:41 +0000 (10:22 +0200)] 
decode/tcp: TCP fast open option decoding

Support both regular TFO and TFO as part of the experimental
options support.

5 years agosignature: fixes leak with duplicate signatures 4113/head
Philippe Antoine [Wed, 22 May 2019 15:31:14 +0000 (17:31 +0200)] 
signature: fixes leak with duplicate signatures

5 years agoboyermoore: optimization with one alloc less
Philippe Antoine [Tue, 4 Jun 2019 09:46:01 +0000 (11:46 +0200)] 
boyermoore: optimization with one alloc less

Fixes #1220

5 years agodetectproto: adding missing probing parsers
Philippe Antoine [Thu, 1 Aug 2019 12:12:54 +0000 (14:12 +0200)] 
detectproto: adding missing probing parsers

In direction TO_CLIENT for symetric protocols

5 years agodetect-geoip: add info for list keywords
Eric Leblond [Fri, 2 Aug 2019 07:57:42 +0000 (09:57 +0200)] 
detect-geoip: add info for list keywords

5 years agodoc: fix typos in geoip doc
Eric Leblond [Fri, 2 Aug 2019 07:32:08 +0000 (09:32 +0200)] 
doc: fix typos in geoip doc

5 years agodoc: fix display of icmp code and type array
Eric Leblond [Thu, 1 Aug 2019 08:33:44 +0000 (10:33 +0200)] 
doc: fix display of icmp code and type array

5 years agodoc: use a table to list direction filter in geoip
Eric Leblond [Thu, 1 Aug 2019 07:49:17 +0000 (09:49 +0200)] 
doc: use a table to list direction filter in geoip

5 years agodoc: fix geoip syntax
Eric Leblond [Wed, 31 Jul 2019 22:02:30 +0000 (00:02 +0200)] 
doc: fix geoip syntax

Spaces are not allowed before country code.

5 years agounix/socket: Add rev date to version info
Shivani Bhardwaj [Wed, 24 Jul 2019 15:48:38 +0000 (21:18 +0530)] 
unix/socket: Add rev date to version info

5 years agoDocumenting base64_decode and base64_content
Vinjar Hillestad [Fri, 21 Jun 2019 14:09:28 +0000 (14:09 +0000)] 
Documenting base64_decode and base64_content

base64 doc changes based on #4027 pull feedback

5 years agoAdd documentation for --with-clang parameter 4112/head
Hilko Bengen [Wed, 24 Jul 2019 09:36:53 +0000 (11:36 +0200)] 
Add documentation for --with-clang parameter

5 years agoebpf: Use $(CLANG) to build eBPF programs
Hilko Bengen [Thu, 21 Feb 2019 08:34:41 +0000 (09:34 +0100)] 
ebpf: Use $(CLANG) to build eBPF programs

This change makes it possible to generate the eBPF programs even if
Suricata itself is built a different C compiler. It also simplifies
how the correct llc program is detected.

Implements Feature https://redmine.openinfosecfoundation.org/issues/2789

5 years agoconfigure: Introduce CLANG variable
Hilko Bengen [Tue, 22 Jan 2019 17:10:47 +0000 (18:10 +0100)] 
configure: Introduce CLANG variable

5 years agocleanup: eliminate warnings/errors with debug build on macos
Jeff Lucovsky [Fri, 26 Jul 2019 22:44:27 +0000 (15:44 -0700)] 
cleanup: eliminate warnings/errors with debug build on macos

5 years agouserguide: remove old reference to rule-reload option
Andreas Herz [Mon, 12 Aug 2019 20:05:40 +0000 (22:05 +0200)] 
userguide: remove old reference to rule-reload option

5 years agosrc/detect: check DetectBufferSetActiveList return code
Shivani Bhardwaj [Sat, 10 Aug 2019 18:05:04 +0000 (23:35 +0530)] 
src/detect: check DetectBufferSetActiveList return code

Make sure to always check the return codes of DetectBufferSetActiveList.
Also, force this warning on function prototype.

Closes redmine ticket #3005.

5 years agosignature: avoids overflow from VariableNameHash
Philippe Antoine [Thu, 1 Aug 2019 13:27:39 +0000 (15:27 +0200)] 
signature: avoids overflow from VariableNameHash

5 years agodetect/analyzer: remove HAVE_LIBJANSSON cpp guards 4108/head
Jeff Lucovsky [Sun, 18 Aug 2019 22:06:01 +0000 (18:06 -0400)] 
detect/analyzer: remove HAVE_LIBJANSSON cpp guards

5 years agospelling: correct spelling typo
Jeff Lucovsky [Sun, 18 Aug 2019 22:04:58 +0000 (18:04 -0400)] 
spelling: correct spelling typo

5 years agodetect/analyzer: add support for http_content_type
Jeff Lucovsky [Sun, 18 Aug 2019 22:03:01 +0000 (18:03 -0400)] 
detect/analyzer: add support for http_content_type

5 years agorust: Fix deprecation warnings
Shivani Bhardwaj [Fri, 26 Jul 2019 17:52:34 +0000 (23:22 +0530)] 
rust: Fix deprecation warnings

Fix the following warnings by compiler,
(1) warning: use of deprecated item 'take_until_s': Please use `take_until` instead
(2) warning: `...` range patterns are deprecated

For the second warning, the builtin lint
"ellipsis_inclusive_range_pattern" has been added which causes the
following warning to show up with rustc 1.24.

warning: unknown lint: `ellipsis_inclusive_range_patterns`
  --> /home/travis/build/OISF/suricata/suricata-5.0.0-dev/rust/src/lib.rs:18:10
   |
18 | #![allow(ellipsis_inclusive_range_patterns)]
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(unknown_lints)] on by default

Since there is no other way to fix this, the above warning shall stay.
We need to take care of modifying this if and when the support for 1.24
as MSRV is dropped.

5 years agoapplayer: fix typo in debug output
jason taylor [Fri, 16 Aug 2019 17:54:41 +0000 (13:54 -0400)] 
applayer: fix typo in debug output

Signed-off-by: jason taylor <jtfas90@gmail.com>
5 years agorule-reload: enable rule-reload for -s and -S run as well 4099/head
Andreas Herz [Mon, 12 Aug 2019 20:19:14 +0000 (22:19 +0200)] 
rule-reload: enable rule-reload for -s and -S run as well

6 years agopcap: fix breakloop error handling 4067/head
Victor Julien [Wed, 5 Jun 2019 20:06:08 +0000 (22:06 +0200)] 
pcap: fix breakloop error handling

Ticket #3004

6 years agonetmap: suppress format truncation warning 4062/head
Victor Julien [Fri, 19 Jul 2019 20:16:33 +0000 (22:16 +0200)] 
netmap: suppress format truncation warning

  CC       source-netmap.o
source-netmap.c: In function ‘NetmapOpen’:
source-netmap.c:327:56: error: ‘%s’ directive output may be truncated writing up to 15 bytes into a region of size between 10 and 57 [-Werror=format-truncation=]
         snprintf(devname, sizeof(devname), "netmap:%s%s%s",
                                                        ^~
                 ns->iface, strlen(optstr) ? "/" : "", optstr);
                                                       ~~~~~~
source-netmap.c:327:9: note: ‘snprintf’ output 8 or more bytes (assuming 70) into a destination of size 64
         snprintf(devname, sizeof(devname), "netmap:%s%s%s",
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 ns->iface, strlen(optstr) ? "/" : "", optstr);
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source-netmap.c:330:59: error: ‘%s’ directive output may be truncated writing up to 15 bytes into a region of size between 8 and 55 [-Werror=format-truncation=]
         snprintf(devname, sizeof(devname), "netmap:%s-%d%s%s",
                                                           ^~
                 ns->iface, ring, strlen(optstr) ? "/" : "", optstr);
                                                             ~~~~~~
source-netmap.c:330:9: note: ‘snprintf’ output 10 or more bytes (assuming 72) into a destination of size 64
         snprintf(devname, sizeof(devname), "netmap:%s-%d%s%s",
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 ns->iface, ring, strlen(optstr) ? "/" : "", optstr);
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source-netmap.c:316:54: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
         snprintf(devname, sizeof(devname), "%s}%d%s%s",
                                                      ^
source-netmap.c:316:9: note: ‘snprintf’ output 3 or more bytes (assuming 65) into a destination of size 64
         snprintf(devname, sizeof(devname), "%s}%d%s%s",
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 ns->iface, ring, strlen(optstr) ? "/" : "", optstr);
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Gcc 8 with -Wformat-truncation=1

6 years agodetect/mpm: put transform into 'profile name'
Victor Julien [Fri, 19 Jul 2019 14:05:30 +0000 (16:05 +0200)] 
detect/mpm: put transform into 'profile name'

So that profiling gives more info about cost of the mpm
engines when they use transforms.

6 years agodetect/dns: register correct profile name
Victor Julien [Fri, 19 Jul 2019 14:10:05 +0000 (16:10 +0200)] 
detect/dns: register correct profile name

6 years agostring: making shortening function global
Victor Julien [Fri, 19 Jul 2019 13:07:46 +0000 (15:07 +0200)] 
string: making shortening function global

6 years agodevice: break string shortening out of device shortening
Victor Julien [Fri, 19 Jul 2019 13:03:09 +0000 (15:03 +0200)] 
device: break string shortening out of device shortening

6 years agodevice: remove duplicate length check
Victor Julien [Fri, 19 Jul 2019 13:02:10 +0000 (15:02 +0200)] 
device: remove duplicate length check

Shorten code handles all cases correctly.

6 years agodetect: move includes/declarations closer to use
Victor Julien [Fri, 19 Jul 2019 11:48:33 +0000 (13:48 +0200)] 
detect: move includes/declarations closer to use

6 years agodetect: fix inaccurate comments
Victor Julien [Fri, 19 Jul 2019 11:48:15 +0000 (13:48 +0200)] 
detect: fix inaccurate comments

6 years agopfring: Fix kernel version in comment
Max Fillinger [Thu, 18 Jul 2019 11:03:32 +0000 (13:03 +0200)] 
pfring: Fix kernel version in comment

6 years agoaf-packet: fix build on recent Linux kernels
Eric Leblond [Wed, 17 Jul 2019 10:35:12 +0000 (12:35 +0200)] 
af-packet: fix build on recent Linux kernels

6 years agorust: fix compiler warning
Shivani Bhardwaj [Tue, 16 Jul 2019 08:39:13 +0000 (14:09 +0530)] 
rust: fix compiler warning

rustc 1.36 introduced:

error: variable does not need to be mutable
   --> src/dhcp/parser.rs:202:17
    |
202 |             let mut malformed_options = false;
    |                 ----^^^^^^^^^^^^^^^^^
    |                 |
    |                 help: remove this `mut`
    |
note: lint level defined here
   --> src/lib.rs:18:38
    |
18  | #![cfg_attr(feature = "strict", deny(warnings))]
    |                                      ^^^^^^^^
    = note: #[deny(unused_mut)] implied by #[deny(warnings)]

error: aborting due to previous error

error: Could not compile `suricata`.

Ticket #3072.

6 years agossl: register probing for port 443 if no config
Philippe Antoine [Wed, 10 Jul 2019 19:02:09 +0000 (21:02 +0200)] 
ssl: register probing for port 443 if no config

6 years agoconfigure: Add date with rev information
Shivani Bhardwaj [Wed, 17 Jul 2019 13:34:36 +0000 (19:04 +0530)] 
configure: Add date with rev information

Date makes it even clearer that when was the last commit for the build
that one is running. Add this info alongwith rev. Change inspired by
rustc.

Before
```
$ suricata -V
This is Suricata version 5.0.0-dev (rev 2d217e666)
```

After
```
This is Suricata version 5.0.0-dev (2d217e666 2019-07-12)
```

Closes redmine ticket #3092

6 years agooutput/json: Refactor output buffer size macro
Jeff Lucovsky [Sat, 6 Jul 2019 13:42:10 +0000 (09:42 -0400)] 
output/json: Refactor output buffer size macro

6 years agoeve/json: Break multiline FTP responses into array
Jeff Lucovsky [Tue, 18 Jun 2019 23:06:59 +0000 (19:06 -0400)] 
eve/json: Break multiline FTP responses into array

This changeset breaks multi-line FTP responses into separate array
entries. Multi-line responses are those with "text-1\r\ntext-2[...]".
Each of \r\n delimited text segments is reported in the `reply` array;
each text segment _may_ include a completion code; completion codes are
reported in the `completion_code` array.

6 years agoeve/ftp: Refactor and reduce logging functions
Jeff Lucovsky [Sat, 15 Jun 2019 14:05:20 +0000 (10:05 -0400)] 
eve/ftp: Refactor and reduce logging functions

6 years agoftp: Generalize prelim positive reply
Jeff Lucovsky [Sat, 15 Jun 2019 14:03:23 +0000 (10:03 -0400)] 
ftp: Generalize prelim positive reply

Extend special case for reply code 150 to handle all preliminary
positive reply -- reply codes with `1xy`.

6 years agoftp: reply code 150 doesn't end tx
Victor Julien [Tue, 11 Jun 2019 11:33:49 +0000 (13:33 +0200)] 
ftp: reply code 150 doesn't end tx

6 years agoftp: fix reply without request
Victor Julien [Tue, 11 Jun 2019 10:57:19 +0000 (12:57 +0200)] 
ftp: fix reply without request

Permit picking up any reply w/o a request. Observed unsolicited server
messages before connection termination.

Previously the code assumed that this could only happen on connection
start when there was no previously recorded command.

6 years agoftp: implement progress tracking
Victor Julien [Tue, 11 Jun 2019 10:09:38 +0000 (12:09 +0200)] 
ftp: implement progress tracking

Make sure FTP_STATE_FINISHED is returned for transactions that
are marked 'done'.

This is necessary for timely logging and inspection.

6 years agoftp: be more strict with tx type
Victor Julien [Tue, 11 Jun 2019 10:08:50 +0000 (12:08 +0200)] 
ftp: be more strict with tx type

6 years agoeve/ftp: minor cleanups and fixes
Jeff Lucovsky [Sat, 8 Jun 2019 16:29:08 +0000 (12:29 -0400)] 
eve/ftp: minor cleanups and fixes

6 years agoeve/ftp: Bug fix and banner capture
Zach Kelly [Thu, 23 May 2019 19:07:28 +0000 (15:07 -0400)] 
eve/ftp: Bug fix and banner capture

1. Correct off-by-one error in server response whitespace removal
2. Include banner response (before first command entered)

6 years agoeve/ftp: Log initial responses
Jeff Lucovsky [Sat, 25 May 2019 14:08:31 +0000 (07:08 -0700)] 
eve/ftp: Log initial responses

This changeset ensures that unknown commands are logged.
Unknown commands are either
- Banner responses when connecting to the FTP port
- Commands not includes in the FtpCommands descriptor table

6 years agouserguide: formatting: remove tabs
Jeff Lucovsky [Sat, 25 May 2019 12:52:40 +0000 (05:52 -0700)] 
userguide: formatting: remove tabs

6 years agouserguide: ftp formatting updates
Jeff Lucovsky [Sat, 25 May 2019 12:51:56 +0000 (05:51 -0700)] 
userguide: ftp formatting updates

6 years agoeve/ftp: Transaction support for unmatched requests
Jeff Lucovsky [Tue, 7 May 2019 22:49:57 +0000 (15:49 -0700)] 
eve/ftp: Transaction support for unmatched requests

Modified transaction logic to create a new transaction with each
request; replies location transactions by using the oldest "open"
(unmatched) transaction or the last transaction if none are open.

6 years agosuricata.yaml: Add ftp logging option to eve-log
Jeff Lucovsky [Tue, 30 Apr 2019 23:41:05 +0000 (16:41 -0700)] 
suricata.yaml: Add ftp logging option to eve-log

6 years agoeve/ftp: Log FTP transactions
Jeff Lucovsky [Mon, 1 Apr 2019 22:14:28 +0000 (15:14 -0700)] 
eve/ftp: Log FTP transactions

This changeset includes changes that
1. Add transaction support to the FTP parser
2. Support eve json logging of FTP transactions

6 years agohttp: fixes overflow in range parsing 4028/head
Philippe Antoine [Fri, 5 Jul 2019 06:34:06 +0000 (08:34 +0200)] 
http: fixes overflow in range parsing

6 years agostream: fix midstream reverse flow handling
Victor Julien [Tue, 2 Jul 2019 13:53:56 +0000 (15:53 +0200)] 
stream: fix midstream reverse flow handling

When a TCP session is picked up from the response the flow is
reversed by the protocol detection code.

This would lead to duplicate logging of the response. The reason this
happened was that the per stream app progress tracker was not handled
correctly by the direction reversing code. While the streams were
swapped the stream engine would continue to use a now outdated pointer
to what had become the wrong direction.

This patches fixes this by making the stream a ptr to ptr that can be
updated by the protocol detection as well.

In addition, the progress tracking was cleaned up and the GAP error
handling in this case was improved as well.

6 years agoebpf: remove left over debug in lb.c
Eric Leblond [Sat, 22 Jun 2019 06:09:54 +0000 (08:09 +0200)] 
ebpf: remove left over debug in lb.c

6 years agoftp: removes one use of atoi
Philippe Antoine [Wed, 3 Jul 2019 05:20:25 +0000 (07:20 +0200)] 
ftp: removes one use of atoi

Fixes only one small part of #3053

6 years agopcap: code reformatting and minor cleanups
Victor Julien [Thu, 11 Jul 2019 07:55:41 +0000 (09:55 +0200)] 
pcap: code reformatting and minor cleanups

6 years agoflow: minor formatting updates
Victor Julien [Thu, 11 Jul 2019 07:37:10 +0000 (09:37 +0200)] 
flow: minor formatting updates

6 years agoaf-packet: Always fill in vlan_id 4016/head
Max Fillinger [Mon, 8 Jul 2019 16:21:42 +0000 (18:21 +0200)] 
af-packet: Always fill in vlan_id

The vlan tag will be filled in either from the extended header (for
kernel version >= 3.0) or from the packet itself.

Related to https://redmine.openinfosecfoundation.org/issues/3076

6 years agopfring: Always fill in vlan_id
Max Fillinger [Mon, 8 Jul 2019 16:00:55 +0000 (18:00 +0200)] 
pfring: Always fill in vlan_id

Previously, source-pfring.c would copy the vlan_id from the extended
header only if vlan.use-for-tracking was enabled. This commit removes
that check.

Related to https://redmine.openinfosecfoundation.org/issues/3076

6 years agodecode erspan: Always fill in vlan_id
Max Fillinger [Mon, 8 Jul 2019 14:51:46 +0000 (16:51 +0200)] 
decode erspan: Always fill in vlan_id

Fill in the vlan_id fields unconditionally. We can now remove the check
for the vlan.use-for-tracking setting in decode.c. The debug log message
is moved to suricata.c.

6 years agodecode vlan: Always fill in vlan_id
Max Fillinger [Mon, 8 Jul 2019 14:01:23 +0000 (16:01 +0200)] 
decode vlan: Always fill in vlan_id

Since the vlan.use-for-tracking setting is now handled in flow-hash.c,
we can fill in the vlan_id fields unconditionally. This makes the vlanh
fields unnecessary.

Related to https://redmine.openinfosecfoundation.org/issues/3076

6 years agoflow hash: Mask vlan_id if not used for tracking
Max Fillinger [Mon, 8 Jul 2019 10:51:41 +0000 (12:51 +0200)] 
flow hash: Mask vlan_id if not used for tracking

If vlan.use-for-tracking is disabled, set the vlan_id fields to 0 when
hashing or comparing flows. This is done using a bitmask as suggested by
Victor Julien in IRC, in order to avoid adding more branches to this
code.

Currently, suricata does not fill in vlan_id fields if
vlan.use-for-tracking is disabled and instead leaves them at the default
0 value, so this commit makes no functional change. This change is in
preparation for future commits where the vlan_ids will be always filled
in.

Related to https://redmine.openinfosecfoundation.org/issues/3076

6 years agoflow hash: Make CMP_FLOW macro an inline function
Max Fillinger [Fri, 5 Jul 2019 14:59:36 +0000 (16:59 +0200)] 
flow hash: Make CMP_FLOW macro an inline function

6 years agorunmodes: remove unused prototypes 4015/head
Victor Julien [Tue, 9 Jul 2019 12:02:20 +0000 (14:02 +0200)] 
runmodes: remove unused prototypes

6 years agoafl: fix afl-ftp causing FPE due to missing ippair
Victor Julien [Tue, 9 Jul 2019 11:48:16 +0000 (13:48 +0200)] 
afl: fix afl-ftp causing FPE due to missing ippair

6 years agorunmodes: remove no-Rust logic
Victor Julien [Tue, 9 Jul 2019 11:46:23 +0000 (13:46 +0200)] 
runmodes: remove no-Rust logic

6 years agorunmodes: simply default runmode logic
Victor Julien [Tue, 9 Jul 2019 11:20:44 +0000 (13:20 +0200)] 
runmodes: simply default runmode logic

6 years agorunmodes: code cleanups
Victor Julien [Tue, 9 Jul 2019 11:07:22 +0000 (13:07 +0200)] 
runmodes: code cleanups

6 years agoleak: Fixes leak in AppLayerProtoDetectPMRegisterPattern 4001/head
Philippe Antoine [Wed, 3 Jul 2019 09:34:26 +0000 (11:34 +0200)] 
leak: Fixes leak in AppLayerProtoDetectPMRegisterPattern

Fixes #3070

6 years agoleak: Fixes leak in DetectAppLayerEventPrepare
Philippe Antoine [Wed, 3 Jul 2019 14:39:19 +0000 (16:39 +0200)] 
leak: Fixes leak in DetectAppLayerEventPrepare

6 years agolog: use SCLogError instead of fprintf
Philippe Antoine [Wed, 3 Jul 2019 13:33:15 +0000 (15:33 +0200)] 
log: use SCLogError instead of fprintf

6 years agoleak: fixes leak in DetectAddressParse2 3994/head
Philippe Antoine [Wed, 3 Jul 2019 13:26:08 +0000 (15:26 +0200)] 
leak: fixes leak in DetectAddressParse2

6 years agogeoip: fix unittests w/o db present
Victor Julien [Fri, 21 Jun 2019 19:40:20 +0000 (21:40 +0200)] 
geoip: fix unittests w/o db present

6 years agomem: avoid potential shadow vars with 'len' name
Victor Julien [Fri, 21 Jun 2019 13:50:36 +0000 (15:50 +0200)] 
mem: avoid potential shadow vars with 'len' name

6 years agomem: add SCStrndup() function to wrap strndup().
Bill Meeks [Fri, 21 Jun 2019 13:27:48 +0000 (09:27 -0400)] 
mem: add SCStrndup() function to wrap strndup().

6 years agodetect/geoip: migrate to GeoIP2 database format
Bill Meeks [Fri, 21 Jun 2019 13:26:01 +0000 (09:26 -0400)] 
detect/geoip: migrate to GeoIP2 database format

Issue #2765

6 years agodetect/mpm: improve stats reporting
Victor Julien [Sun, 30 Jun 2019 18:55:18 +0000 (20:55 +0200)] 
detect/mpm: improve stats reporting

6 years agodetect: add ipv6.hdr sticky buffer
Victor Julien [Sun, 30 Jun 2019 09:07:39 +0000 (11:07 +0200)] 
detect: add ipv6.hdr sticky buffer

Inspects IPv6 header and extension headers.

6 years agodecode/ipv6: track length of ext hdrs
Victor Julien [Sun, 30 Jun 2019 09:07:05 +0000 (11:07 +0200)] 
decode/ipv6: track length of ext hdrs