mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 02:58:20 +00:00
Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath: Fix return value of hook calls that have no handlers. Fix to_port() BIF for port strings with a port number of zero.
This commit is contained in:
commit
40007d075c
7 changed files with 21 additions and 4 deletions
8
CHANGES
8
CHANGES
|
@ -1,4 +1,12 @@
|
||||||
|
|
||||||
|
2.1-234 | 2012-12-20 12:12:19 -0800
|
||||||
|
|
||||||
|
* Fix return value of hook calls that have no handlers. For this
|
||||||
|
case, the return value is always true. (Jon Siwek)
|
||||||
|
|
||||||
|
* Fix to_port() BIF for port strings with a port number of zero.
|
||||||
|
(Jon Siwek)
|
||||||
|
|
||||||
2.1-231 | 2012-12-14 14:51:35 -0800
|
2.1-231 | 2012-12-14 14:51:35 -0800
|
||||||
|
|
||||||
* Make const variables actually constant. Both local and global
|
* Make const variables actually constant. Both local and global
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
2.1-231
|
2.1-234
|
||||||
|
|
|
@ -288,7 +288,8 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
|
||||||
assert(Flavor() == FUNC_FLAVOR_EVENT || Flavor() == FUNC_FLAVOR_HOOK);
|
assert(Flavor() == FUNC_FLAVOR_EVENT || Flavor() == FUNC_FLAVOR_HOOK);
|
||||||
loop_over_list(*args, i)
|
loop_over_list(*args, i)
|
||||||
Unref((*args)[i]);
|
Unref((*args)[i]);
|
||||||
return 0 ;
|
|
||||||
|
return Flavor() == FUNC_FLAVOR_HOOK ? new Val(true, TYPE_BOOL) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SegmentProfiler(segment_logger, location);
|
SegmentProfiler(segment_logger, location);
|
||||||
|
|
|
@ -2684,8 +2684,9 @@ function to_port%(s: string%): port
|
||||||
if ( s->Len() < 10 )
|
if ( s->Len() < 10 )
|
||||||
{
|
{
|
||||||
char* slash;
|
char* slash;
|
||||||
|
errno = 0;
|
||||||
port = strtol(s->CheckString(), &slash, 10);
|
port = strtol(s->CheckString(), &slash, 10);
|
||||||
if ( port )
|
if ( ! errno )
|
||||||
{
|
{
|
||||||
++slash;
|
++slash;
|
||||||
if ( streq(slash, "tcp") )
|
if ( streq(slash, "tcp") )
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
123/tcp
|
123/tcp
|
||||||
123/udp
|
123/udp
|
||||||
123/icmp
|
123/icmp
|
||||||
|
0/tcp
|
||||||
|
0/udp
|
||||||
|
0/icmp
|
||||||
0/unknown
|
0/unknown
|
||||||
256/tcp
|
256/tcp
|
||||||
256/udp
|
256/udp
|
||||||
|
|
|
@ -3,6 +3,7 @@ myhook return F
|
||||||
myhook return T
|
myhook return T
|
||||||
myhook, &priority=5, [a=37, b=goobye world]
|
myhook, &priority=5, [a=37, b=goobye world]
|
||||||
F
|
F
|
||||||
|
T
|
||||||
myhook3, 8
|
myhook3, 8
|
||||||
T
|
T
|
||||||
myhook4, 2
|
myhook4, 2
|
||||||
|
|
|
@ -7,6 +7,9 @@ event bro_init()
|
||||||
print to_port("123/tcp");
|
print to_port("123/tcp");
|
||||||
print to_port("123/udp");
|
print to_port("123/udp");
|
||||||
print to_port("123/icmp");
|
print to_port("123/icmp");
|
||||||
|
print to_port("0/tcp");
|
||||||
|
print to_port("0/udp");
|
||||||
|
print to_port("0/icmp");
|
||||||
print to_port("not a port");
|
print to_port("not a port");
|
||||||
|
|
||||||
local a: transport_proto = tcp;
|
local a: transport_proto = tcp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue