From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 3 11:25:35 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5ECB106564A for ; Fri, 3 Apr 2009 11:25:35 +0000 (UTC) (envelope-from lists.br@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29]) by mx1.freebsd.org (Postfix) with ESMTP id 797788FC14 for ; Fri, 3 Apr 2009 11:25:35 +0000 (UTC) (envelope-from lists.br@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so632427yxm.13 for ; Fri, 03 Apr 2009 04:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:references :subject:date:mime-version:content-type:content-transfer-encoding :x-priority:x-msmail-priority:x-mailer:x-mimeole; bh=gWavkZIQIDZWVJsIUYNOqwG3CcEx5bY0GOi09/4g9co=; b=GQmvGtJEeD2SsQMZumwjVOk+ZlT6KLdBb/D+1SgNBBV7vnC8zC+YOkTUS4OiPbg01/ /i3qAOWohvdImhpdjAcUXtnMmOcM5G+LJo3QiF4vj2EMIUN9gHkkghCk8a+5+Sx9+HyI xAStkta8SzbyOtftmMGnhysGUMeNBajGCcNw4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:references:subject:date:mime-version :content-type:content-transfer-encoding:x-priority:x-msmail-priority :x-mailer:x-mimeole; b=bcmv9QhJNfjrveSX8qvPsv4eYS6mNeAFnVtbTLRv00cBVTTW8ojB4MfuuWl1hbYV5D DYxIOcCqC/d7C+nzPNeTwwOKSZtKtv7cMRv5SrD5O8J862PULP0X/FnKa9XdozAqn5EK YaMvPaefea4vOCgd/dcC+EzpECTsHb76tjLj8= Received: by 10.90.113.11 with SMTP id l11mr692138agc.2.1238757934997; Fri, 03 Apr 2009 04:25:34 -0700 (PDT) Received: from adnote989 (201-42-156-231.dsl.telesp.net.br [201.42.156.231]) by mx.google.com with ESMTPS id 32sm2954330aga.4.2009.04.03.04.25.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Apr 2009 04:25:34 -0700 (PDT) Message-ID: <64D5D9E633734200A603D067ED5A81E9@adnote989> From: "Luiz Otavio O Souza" To: References: <3FD46C21A487490FB15B89E890790121@adnote989> <49d5c0de.E5bkeKr+p+fg4K00%perryh@pluto.rain.com> Date: Fri, 3 Apr 2009 08:25:08 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Mailman-Approved-At: Fri, 03 Apr 2009 11:26:07 +0000 Subject: Re: Setting the mss for socket X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 11:25:36 -0000 >> Is there a way to set the mss for a socket ? Like you can do >> in linux with setsockopt(TCP_MAXSEG) ? >> >> So i can set the maximum size of packets (or sort of) from a >> simple userland program. > > Depending on exactly what you need to accomplish, you may > find something useful in this thread from last August in > freebsd-questions@ > > setting the other end's TCP segment size Very informative thread, thanks. This thread show me that TCP_MAXSEG is implemented in freebsd but don't work. You can set the setsockopt(IPPROTO_TCP, TCP_MAXSEG), wich will set the tp->t_maxseg, but this value is recalculated at tcp_input, so in short, you cannot set the max segment size for a socket. I've posted a completly wrong patch (from style point-of-view - and using SOL_SOCKET instead of IPPROTO_TCP), but with that patch i'm able to set the mss in iperf. Many thanks, Luiz