Setting the mss for socket

Luiz Otavio O Souza lists.br at gmail.com
Thu Apr 2 19:44:19 PDT 2009


> Patrick Tracanelli wrote:
>> Luiz Otavio O Souza escreveu:
>>> Hello hackers,
>>>
>>> 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.
>>>
> you mean sysctl -w net.inet.tcp.mssdflt=512 ?

Not really... I don't want this to be a system wide option, i need this to 
be able to generate some traffic under a certain pattern of packet sizes.

I really should read the code for more than 30 minutes... it's simple than i 
first think, i already have a simple patch for this, but it is too ugly for 
anything more than get iperf running...

This is the patch (just for reference - may work for someone else): 
http://pastebin.com/m706da25b

And the iperf patch: http://pastebin.com/m2f8f1100

Luiz




More information about the freebsd-current mailing list