From owner-freebsd-standards@freebsd.org Fri Jul 29 13:30:14 2016 Return-Path: Delivered-To: freebsd-standards@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83EA4BA600D for ; Fri, 29 Jul 2016 13:30:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 5A3111A5F for ; Fri, 29 Jul 2016 13:30:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u6TDUEIs022752 for ; Fri, 29 Jul 2016 13:30:14 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-standards@FreeBSD.org Subject: [Bug 211441] incorrect handling of TCPS_SYN_SENT and TCPS_SYN_RECEIVED in API tcp_usrclosed() in file tcp_usrreq.c Date: Fri, 29 Jul 2016 13:30:14 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: standards X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: prabhat@mtree.co.in X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-standards@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2016 13:30:14 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211441 Bug ID: 211441 Summary: incorrect handling of TCPS_SYN_SENT and TCPS_SYN_RECEIVED in API tcp_usrclosed() in file tcp_usrreq.c Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: standards Assignee: freebsd-standards@FreeBSD.org Reporter: prabhat@mtree.co.in Created attachment 173093 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D173093&action= =3Dedit tcp state diagram for quick reference 1) For TCPS_SYN_SENT: As per TCP state diagram, TCPS_SYN_SENT should switch to TCPS_CLOSED state = on appl:close call or timeout. In current code, at SYN_SENT state, a FIN messa= ge is initiated instead of call to tcp_close() to release PCB and TCP control block, which leads to incorrect states. To fix the issue, "case TCPS_SYN_SENT:" must be shifted with the case "case TCPS_LISTEN:". 2) For TCPS_SYN_RECEIVED: As per TCP state diagram, on appl:close call, if we are at TCPS_SYN_RECEIVED state then we just need to send FIN and switch to FIN_WAIT_1 state. In curr= ent code, we are not switching to TCPS_FIN_WAIT_1 state. To fix this issue, "break;" statement should be removed in the case "case TCPS_SYN_RECEIVED:" so that it falls through "case TCPS_ESTABLISHED:" where= we are changing state to TCPS_FIN_WAIT_1. Code fix: case TCPS_SYN_RECEIVED: tp->t_flags |=3D TF_NEEDFIN; //break; --=20 You are receiving this mail because: You are the assignee for the bug.=