Page MenuHomeFreeBSD

compat/linux: map TCP_USER_TIMEOUT sockopt into TCP_MAXUNACKTIME
ClosedPublic

Authored by sobomax on Mon, Mar 30, 5:26 PM.

Details

Summary

After reading both manual pages, our TCP_MAXUNACKTIME is fairly similar to the TCP_USER_TIMEOUT, the only considerable difference is ours is in seconds and linux's in milliseconds.

Round up linux's in setsockopt(2) and clamp ours to UINT_MAX.

Used nowadays by the tokio-runtime and sqlx-sqlite.

Test Plan

Run a linux app that uses this option.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Mon, Mar 30, 6:26 PM

The Linux socket option also bound the time user data remains un-transmitted. I guess this is not handled by the FreeBSD one.

OT: I have an item to look at TCP_QUICKACK like Nagle suggested as per my DevSummit workplan

The code placement is ad-hoc. We already have a case for IPPROTO_TCP in the main switch and the new option handling should go there. This will require some extension of linux_to_bsd_tcp_sockopt() but the result would be cleaner code.

This revision now requires review to proceed.Tue, Mar 31, 5:50 AM

The code placement is ad-hoc. We already have a case for IPPROTO_TCP in the main switch and the new option handling should go there. This will require some extension of linux_to_bsd_tcp_sockopt() but the result would be cleaner code.

Done.

This looks better, thanks! Let's give Randall a chance to review. He added this setsockopt() to FreeBSD.

This revision is now accepted and ready to land.Tue, Mar 31, 3:31 PM