aboutsummaryrefslogtreecommitdiffstats
path: root/caputils
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-02-03 13:32:50 -0800
committerGuy Harris <guy@alum.mit.edu>2018-02-03 21:34:09 +0000
commit6fd153181402f897577aebb3943a23c2666c2864 (patch)
tree81ad264a5c57050e9b0469ac1ffff29bd7051586 /caputils
parentebb471f2116494f2c56124b03a5f21818e8cc71b (diff)
Add a comment explaining why err is volatile.
And also indicate that perhaps the right solution was just to close the CID as a false positive, as Coverity doesn't have a deep enough understanding of libnl to know that the loop isn't guaranteed to be infinite. Change-Id: Ieb0651c803a5939fb54f2bc68bdf8c5485dafaf2 Reviewed-on: https://code.wireshark.org/review/25582 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'caputils')
-rw-r--r--caputils/ws80211_utils.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/caputils/ws80211_utils.c b/caputils/ws80211_utils.c
index 2db068882b..cff2e88d90 100644
--- a/caputils/ws80211_utils.c
+++ b/caputils/ws80211_utils.c
@@ -142,6 +142,21 @@ static int ack_handler(struct nl_msg *msg _U_, void *arg)
static int nl80211_do_cmd(struct nl_msg *msg, struct nl_cb *cb)
{
+ /*
+ * XXX - Coverity doesn't understand how libnl works, so it
+ * doesn't know that nl_recvmsgs() calls the callback, and
+ * that the callback has had a pointer to err registered
+ * with it, and therefore that nl_recvmsgs() can change
+ * err as a side-effect, so it thinks this can loop
+ * infinitely.
+ *
+ * We declare err to be volatile to work around it.
+ *
+ * XXX - that workaround provokes a compiler complaint that
+ * casting a pointer to it to "void *" discards the
+ * volatile qualifier. Perhaps we should just re-close
+ * Coverity CID 997052 as "false positive".
+ */
volatile int err;
if (!nl_state.nl_sock)