Date: Fri, 3 Apr 2009 08:25:08 -0300 From: "Luiz Otavio O Souza" <lists.br@gmail.com> To: <freebsd-hackers@freebsd.org> Subject: Re: Setting the mss for socket Message-ID: <64D5D9E633734200A603D067ED5A81E9@adnote989> References: <3FD46C21A487490FB15B89E890790121@adnote989> <49d5c0de.E5bkeKr%2Bp%2Bfg4K00%perryh@pluto.rain.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64D5D9E633734200A603D067ED5A81E9>