Page MenuHomeFreeBSD

Fix handling of TTL/Hop Limit and TOS/Traffic Class in the TCP SYN Cache
ClosedPublic

Authored by tuexen on Fri, Jul 31, 10:03 PM.

Details

Summary

This patch fixes the following issues:

  • Let the accepted TCP/IPv4 socket inherit the configured TTL and TOS value.
  • Let the accepted TCP/IPv6 socket inherit the configured Hop Limit.
  • Use the configured Hop Limit and Traffic Class when sending IPv6 packets.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tuexen created this revision.Fri, Jul 31, 10:03 PM
tuexen requested review of this revision.Fri, Jul 31, 10:03 PM
lutz_donnerhacke.de added inline comments.
sys/netinet/tcp_syncache.c
1392 ↗(On Diff #75234)

May this check for IPv6 become a single test, which covers the tests below?
This would improve the reading of the whole construct.

1395–1396 ↗(On Diff #75234)

A bit superfluous. isn't it?

1406–1407 ↗(On Diff #75234)

This could be a single #ifdef INET (in the #ifdef INET6 scope)

tuexen added inline comments.Sat, Aug 1, 9:53 PM
sys/netinet/tcp_syncache.c
1406–1407 ↗(On Diff #75234)

I'm using the pattern also used at tcp_syncache.c:1849 for consistency within the same file.

tuexen updated this revision to Diff 75258.Sat, Aug 1, 10:05 PM

Simplify code as suggested by Lutz.

tuexen added inline comments.Sat, Aug 1, 10:06 PM
sys/netinet/tcp_syncache.c
1392 ↗(On Diff #75234)

Done in latest revision.

1395–1396 ↗(On Diff #75234)

Should also be fixed by the latest revision.

rrs accepted this revision.Mon, Aug 10, 6:34 PM
This revision is now accepted and ready to land.Mon, Aug 10, 6:34 PM
This revision was automatically updated to reflect the committed changes.