mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

The NTP mode provides us with the identity of the endpoints. For the simple CLIENT / SERVER modes, flip the connection if we detect orig/resp disagreeing with what the message says. This mainly results in the history getting a ^ and the ntp.log / conn.log showing the corrected endpoints. Closes #2998.
12 lines
387 B
Text
12 lines
387 B
Text
# @TEST-EXEC: zeek -b -C -r $TRACES/ntp/misordered-ntp.pcap %INPUT
|
|
# @TEST-EXEC: btest-diff ntp.log
|
|
# @TEST-EXEC: btest-diff conn.log
|
|
# @TEST-EXEC: btest-diff .stdout
|
|
|
|
@load base/protocols/conn
|
|
@load base/protocols/ntp
|
|
|
|
event ntp_message(c: connection, is_orig: bool, msg: NTP::Message)
|
|
{
|
|
print fmt("ntp_message %s -> %s:%d (%s)", c$id$orig_h, c$id$resp_h, c$id$resp_p, c$history);
|
|
}
|