From 3cca061cdcc1837da3fd07f0e9f24d69c7d13b17 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 30 Sep 1994 02:16:44 +0000 Subject: [PATCH] Use getsockname instead of getpeername in order to get the sender address! git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4395 dc483132-0cff-0310-8789-dd5450dbe970 --- src/slave/ChangeLog | 5 +++++ src/slave/kprop.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/slave/ChangeLog b/src/slave/ChangeLog index 630581b4e..967ef492b 100644 --- a/src/slave/ChangeLog +++ b/src/slave/ChangeLog @@ -1,3 +1,8 @@ +Thu Sep 29 22:15:27 1994 Theodore Y. Ts'o (tytso@dcl) + + * kprop.c (open_connection): Use getsockname instead of + getpeername when getting the sender address. + Thu Sep 15 12:48:21 1994 Theodore Y. Ts'o (tytso@dcl) * kpropd.c (PRS): Only report errors to syslog if the debug flag diff --git a/src/slave/kprop.c b/src/slave/kprop.c index 1ce00af3d..eb2fabc77 100644 --- a/src/slave/kprop.c +++ b/src/slave/kprop.c @@ -343,10 +343,10 @@ open_connection(host, fd, Errmsg) sizeof(sin.sin_addr)); socket_length = sizeof(sin); - if (getpeername(s, (struct sockaddr *)&sin, &socket_length) < 0) { + if (getsockname(s, (struct sockaddr *)&sin, &socket_length) < 0) { retval = errno; close(s); - (void) sprintf(Errmsg, "in call to getpeername"); + (void) sprintf(Errmsg, "in call to getsockname"); return(retval); } sender_addr.addrtype = ADDRTYPE_INET; -- 2.26.2