chiark / gitweb /
logging: Provide lg_perror and lg_vperror
[secnet.git] / udp.c
diff --git a/udp.c b/udp.c
index 8ae5671bd64a38a16914997ffe035f65e0b4d26f..bb8d9ef73cd61f272dd0518e4ed67f52199b3d0c 100644 (file)
--- a/udp.c
+++ b/udp.c
@@ -87,11 +87,7 @@ static int udp_beforepoll(void *state, struct pollfd *fds, int *nfds_io,
 {
     int i;
     struct udp *st=state;
-    if (*nfds_io<st->n_socks) {
-       *nfds_io=st->n_socks;
-       return ERANGE;
-    }
-    *nfds_io=st->n_socks;
+    BEFOREPOLL_WANT_FDS(st->n_socks);
     for (i=0; i<st->n_socks; i++) {
        fds[i].fd=st->socks[i].fd;
        fds[i].events=POLLIN;
@@ -330,7 +326,7 @@ static void udp_phase_hook(void *sst, uint32_t new_phase)
     for (i=0; i<st->n_socks; i++)
        udp_make_socket(st,&st->socks[i]);
 
-    register_for_poll(st,udp_beforepoll,udp_afterpoll,MAX_SOCKETS,"udp");
+    register_for_poll(st,udp_beforepoll,udp_afterpoll,"udp");
 }
 
 static list_t *udp_apply(closure_t *self, struct cloc loc, dict_t *context,