diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2017-01-21 11:32:05 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2017-01-21 11:32:05 +0000 |
commit | b025a593a7f3a0fe505e8ec32929bdc4fe2cb492 (patch) | |
tree | c2851b59914141ec276fa5f41f40364392ace7b5 /usr.bin/tftp | |
parent | 4459c5ac6936d9fae7cf90f9f546e056dcc7e590 (diff) |
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')
-rw-r--r-- | usr.bin/tftp/main.c | 5 |
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; |