summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/talk/ctl_transact.c1
-rw-r--r--usr.bin/talk/look_up.c11
2 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/talk/ctl_transact.c b/usr.bin/talk/ctl_transact.c
index bf9ce85a744..e3b7cae55b1 100644
--- a/usr.bin/talk/ctl_transact.c
+++ b/usr.bin/talk/ctl_transact.c
@@ -114,5 +114,4 @@ ctl_transact(target, msg, type, rp)
rp->type != type));
} while (rp->vers != TALK_VERSION || rp->type != type);
rp->id_num = ntohl(rp->id_num);
- rp->addr.sa_family = ntohs(rp->addr.sa_family);
}
diff --git a/usr.bin/talk/look_up.c b/usr.bin/talk/look_up.c
index a626fa897be..ab2b7e9ef15 100644
--- a/usr.bin/talk/look_up.c
+++ b/usr.bin/talk/look_up.c
@@ -54,7 +54,6 @@ static char rcsid[] = "$NetBSD: look_up.c,v 1.3 1994/12/09 02:14:21 jtc Exp $";
check_local()
{
CTL_RESPONSE response;
- register CTL_RESPONSE *rp = &response;
/* the rest of msg was set up in get_names */
#ifdef MSG_EOR
@@ -65,7 +64,7 @@ check_local()
msg.ctl_addr = *(struct sockaddr *)&ctl_addr;
#endif
/* must be initiating a talk */
- if (!look_for_invite(rp))
+ if (!look_for_invite(&response))
return (0);
/*
* There was an invitation waiting for us,
@@ -73,11 +72,11 @@ check_local()
*/
current_state = "Waiting to connect with caller";
do {
- if (rp->addr.sa_family != AF_INET)
+ if (ntohs(response.addr.sa_family) != AF_INET)
p_error("Response uses invalid network address");
errno = 0;
- if (connect(sockt,
- (struct sockaddr *)&rp->addr, sizeof (rp->addr)) != -1)
+ if (connect(sockt, (struct sockaddr *)&response.addr,
+ sizeof (response.addr)) != -1)
return (1);
} while (errno == EINTR);
if (errno == ECONNREFUSED) {
@@ -87,7 +86,7 @@ check_local()
* invitation. (We know there are no newer invitations,
* the talkd works LIFO.)
*/
- ctl_transact(his_machine_addr, msg, DELETE, rp);
+ ctl_transact(his_machine_addr, msg, DELETE, &response);
close(sockt);
open_sockt();
return (0);