From owner-freebsd-current@freebsd.org Mon Dec 28 08:25:38 2015 Return-Path: Delivered-To: freebsd-current@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 EE746A5262C for ; Mon, 28 Dec 2015 08:25:37 +0000 (UTC) (envelope-from samkumar99@gmail.com) Received: from mail-yk0-x236.google.com (mail-yk0-x236.google.com [IPv6:2607:f8b0:4002:c07::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5F011CCC for ; Mon, 28 Dec 2015 08:25:37 +0000 (UTC) (envelope-from samkumar99@gmail.com) Received: by mail-yk0-x236.google.com with SMTP id k129so75709759yke.0 for ; Mon, 28 Dec 2015 00:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=AfpHnR6pVcESaxAfE8cAoHJa8srKDGA/K4AKAw8U6KE=; b=o9RWbvV0fE3LaLgwUshXOs8dVcRq9JpKzv5r+2nUxY0p+McMGhzMxT8/yGT/FCkyd3 vdqgBEMRGSHgzNlOuQ7UZR8jAQ08pDJ0wBD5J3oI0aozqhoUZvYsDXD++CQCCsG6/Rox xLxPsUqnLOSYD6ZvubHBy1KinSdLWf9zYz2TtWHXkPZU/7rrOF+EgBIPIF1bH1I9ImV9 qyleCYuwxmxS82l38D8nbnYWB4C26vTwR5KPHe/quWsvXUDCY+fwKhQzLJLk8YNr7Wix G3Mg+hKYXNiI7YrwC5wNzRqaHkkDU9B0D+Vpc9ev8Nb1xmPOihUGUv9DMd51NrrEQ2a2 6Rrg== X-Received: by 10.129.108.88 with SMTP id h85mr45144104ywc.156.1451291136819; Mon, 28 Dec 2015 00:25:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.32.7 with HTTP; Mon, 28 Dec 2015 00:25:17 -0800 (PST) From: Sam Kumar Date: Mon, 28 Dec 2015 00:25:17 -0800 Message-ID: Subject: TCP Stack: Challenge ACKs and Timestamps To: freebsd-current@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2015 08:25:38 -0000 Hello, I am working with the code for the TCP Stack. I noticed that support for Challenge Acks have been added since the latest release (10.2.0), and I think I may have found a bug in how they relate to TCP timestamps. All line numbers below are those in commit e66e064c45687b5d294565dbd829b419848f7992. Looking at tcp_input.c, at lines 1594 to 1604, I see code that expects a timestamp to be in every segment during the session, if they were negotiated when the connection was being established. ( https://github.com/freebsd/freebsd/blob/master/sys/netinet/tcp_input.c#L1595 ) Looking at tcp_input.c, at lines 2161 and 2188, I see that Challenge ACKs are sent via calls to tcp_respond(). ( https://github.com/freebsd/freebsd/blob/master/sys/netinet/tcp_input.c#L2161 and https://github.com/freebsd/freebsd/blob/master/sys/netinet/tcp_input.c#L2188 ) Looking at tcp_subr.c, at line 978, I see that the segment sent by tcp_respond() never contains TCP options. (https://github.com/freebsd/freebsd/blob/master/sys/netinet/tcp_subr.c#L978) Therefore, it seems to me that Challenge ACKs will never contain any TCP options. This violates the condition that once timestamps are negotiated, they must be present in every segment. Please let me know if I am mistaken, or if this is actually a bug. Sam Kumar