diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-04-28 23:58:06 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-04-28 23:58:06 +0000 |
commit | 4964af1b03f17fb18cef3a816411868ce05be997 (patch) | |
tree | 8c63c46716a87e2207887c3806c85e60aba449e4 | |
parent | 35f29b7c3938425c468efe4b6866db4f7053ffeb (diff) |
Deal again w/ the brain damaged osockaddr.
-rw-r--r-- | usr.bin/talk/ctl_transact.c | 1 | ||||
-rw-r--r-- | usr.bin/talk/look_up.c | 11 |
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); |