summaryrefslogtreecommitdiffstats
path: root/usr.bin/tftp/main.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2017-01-21 11:32:04 +0000
committerguenther <guenther@openbsd.org>2017-01-21 11:32:04 +0000
commitda77251e4b83a2abd44b652cb9d87e32457843cf (patch)
treebe25696c2a919bf5f76fc45a032e91ed813b7ef0 /usr.bin/tftp/main.c
parentStop calling out to sudo/doas to kill processes. Reliance on system (diff)
downloadwireguard-openbsd-da77251e4b83a2abd44b652cb9d87e32457843cf.tar.xz
wireguard-openbsd-da77251e4b83a2abd44b652cb9d87e32457843cf.zip
The POSIX APIs that that sockaddrs all ignore the s*_len field in the
incoming socket, so userspace doesn't need to set it unless it has its own reasons for tracking the size along with the sockaddr. ok phessler@ deraadt@ florian@
Diffstat (limited to 'usr.bin/tftp/main.c')
-rw-r--r--usr.bin/tftp/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index 28560039fe7..546684b885a 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.40 2016/03/16 15:41:11 krw Exp $ */
+/* $OpenBSD: main.c,v 1.41 2017/01/21 11:32:04 guenther Exp $ */
/* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */
/*
@@ -232,8 +232,7 @@ setpeer(char *host, char *port)
memset(&ss, 0, sizeof(ss));
ss.ss_family = res->ai_family;
- ss.ss_len = res->ai_addrlen;
- if (bind(f, (struct sockaddr *)&ss, ss.ss_len) < 0) {
+ if (bind(f, (struct sockaddr *)&ss, res->ai_addrlen) < 0) {
cause = "bind";
close(f);
f = -1;