Skip to content
Snippets Groups Projects
Commit 04692154 authored by David Vasek's avatar David Vasek Committed by Daniel Salzman
Browse files

tcp-handler, udp-handler: remove rcu_read_lock()'s from the UDP and TCP ifaces inits

parent 3b031868
No related merge requests found
Pipeline #52486 passed with stages
in 5 minutes and 20 seconds
......@@ -128,13 +128,11 @@ static unsigned tcp_set_ifaces(const list_t *ifaces, fdset_t *fds, int thread_id
{
assert(ifaces != NULL && fds != NULL);
rcu_read_lock();
fdset_clear(fds);
iface_t *i = NULL;
WALK_LIST(i, *ifaces) {
fdset_add(fds, i->fd_tcp, POLLIN, NULL);
}
rcu_read_unlock();
return fds->n;
}
......
/* Copyright (C) 2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -26,7 +26,6 @@
#include <string.h>
#include <assert.h>
#include <sys/param.h>
#include <urcu.h>
#ifdef HAVE_SYS_UIO_H // struct iovec (OpenBSD)
#include <sys/uio.h>
#endif /* HAVE_SYS_UIO_H */
......@@ -383,7 +382,6 @@ static nfds_t track_ifaces(const list_t *ifaces, struct pollfd **fds_ptr,
assert(ifaces && fds_ptr);
nfds_t nfds = list_size(ifaces);
rcu_read_lock();
struct pollfd *fds = malloc(nfds * sizeof(*fds));
if (!fds) {
*fds_ptr = NULL;
......@@ -401,7 +399,6 @@ static nfds_t track_ifaces(const list_t *ifaces, struct pollfd **fds_ptr,
assert(i == nfds);
*fds_ptr = fds;
rcu_read_unlock();
return nfds;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment