mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 04:58:21 +00:00
Merge branch 'master' into topic/jsiwek/improve_comm_loop
This commit is contained in:
commit
26887dd71b
9 changed files with 44 additions and 21 deletions
|
@ -4207,6 +4207,7 @@ bool SocketComm::Listen()
|
|||
safe_close(fd);
|
||||
CloseListenFDs();
|
||||
listen_next_try = time(0) + bind_retry_interval;
|
||||
freeaddrinfo(res0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -465,10 +465,7 @@ void Val::Describe(ODesc* d) const
|
|||
d->SP();
|
||||
}
|
||||
|
||||
if ( d->IsReadable() )
|
||||
ValDescribe(d);
|
||||
else
|
||||
Val::ValDescribe(d);
|
||||
ValDescribe(d);
|
||||
}
|
||||
|
||||
void Val::DescribeReST(ODesc* d) const
|
||||
|
|
|
@ -692,15 +692,23 @@ int DNS_Interpreter::ParseRR_EDNS(DNS_MsgInfo* msg,
|
|||
data += rdlength;
|
||||
len -= rdlength;
|
||||
}
|
||||
else
|
||||
{ // no data, move on
|
||||
data += rdlength;
|
||||
len -= rdlength;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void DNS_Interpreter::ExtractOctets(const u_char*& data, int& len,
|
||||
BroString** p)
|
||||
{
|
||||
uint16 dlen = ExtractShort(data, len);
|
||||
dlen = min(len, static_cast<int>(dlen));
|
||||
|
||||
if ( p )
|
||||
*p = new BroString(data, dlen, 0);
|
||||
|
||||
data += dlen;
|
||||
len -= dlen;
|
||||
}
|
||||
|
||||
int DNS_Interpreter::ParseRR_TSIG(DNS_MsgInfo* msg,
|
||||
const u_char*& data, int& len, int rdlength,
|
||||
const u_char* msg_start)
|
||||
|
@ -718,24 +726,17 @@ int DNS_Interpreter::ParseRR_TSIG(DNS_MsgInfo* msg,
|
|||
uint32 sign_time_sec = ExtractLong(data, len);
|
||||
unsigned int sign_time_msec = ExtractShort(data, len);
|
||||
unsigned int fudge = ExtractShort(data, len);
|
||||
|
||||
u_char request_MAC[16];
|
||||
memcpy(request_MAC, data, sizeof(request_MAC));
|
||||
|
||||
// Here we adjust the size of the requested MAC + u_int16_t
|
||||
// for length. See RFC 2845, sec 2.3.
|
||||
int n = sizeof(request_MAC) + sizeof(u_int16_t);
|
||||
data += n;
|
||||
len -= n;
|
||||
|
||||
BroString* request_MAC;
|
||||
ExtractOctets(data, len, &request_MAC);
|
||||
unsigned int orig_id = ExtractShort(data, len);
|
||||
unsigned int rr_error = ExtractShort(data, len);
|
||||
ExtractOctets(data, len, 0); // Other Data
|
||||
|
||||
msg->tsig = new TSIG_DATA;
|
||||
|
||||
msg->tsig->alg_name =
|
||||
new BroString(alg_name, alg_name_end - alg_name, 1);
|
||||
msg->tsig->sig = new BroString(request_MAC, sizeof(request_MAC), 1);
|
||||
msg->tsig->sig = request_MAC;
|
||||
msg->tsig->time_s = sign_time_sec;
|
||||
msg->tsig->time_ms = sign_time_msec;
|
||||
msg->tsig->fudge = fudge;
|
||||
|
|
|
@ -180,6 +180,7 @@ protected:
|
|||
|
||||
uint16 ExtractShort(const u_char*& data, int& len);
|
||||
uint32 ExtractLong(const u_char*& data, int& len);
|
||||
void ExtractOctets(const u_char*& data, int& len, BroString** p);
|
||||
|
||||
int ParseRR_Name(DNS_MsgInfo* msg,
|
||||
const u_char*& data, int& len, int rdlength,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue