From b2b34cecc8cbc18ff6f1fc00bda6ae6e9011e6c7 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 7 Aug 2015 11:55:08 -0700 Subject: tftpd: Canonicalize myaddr before address_is_local() The comparisons for forbidden addresses in address_is_local() only work on canonicalized addresses. Also, work in the case myaddr is NULL (if we ever call it that way...) Signed-off-by: H. Peter Anvin --- tftpd/recvfrom.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tftpd/recvfrom.c b/tftpd/recvfrom.c index 83ef29a..d7ef500 100644 --- a/tftpd/recvfrom.c +++ b/tftpd/recvfrom.c @@ -255,6 +255,9 @@ myrecvfrom(int s, void *buf, int len, unsigned int flags, } #endif } + + normalize_ip6_compat(myaddr); + /* If the address is not a valid local address, * then bind to any address... */ @@ -268,7 +271,6 @@ myrecvfrom(int s, void *buf, int len, unsigned int flags, } } - normalize_ip6_compat(myaddr); normalize_ip6_compat(from); return n; -- cgit v1.2.1