aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2002-10-23 20:47:23 +0000
committerhpa <hpa>2002-10-23 20:47:23 +0000
commit725183b5bac23a909b2ebe6f8267f77a7dd1357b (patch)
treef2995841db4191bb34b025b493cbdd6eef426021
parente1508afaa203fc855cfd188acebeece69d786ae1 (diff)
downloadtftp-hpa-725183b5bac23a909b2ebe6f8267f77a7dd1357b.tar.gz
Check that the received address is really AF_INET.
-rw-r--r--tftpd/tftpd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
index 5915eaf..052a450 100644
--- a/tftpd/tftpd.c
+++ b/tftpd/tftpd.c
@@ -543,6 +543,11 @@ main(int argc, char **argv)
}
}
+ if ( from.sin_family != AF_INET ) {
+ syslog(LOG_ERR, "received address was not AF_INET, please check your inetd config");
+ exit(EX_PROTOCOL);
+ }
+
if ( standalone && myaddr.sin_addr.s_addr == INADDR_ANY ) {
/* myrecvfrom() didn't capture the source address; but we might
have bound to a specific address, if so we should use it */