From b025a593a7f3a0fe505e8ec32929bdc4fe2cb492 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Sat, 21 Jan 2017 11:32:05 +0000 Subject: 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@ --- usr.bin/tftp/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr.bin/tftp') 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; -- cgit v1.2.3