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.v1~18 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=e6647c6ddf1dfaf35b2f70b2d453b63b2ce293e1;hp=750c488b451b96f5f76ca20389a3da0ff17f2551 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);