aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2015-08-07 11:55:08 -0700
committerH. Peter Anvin <hpa@zytor.com>2015-08-07 11:55:08 -0700
commitb2b34cecc8cbc18ff6f1fc00bda6ae6e9011e6c7 (patch)
tree7bb56b454d032423800d5a07a1575fcea1b39e83
parent7678ae7f14e5aa6792c4486d4eedcb2db887872c (diff)
downloadtftp-hpa-b2b34cecc8cbc18ff6f1fc00bda6ae6e9011e6c7.tar.gz
tftpd: Canonicalize myaddr before address_is_local()HEADmaster
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 <hpa@zytor.com>
-rw-r--r--tftpd/recvfrom.c4
1 files changed, 3 insertions, 1 deletions
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;