From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Mar 9 01:56:18 2015 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1ADD4AEC for ; Mon, 9 Mar 2015 01:56:18 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F071B805 for ; Mon, 9 Mar 2015 01:56:17 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t291uHAC002209 for ; Mon, 9 Mar 2015 01:56:17 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 198441] net/socat: changing speed on many serial devices does not work Date: Mon, 09 Mar 2015 01:56:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: fbsd.bugzilla@fenyo.net X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ehaupt@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 01:56:18 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198441 Bug ID: 198441 Summary: net/socat: changing speed on many serial devices does not work Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: ehaupt@FreeBSD.org Reporter: fbsd.bugzilla@fenyo.net Assignee: ehaupt@FreeBSD.org Flags: maintainer-feedback?(ehaupt@FreeBSD.org) Created attachment 154044 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=154044&action=edit add the content of this file in net/socat/files/patch-xioopts.c - this is a patch for socat 1.7.3.0 With SOCAT on systems where b0 to b4000000 options are not available, like FreeBSD, setting the speed of a TERMIOS terminal is done using the ispeed and ospeed options. But when using simultaneously ispeed and ospeed parameters with SOCAT, the speed values are set within two distinct ioctl requests, so changing the speed of terminals or devices that need matching input and output returns an Invalid argument error (the TIOCSETA/TIOCSETAW/TIOCSETAF ioctl returns -1 and sets errno to EINVAL). This is especially the case On FreeBSD, where many tty device drivers need matching input and output speeds: - those that depend on ucom(4): uark(4), ubsa(4), ubser(4), uftdi(4), umcs(4), uplcom(4), uslcom(4), uvscom(4) - some others, even not depending on ucom(4): sio(4), digi(4), rp(4) But some don't: tty(4) With those drivers, the input and output speeds must match and be set inside a single ioctl request (TIOCSETA, TIOCSETAW or TIOCSETAF). The only exception to this rule is when the input baud rate is zero because, according to POSIX, in that case, the input baud rate is set equal to the output baud rate. For instance, this call to SOCAT on FreeBSD 10.1 terminates immediately with an EINVAL error: # socat -d /dev/cuaU2,ispeed=57600,ospeed=57600,echo=0,raw TCP-LISTEN:9000,reuseaddr 2015/03/09 00:43:33 socat[20723] E tcsetattr(3, TCSADRAIN, 0x7fffffffe148): Invalid argument The attached patch avoids this type of error: when setting both input and output speeds, only one ioctl syscall is performed. -- You are receiving this mail because: You are the assignee for the bug.