Page MenuHomeFreeBSD

tcp: improve sending of SYN-cookies
ClosedPublic

Authored by tuexen on Thu, Aug 28, 7:28 PM.
Tags
None
Referenced Files
F127722633: D52225.diff
Wed, Sep 3, 9:59 PM
F127714451: D52225.id161148.diff
Wed, Sep 3, 8:26 PM
F127631903: D52225.id161264.diff
Wed, Sep 3, 12:33 AM
Unknown Object (File)
Sat, Aug 30, 9:09 PM
Unknown Object (File)
Sat, Aug 30, 6:42 PM
Unknown Object (File)
Sat, Aug 30, 4:49 AM
Unknown Object (File)
Sat, Aug 30, 2:37 AM
Unknown Object (File)
Sat, Aug 30, 1:02 AM
Subscribers

Details

Summary

Ensure that when the sysctl-variable net.inet.tcp.syncookies_only is non zero, SYN-cookies are sent and no SYN-cache entry is added to the SYN-cache. In particular, this behavior should not depend on the value of the sysctl-variable net.inet.tcp.syncookies, which controls whether SYN cookies are used in combination with the SYN-cache to deal with bucket overflows.
Also ensure that tcps_sc_completed does not include TCP connections established via a SYN-cookie.
While there, make V_tcp_syncookies and V_tcp_syncookiesonly bool instead of int, since they are used as boolean variables.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

tuexen edited the summary of this revision. (Show Details)
tuexen added a reviewer: jtl.
tuexen edited the summary of this revision. (Show Details)

Make V_tcp_syncookies and V_tcp_syncookiesonly bool instead of int, since they are used as boolean variables.

This revision is now accepted and ready to land.Thu, Aug 28, 10:20 PM

Maybe also put an updated syncookies(4) man page update into this diff. Currently, that man page is not really clear on the distinctions between sysctl net.inet.tcp.syncookies and sysctl net.inet.tcp.syncookies_only. (the _only is mentioned, but not the relationship between syncache, syncookie and syncookie_only ).

Maybe also put an updated syncookies(4) man page update into this diff. Currently, that man page is not really clear on the distinctions between sysctl net.inet.tcp.syncookies and sysctl net.inet.tcp.syncookies_only. (the _only is mentioned, but not the relationship between syncache, syncookie and syncookie_only ).

Is D52226 good enough or do you have suggestions to improve the clarity?

Is D52226 good enough or do you have suggestions to improve the clarity?

Ah, good. I think that is good enough; no need to specifically mention that syncookies_only is no longer dependent on syncookies to function.

Looks good to me. I only have two minor suggestions.

sys/netinet/tcp_syncache.c
556–557

Makes more sense, as if V_tcp_syncookiesonly == true, the value of V_tcp_syncookies does not bother.

1092

I would add syncache only case: in the comment for readability and convenience.

1108

I would add syncache && syncookie case: in the comment for readability and convenience.

This revision was automatically updated to reflect the committed changes.