summaryrefslogtreecommitdiff
path: root/usr.bin/talk/look_up.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-04-28 23:58:06 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-04-28 23:58:06 +0000
commit4964af1b03f17fb18cef3a816411868ce05be997 (patch)
tree8c63c46716a87e2207887c3806c85e60aba449e4 /usr.bin/talk/look_up.c
parent35f29b7c3938425c468efe4b6866db4f7053ffeb (diff)
Deal again w/ the brain damaged osockaddr.
Diffstat (limited to 'usr.bin/talk/look_up.c')
-rw-r--r--usr.bin/talk/look_up.c11
1 files changed, 5 insertions, 6 deletions
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);