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:
Johanna Amann 2016-06-02 17:17:00 -07:00
parent 607b51f3b2
commit a91483d4e4

View file

@ -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(&eth_src, &null, sizeof(eth_src)) != 0 )
{
ether_ntoa_r(&eth_src, buffer);
conn_val->Assign(11, new StringVal(buffer));
char* eaddr = ether_ntoa(&eth_src);
conn_val->Assign(11, new StringVal(eaddr));
}
if ( memcmp(&eth_dst, &null, sizeof(eth_dst)) != 0 )
{
ether_ntoa_r(&eth_dst, buffer);
conn_val->Assign(12, new StringVal(buffer));
char* eaddr = ether_ntoa(&eth_dst);
conn_val->Assign(12, new StringVal(eaddr));
}
}