summaryrefslogtreecommitdiffstats
path: root/zebra/zserv.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-07-18 18:32:07 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-07-18 18:32:07 +0200
commit2875801fa3ad80a8cbcfdcb6b556001d9ba83e4a (patch)
treec8e45980d0efa400b61bcd248d7187a645df5053 /zebra/zserv.c
parentMerge pull request #2669 from netravnen/hotfix/documentation/activate-bgp-rpki (diff)
downloadfrr-2875801fa3ad80a8cbcfdcb6b556001d9ba83e4a.tar.xz
frr-2875801fa3ad80a8cbcfdcb6b556001d9ba83e4a.zip
zebra: fix zapi fuzzing infra
Some of this stuff got broken with the introduction of pthreads. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--zebra/zserv.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index b08da9ceb..4c90757d7 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -640,7 +640,7 @@ static int zserv_handle_client_close(struct thread *thread)
* sock
* client's socket file descriptor
*/
-static void zserv_client_create(int sock)
+static struct zserv *zserv_client_create(int sock)
{
struct zserv *client;
int i;
@@ -696,6 +696,8 @@ static void zserv_client_create(int sock)
/* start pthread */
frr_pthread_run(client->pthread, NULL);
+
+ return client;
}
/*
@@ -1025,20 +1027,10 @@ void zserv_read_file(char *input)
struct zserv *client = NULL;
struct thread t;
- zserv_client_create(-1);
-
- frr_pthread_stop(client->pthread, NULL);
- frr_pthread_destroy(client->pthread);
- client->pthread = NULL;
-
- t.arg = client;
-
fd = open(input, O_RDONLY | O_NONBLOCK);
t.u.fd = fd;
- zserv_read(&t);
-
- close(fd);
+ zserv_client_create(fd);
}
#endif