From owner-svn-ports-all@freebsd.org Mon May 7 08:14:14 2018 Return-Path: Delivered-To: svn-ports-all@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 A4F82FAA9F9; Mon, 7 May 2018 08:14:14 +0000 (UTC) (envelope-from ehaupt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B3188701D; Mon, 7 May 2018 08:14:14 +0000 (UTC) (envelope-from ehaupt@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 5630D18B58; Mon, 7 May 2018 08:14:14 +0000 (UTC) (envelope-from ehaupt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w478EEp0097324; Mon, 7 May 2018 08:14:14 GMT (envelope-from ehaupt@FreeBSD.org) Received: (from ehaupt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w478EE6e097323; Mon, 7 May 2018 08:14:14 GMT (envelope-from ehaupt@FreeBSD.org) Message-Id: <201805070814.w478EE6e097323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ehaupt set sender to ehaupt@FreeBSD.org using -f From: Emanuel Haupt Date: Mon, 7 May 2018 08:14:14 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r469274 - in branches/2018Q2/net/socat: . files X-SVN-Group: ports-branches X-SVN-Commit-Author: ehaupt X-SVN-Commit-Paths: in branches/2018Q2/net/socat: . files X-SVN-Commit-Revision: 469274 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2018 08:14:14 -0000 Author: ehaupt Date: Mon May 7 08:14:13 2018 New Revision: 469274 URL: https://svnweb.freebsd.org/changeset/ports/469274 Log: MFH: r469273 Reinstate a patch from r384479 that was accidentally removed in r432474. It restores support to bridge a serial port across tcp. Notified by: leres, Alexandre.Fenyo@secu-independants.fr (via mail) Approved by: ports-secteam (blanket) Added: branches/2018Q2/net/socat/files/patch-xioopts.c - copied unchanged from r469273, head/net/socat/files/patch-xioopts.c Modified: branches/2018Q2/net/socat/Makefile Directory Properties: branches/2018Q2/ (props changed) Modified: branches/2018Q2/net/socat/Makefile ============================================================================== --- branches/2018Q2/net/socat/Makefile Mon May 7 08:13:07 2018 (r469273) +++ branches/2018Q2/net/socat/Makefile Mon May 7 08:14:13 2018 (r469274) @@ -3,7 +3,7 @@ PORTNAME= socat PORTVERSION= 1.7.3.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net ipv6 MASTER_SITES= http://www.dest-unreach.org/socat/download/ \ LOCAL/ehaupt Copied: branches/2018Q2/net/socat/files/patch-xioopts.c (from r469273, head/net/socat/files/patch-xioopts.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2018Q2/net/socat/files/patch-xioopts.c Mon May 7 08:14:13 2018 (r469274, copy of r469273, head/net/socat/files/patch-xioopts.c) @@ -0,0 +1,73 @@ +--- xioopts.c.orig 2015-01-24 10:15:22 UTC ++++ xioopts.c +@@ -2971,6 +2971,25 @@ int retropt_bind(struct opt *opts, + OFUNC_TERMIOS_FLAG, OFUNC_TERMIOS_PATTERN, and some OFUNC_SPEC */ + int applyopts(int fd, struct opt *opts, enum e_phase phase) { + struct opt *opt; ++#ifdef HAVE_TERMIOS_ISPEED ++ int ispeed_major = -1, ospeed_major = -1; ++ unsigned int ispeed_value, ospeed_value; ++ bool speed_done = false; ++ ++ opt = opts; while (opt && opt->desc != ODESC_END) { ++ if (opt->desc == ODESC_DONE || ++ (phase != PH_ALL && opt->desc->phase != phase)) { ++ ++opt; continue; } ++ if (opt->desc->optcode == OPT_ISPEED) { ++ ispeed_major = opt->desc->major; ++ ispeed_value = opt->value.u_uint; } ++ if (opt->desc->optcode == OPT_OSPEED) { ++ ospeed_major = opt->desc->major; ++ ospeed_value = opt->value.u_uint; } ++ ++opt; ++ continue; ++ } ++#endif /* HAVE_TERMIOS_ISPEED */ + + opt = opts; while (opt && opt->desc != ODESC_END) { + if (opt->desc == ODESC_DONE || +@@ -3605,21 +3624,29 @@ int applyopts(int fd, struct opt *opts, + + #ifdef HAVE_TERMIOS_ISPEED + } else if (opt->desc->func == OFUNC_TERMIOS_SPEED) { +- union { +- struct termios termarg; +- speed_t speeds[sizeof(struct termios)/sizeof(speed_t)]; +- } tdata; +- if (Tcgetattr(fd, &tdata.termarg) < 0) { +- Error3("tcgetattr(%d, %p): %s", +- fd, &tdata.termarg, strerror(errno)); +- opt->desc = ODESC_ERROR; ++opt; continue; +- } +- tdata.speeds[opt->desc->major] = opt->value.u_uint; +- if (Tcsetattr(fd, TCSADRAIN, &tdata.termarg) < 0) { +- Error3("tcsetattr(%d, TCSADRAIN, %p): %s", +- fd, &tdata.termarg, strerror(errno)); +- opt->desc = ODESC_ERROR; ++opt; continue; +- } ++ if (speed_done == false) { ++ union { ++ struct termios termarg; ++ speed_t speeds[sizeof(struct termios)/sizeof(speed_t)]; ++ } tdata; ++ if (Tcgetattr(fd, &tdata.termarg) < 0) { ++ Error3("tcgetattr(%d, %p): %s", ++ fd, &tdata.termarg, strerror(errno)); ++ opt->desc = ODESC_ERROR; ++opt; continue; ++ } ++ if (ispeed_major < 0 || ospeed_major < 0) ++ tdata.speeds[opt->desc->major] = opt->value.u_uint; ++ else{ ++ tdata.speeds[ispeed_major] = ispeed_value; ++ tdata.speeds[ospeed_major] = ospeed_value; ++ speed_done = true; ++ } ++ if (Tcsetattr(fd, TCSADRAIN, &tdata.termarg) < 0) { ++ Error3("tcsetattr(%d, TCSADRAIN, %p): %s", ++ fd, &tdata.termarg, strerror(errno)); ++ opt->desc = ODESC_ERROR; ++opt; continue; ++ } ++ } + #endif /* HAVE_TERMIOS_ISPEED */ + + } else if (opt->desc->func == OFUNC_TERMIOS_SPEC) {