summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2020-05-06 22:31:19 -0700
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-05-07 09:33:07 +0200
commit5baf0ea8babe28e4cdece3f947158c71e8c3c7f7 (patch)
tree83aa8f01aa4fb06386bcf06bce0ac686bf4b5b99
parentc4dccd9999ac9272f6b68cbf80fd5f1dd7feef80 (diff)
downloadlibpcap-1.9.tar.gz
linux: throw in a temporary hack to squelch MSAN warnings.libpcap-1.9
(cherry picked from commit 858a202b939671ad315396b9f09a27a58cfb31ca)
-rw-r--r--pcap-linux.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pcap-linux.c b/pcap-linux.c
index ee40fa89..21de163b 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -2750,6 +2750,17 @@ get_if_flags(const char *name, bpf_u_int32 *flags, char *errbuf)
memset(&ifr, 0, sizeof(ifr));
pcap_strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
info.cmd = ETHTOOL_GLINK;
+ /*
+ * XXX - while Valgrind handles SIOCETHTOOL and knows that
+ * the ETHTOOL_GLINK command sets the .data member of the
+ * structure, Memory Sanitizer doesn't yet do so:
+ *
+ * https://bugs.llvm.org/show_bug.cgi?id=45814
+ *
+ * For now, we zero it out to squelch warnings; if the bug
+ * in question is fixed, we can remove this.
+ */
+ info.data = 0;
ifr.ifr_data = (caddr_t)&info;
if (ioctl(sock, SIOCETHTOOL, &ifr) == -1) {
int save_errno = errno;