From: Ian Jackson Date: Sun, 29 Jun 2014 23:39:02 +0000 (+0100) Subject: udp proxy: Properly zero holes in proxied address X-Git-Tag: base.polypath.v3~18 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=4feadf25597224dec49c09e3ed300a118814ed29;hp=22fb98aea620037f03a00d107320eab0c3e933cc udp proxy: Properly zero holes in proxied address The comm_addr we are producing here, from information from a packet forwarded to us by the proxy, is supposed to have all-bits-zero in any holes it may have. Signed-off-by: Ian Jackson --- diff --git a/udp.c b/udp.c index 33971a8..90f8e9a 100644 --- a/udp.c +++ b/udp.c @@ -104,6 +104,7 @@ static void udp_afterpoll(void *state, struct pollfd *fds, int nfds) continue; } /* proxy protocol supports ipv4 transport only */ + FILLZERO(from); from.sa.sa_family=AF_INET; memcpy(&from.sin.sin_addr,buf_unprepend(st->rbuf,4),4); buf_unprepend(st->rbuf,2);