From owner-svn-src-head@freebsd.org Fri Jan 18 21:30:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15C7D148353C; Fri, 18 Jan 2019 21:30:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B31187519F; Fri, 18 Jan 2019 21:30:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A98EB8434; Fri, 18 Jan 2019 21:30:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0ILU7r7035932; Fri, 18 Jan 2019 21:30:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0ILU6Yg035928; Fri, 18 Jan 2019 21:30:06 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901182130.x0ILU6Yg035928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 18 Jan 2019 21:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343161 - in head: include/protocols libexec/talkd usr.bin/talk X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: include/protocols libexec/talkd usr.bin/talk X-SVN-Commit-Revision: 343161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B31187519F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2019 21:30:08 -0000 Author: brooks Date: Fri Jan 18 21:30:06 2019 New Revision: 343161 URL: https://svnweb.freebsd.org/changeset/base/343161 Log: Use a private definition of osockaddr rather then relying on type namespace polution in sys/socket.h. Also remove support for operation on 4.3BSD. PR: 224529 Differential Revision: https://reviews.freebsd.org/D14505 Modified: head/include/protocols/talkd.h head/libexec/talkd/talkd.c head/usr.bin/talk/invite.c head/usr.bin/talk/look_up.c Modified: head/include/protocols/talkd.h ============================================================================== --- head/include/protocols/talkd.h Fri Jan 18 21:25:46 2019 (r343160) +++ head/include/protocols/talkd.h Fri Jan 18 21:30:06 2019 (r343161) @@ -55,6 +55,15 @@ */ /* + * The talk protocol embeds a 4.3BSD sockaddr. Define our own version + * rather then relying on namespace polution in kernel headers. + */ +struct tsockaddr { + unsigned short sa_family; + char sa_data[14]; +}; + +/* * Client->server request message format. */ typedef struct { @@ -63,8 +72,8 @@ typedef struct { u_char answer; /* not used */ u_char pad; u_int32_t id_num; /* message id */ - struct osockaddr addr; /* old (4.3) style */ - struct osockaddr ctl_addr; /* old (4.3) style */ + struct tsockaddr addr; /* old (4.3) style */ + struct tsockaddr ctl_addr; /* old (4.3) style */ int32_t pid; /* caller's process id */ #define NAME_SIZE 12 char l_name[NAME_SIZE];/* caller's name */ @@ -82,7 +91,7 @@ typedef struct { u_char answer; /* respose to request message, see below */ u_char pad; u_int32_t id_num; /* message id */ - struct osockaddr addr; /* address for establishing conversation */ + struct tsockaddr addr; /* address for establishing conversation */ } CTL_RESPONSE; #define TALK_VERSION 1 /* protocol version */ Modified: head/libexec/talkd/talkd.c ============================================================================== --- head/libexec/talkd/talkd.c Fri Jan 18 21:25:46 2019 (r343160) +++ head/libexec/talkd/talkd.c Fri Jan 18 21:30:06 2019 (r343161) @@ -114,7 +114,8 @@ main(int argc, char *argv[]) continue; } lastmsgtime = time(0); - (void)memcpy(&ctl_addr, &mp->ctl_addr, sizeof(ctl_addr)); + (void)memcpy(&ctl_addr.sa_data, &mp->ctl_addr.sa_data, + sizeof(ctl_addr.sa_data)); ctl_addr.sa_family = ntohs(mp->ctl_addr.sa_family); ctl_addr.sa_len = sizeof(ctl_addr); process_request(mp, &response); Modified: head/usr.bin/talk/invite.c ============================================================================== --- head/usr.bin/talk/invite.c Fri Jan 18 21:25:46 2019 (r343160) +++ head/usr.bin/talk/invite.c Fri Jan 18 21:30:06 2019 (r343161) @@ -77,13 +77,9 @@ invite_remote(void) itimer.it_interval = itimer.it_value; if (listen(sockt, 5) != 0) p_error("Error on attempt to listen for caller"); -#ifdef MSG_EOR /* copy new style sockaddr to old, swap family (short in old) */ - msg.addr = *(struct osockaddr *)&my_addr; /* XXX new to old style*/ + msg.addr = *(struct tsockaddr *)&my_addr; msg.addr.sa_family = htons(my_addr.sin_family); -#else - msg.addr = *(struct sockaddr *)&my_addr; -#endif msg.id_num = htonl(-1); /* an impossible id_num */ invitation_waiting = 1; announce_invite(); Modified: head/usr.bin/talk/look_up.c ============================================================================== --- head/usr.bin/talk/look_up.c Fri Jan 18 21:25:46 2019 (r343160) +++ head/usr.bin/talk/look_up.c Fri Jan 18 21:30:06 2019 (r343161) @@ -59,13 +59,9 @@ check_local(void) struct sockaddr addr; /* the rest of msg was set up in get_names */ -#ifdef MSG_EOR /* copy new style sockaddr to old, swap family (short in old) */ - msg.ctl_addr = *(struct osockaddr *)&ctl_addr; + msg.ctl_addr = *(struct tsockaddr *)&ctl_addr; msg.ctl_addr.sa_family = htons(ctl_addr.sin_family); -#else - msg.ctl_addr = *(struct sockaddr *)&ctl_addr; -#endif /* must be initiating a talk */ if (!look_for_invite(rp)) return (0);