From 6af9a9842664ba88d89a67b300c1b0970bcf43ee Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 25 Jul 2013 18:30:53 +0100 Subject: [PATCH] udp.c: call buffer_init Nothing in udp.c call buffer_init. This might result in start padding underflows (assertion failures) if packets come in via routes that don't strip (much) off the front and then go out via routes that do add lots at the front. Signed-off-by: Ian Jackson --- udp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/udp.c b/udp.c index 42fbb1f..1e637b6 100644 --- a/udp.c +++ b/udp.c @@ -102,6 +102,7 @@ static void udp_afterpoll(void *state, struct pollfd *fds, int nfds) fromlen=sizeof(from); BUF_ASSERT_FREE(st->rbuf); BUF_ALLOC(st->rbuf,"udp_afterpoll"); + buffer_init(st->rbuf,calculate_max_start_pad()); rv=recvfrom(st->fd, st->rbuf->start, st->rbuf->len, 0, (struct sockaddr *)&from, &fromlen); if (rv>0) { -- 2.30.2