aboutsummaryrefslogtreecommitdiff
path: root/contrib/libfido2/src/netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libfido2/src/netlink.c')
-rw-r--r--contrib/libfido2/src/netlink.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/libfido2/src/netlink.c b/contrib/libfido2/src/netlink.c
index 6fd9f63cb937..2a9216c39058 100644
--- a/contrib/libfido2/src/netlink.c
+++ b/contrib/libfido2/src/netlink.c
@@ -2,6 +2,7 @@
* Copyright (c) 2020 Yubico AB. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
+ * SPDX-License-Identifier: BSD-2-Clause
*/
#include <sys/socket.h>
@@ -30,6 +31,8 @@ static ssize_t (*fuzz_write)(int, const void *, size_t);
#define SOL_NETLINK 270
#endif
+#define NETLINK_POLL_MS 100
+
/* XXX avoid signed NLA_ALIGNTO */
#undef NLA_HDRLEN
#define NLA_HDRLEN NLMSG_ALIGN(sizeof(struct nlattr))
@@ -694,7 +697,7 @@ fido_nl_get_nfc_target(fido_nl_t *nl, uint32_t dev, uint32_t *target)
return (-1);
}
#endif
- r = nlmsg_rx(nl->fd, reply, sizeof(reply), -1);
+ r = nlmsg_rx(nl->fd, reply, sizeof(reply), NETLINK_POLL_MS);
#ifndef FIDO_FUZZ
if (setsockopt(nl->fd, SOL_NETLINK, NETLINK_DROP_MEMBERSHIP,
&nl->nfc_mcastgrp, sizeof(nl->nfc_mcastgrp)) == -1) {