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>
Sat, 27 Sep 2014 17:48:12 +0000 (18:48 +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 33971a8129da6f4a454213e4b49d4a6903cb1f7e..90f8e9a36602b7cc6ff3fb72e7d7852e4e6f14ed 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);