diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-01-28 10:45:08 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-01-28 10:46:45 -0800 |
commit | cdb7c38770dc67cf75d84540049d364968d06428 (patch) | |
tree | 0044413ac72d491fc22e21c99f53339520754ab1 /nametoaddr.c | |
parent | 8d41c83d768cfb1bddafef94fb64ca435b8866ba (diff) |
Clarify the thread safety of pcap_ether_hostton().
Diffstat (limited to 'nametoaddr.c')
-rw-r--r-- | nametoaddr.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/nametoaddr.c b/nametoaddr.c index 45743c71..eea629a9 100644 --- a/nametoaddr.c +++ b/nametoaddr.c @@ -702,11 +702,12 @@ pcap_ether_aton(const char *s) return (e); } +#ifndef HAVE_ETHER_HOSTTON /* - * XXX - not thread-safe! + * Roll our own. + * XXX - not thread-safe, because pcap_next_etherent() isn't thread- + * safe! Needs a mutex or a thread-safe pcap_next_etherent(). */ -#ifndef HAVE_ETHER_HOSTTON -/* Roll our own */ u_char * pcap_ether_hostton(const char *name) { @@ -737,7 +738,10 @@ pcap_ether_hostton(const char *name) return (NULL); } #else -/* Use the os supplied routines */ +/* + * Use the OS-supplied routine. + * This *should* be thread-safe; the API doesn't have a static buffer. + */ u_char * pcap_ether_hostton(const char *name) { |