chiark / gitweb /
udp proxy: Properly zero holes in proxied address
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 29 Jun 2014 23:39:02 +0000 (00:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 2 Oct 2014 15:30:20 +0000 (16:30 +0100)
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 <ijackson@chiark.greenend.org.uk>
udp.c

diff --git a/udp.c b/udp.c
index 33971a8..90f8e9a 100644 (file)
--- 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);