mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
Use ether_ntoa instead of ether_ntoa_r
The latter is thread-safe, but a GNU addition which does not exist on OS-X. Since the function only is called in the main thread, it should not matter if it is or is not threadsafe.
This commit is contained in:
parent
607b51f3b2
commit
a91483d4e4
1 changed files with 4 additions and 5 deletions
|
@ -391,19 +391,18 @@ RecordVal* Connection::BuildConnVal()
|
|||
if ( inner_vlan != 0 )
|
||||
conn_val->Assign(10, new Val(inner_vlan, TYPE_INT));
|
||||
|
||||
char buffer[20];
|
||||
char null[sizeof(eth_src)]{};
|
||||
|
||||
if ( memcmp(ð_src, &null, sizeof(eth_src)) != 0 )
|
||||
{
|
||||
ether_ntoa_r(ð_src, buffer);
|
||||
conn_val->Assign(11, new StringVal(buffer));
|
||||
char* eaddr = ether_ntoa(ð_src);
|
||||
conn_val->Assign(11, new StringVal(eaddr));
|
||||
}
|
||||
|
||||
if ( memcmp(ð_dst, &null, sizeof(eth_dst)) != 0 )
|
||||
{
|
||||
ether_ntoa_r(ð_dst, buffer);
|
||||
conn_val->Assign(12, new StringVal(buffer));
|
||||
char* eaddr = ether_ntoa(ð_dst);
|
||||
conn_val->Assign(12, new StringVal(eaddr));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue