From: claudio Date: Thu, 15 Apr 2021 13:31:30 +0000 (+0000) Subject: Call rrdp_data_handler() for any kind of poll event that has happened. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c494faa752f03fcc4d3ff5a9f58af96903174ba3;p=openbsd Call rrdp_data_handler() for any kind of poll event that has happened. On OpenBSD closing a connection will result in a read even (POLLIN) while on Linux POLLHUP is returned. rrdp_data_handler()'s read() call returns in both cases 0 and finishes the XML parsing. Found and fix tested by job@, OK deraadt@ --- diff --git a/usr.sbin/rpki-client/rrdp.c b/usr.sbin/rpki-client/rrdp.c index 7f8b2d0b356..4ac925c5272 100644 --- a/usr.sbin/rpki-client/rrdp.c +++ b/usr.sbin/rpki-client/rrdp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rrdp.c,v 1.4 2021/04/12 17:23:30 claudio Exp $ */ +/* $OpenBSD: rrdp.c,v 1.5 2021/04/15 13:31:30 claudio Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2021 Claudio Jeker @@ -579,7 +579,7 @@ proc_rrdp(int fd) TAILQ_FOREACH_SAFE(s, &states, entry, ns) { if (s->pfd == NULL) continue; - if (s->pfd->revents & POLLIN) + if (s->pfd->revents != 0) rrdp_data_handler(s); } }