Commit graph

21 commits

Author SHA1 Message Date
Tim Wojtulewicz
96d9115360 GH-1079: Use full paths starting with zeek/ when including files 2020-11-12 12:15:26 -07:00
Tim Wojtulewicz
2964093e5d Reorder some class variables to fill in gaps in structure packing
The big hitters:
Dict: Fills in four 4-byte holes in the structure. This shrinks Dictionary from 136 bytes to 114 bytes.
Desc: Fills in a 6-byte hole in the structure. This shrinks ODesc from 152 bytes to 144 bytes.
Frame: Moves and combines 4 bool variables from a few places into one single 4-byte block. This resolves all of the holes at once. This shrinks Frame from 216 bytes to 192 bytes and removes one cache line.
Func: Moves one int32_t variable to fill in a 4-byte hole. This shrinks Func from 112 bytes to 104 bytes.
ID: Moves two bool variables to fill in a 3-byte hole. This leaves behind a 1-byte hole, but removes a 6-byte pad from the end of the structure. This shrinks ID from 144 bytes to 136 bytes.

Other changes:
RuleHdrTest: Fills in one 4-byte hole in the structure. This shrinks RuleHdrTest from 248 bytes to 240 bytes.
RuleEndpointState: Moves one bool variable down in the structure to reduce a 7-byte hole. This unfortunately causes a 3-byte hole later in the structure but there’s no easy way to filll it in. This does shrink RuleEndpointState from 128 bytes to 120 bytes though.
ScannedFile: Moves two bool values to reduce a 4-byte hole by 2 bytes. This shrinks ScannedFile from 64 bytes to 56 bytes.
Brofiler: Moves one char value to reduce a 4-byte hole by 1 byte. This shrinks Brofiler from 96 bytes to 88 bytes and removes one cache line.
DbgBreakpoint: Moves some values around to fill in a 4-byte hole and reduce a second. A 2-byte hole still exists, but the structure shrinks from 632 bytes to 624 bytes. It’s possible on this one that one of the int32_t values could be an int16_t and remove the last 2-byte gap.
ParseLocationRec: Moves one int to fill in a 4-byte hole. This shrinks ParseLocationRec from 32 bytes to 24 bytes.
DebugCmdInfo: Moves one bool variable to shift a few others up. This results in a 6-byte pad at the end of the structure but removes a 7-byte hole in the middle. This shrinks DebugCmdInfo from 56 bytes to 48 bytes.
FragReassembler: Moves one variable down to fill in a 4-byte hole. This shrinks FragReassembler from 272 bytes to 264 bytes.
nb_dns_result: Moves ones uint32_t variable to fill in a 4-byte hole, also removing a 4-byte pad from the end of the structure. This shrinks nb_dns_result from 32 bytes to 24 bytes.
nb_dns_entry: Moves one short value to fill in a 2-byte hole, also removing a 6-byte hole. This shrinks nb_dns_entry from 1064 bytes to 1056 bytes.
2020-04-06 14:07:29 -07:00
Max Kellermann
32bb019e3a util, nb_dns: fix off-by-one bugs in strncpy() calls
Fortunately, these bugs had no effect because the following lines
overwrote the last character with a null byte.
2020-01-29 20:22:16 +01:00
Robin Sommer
789cb376fd GH-239: Rename bro to zeek, bro-config to zeek-config, and bro-path-dev to zeek-path-dev.
This also installs symlinks from "zeek" and "bro-config" to a wrapper
script that prints a deprecation warning.

The btests pass, but this is still WIP. broctl renaming is still
missing.

#239
2019-05-01 21:43:45 +00:00
Jon Siwek
206f12467a Improve default DNS resolution support for Alpine/musl
On Alpine (musl libc), /etc/resolv.conf now gets parsed for the first
IPv4 nameserver that works.

Addresses GH-216
2018-11-30 19:26:04 -06:00
Jon Siwek
af82e87699 Add dns_resolver option
This allows one to configure the address of the DNS server to use for
lookup operations.

Addresses GH-216
2018-11-30 16:59:45 -06:00
Jon Siwek
445e5bfc18 Fix (unlikely) memory leak in nb_dns.c 2018-02-05 10:45:02 -06:00
Jon Siwek
deced3795c Fix a nb_dns.c compile error (older OSs) due to C90 vs C99. 2017-11-21 11:35:33 -06:00
Jon Siwek
26dc94c31d BIT-1827: fix error on initializing DNS w/ IPv6 nameserver.
This just skips over IPv6 nameserver addresses for now and uses the
first IPv4 one in the resolver config.  Should be possible to support
IPv6, but that may need more testing (e.g. need to make sure the code
will be portable to various platforms).
2017-11-20 11:36:04 -06:00
Jeannette Dopheide
6dddd35d21 Correcting spelling errors found under bro 2.4.1+dfsg-2 here:
https://lintian.debian.org/full/bengen@debian.org.html#bro_2.4.1_x2bdfsg-2
2016-04-25 11:49:04 -05:00
Robin Sommer
3957091e1b Renaming config.h to bro-config.h.
A couple times now I had this conflicting with files of the same name
in other projects.
2015-07-28 11:57:04 -07:00
Robin Sommer
c39223e226 Fixing potential leak in DNS error case. From Vlad.
Closes #967.
2013-03-17 17:37:06 -07:00
Robin Sommer
dfebb82238 Merge remote-tracking branch 'vlad/topic/vladg/dns_txt_queries'
* vlad/topic/vladg/dns_txt_queries:
  DNS TXT support

I've tweaked it a little bit, still seems to work ...

I'd like to add a test for this but I'n not quite sure how to do that.
We'd have to hardcode a destination server that then'd be contacted
each time the test-suite runs.
2012-11-01 10:38:36 -07:00
Vlad Grigorescu
bc79888190 DNS TXT support 2012-10-30 12:32:39 -04:00
Jon Siwek
67d01ab9e9 Small change to non-blocking DNS initialization.
The trailing dot on "localhost." circumvents use of /etc/hosts in
some environments (I saw it on FreeBSD 9.0-RELEASE-p3) and so emits
an actual DNS query.  When running the test suite, that would be
hundreds of useless queries.
2012-09-07 15:15:48 -05:00
Jon Siwek
0f207c243c Port DNS_Mgr to use new IPAddr class, enable lookups on IPv6 addrs.
Host lookups still need to be changed to also do AAAA queries.
2012-02-13 15:57:59 -06:00
Robin Sommer
b790856a40 Fixing a bunch of compiler warnings. 2011-10-06 17:46:47 -07:00
Jon Siwek
495e987938 Remove $Id$ tags 2011-08-04 15:21:18 -05:00
Robin Sommer
6b9d23abb2 Applying DNS TTL patch from #368.
I've restructured/cleaned up the original patch by thomas.other a bit.
2011-06-25 17:44:56 -07:00
Jon Siwek
59aaaf7ed5 Changed some autoconf-dependent preprocessor directives from #if to #ifdef.
Because it just results in less typing in CMake when not having to configure
a preprocessor definition to a specific value.
2010-11-17 20:38:32 -06:00
Robin Sommer
61757ac78b Initial import of svn+ssh:://svn.icir.org/bro/trunk/bro as of r7088 2010-09-27 20:42:30 -07:00