Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP options parsing doesn't support an option appearing more than once #189

Open
irl opened this issue Jan 9, 2018 · 2 comments
Open

TCP options parsing doesn't support an option appearing more than once #189

irl opened this issue Jan 9, 2018 · 2 comments

Comments

@irl
Copy link
Member

irl commented Jan 9, 2018

If the TCP options parser sees the same option multiple times, the last one will win. This is not a problem for TFO as specified, but it may be for future things we want to observe with the same options parser (e.g. MPTCP, TCPENO).

# copy options data into hash
# FIXME doesn't handle multiples
opthash[optbytes[cp]] = optbytes[cp+2:ncp]
@britram
Copy link
Contributor

britram commented Jan 9, 2018

"multiples" here means "a TCP option that appears multiple times" -- if this parser sees the same option multiple times, the last one will win. This is not a problem for TFO as specified, but it may be for future things we want to observe with the same options parser (e.g. MPTCP, TCPENO).

@irl irl changed the title TCP options parsing doesn't "handle multiples" TCP options parsing doesn't support an option appearing more than once Jan 9, 2018
@irl
Copy link
Member Author

irl commented Jan 15, 2018

Ok, now I've read the code I understand this a lot better. The option number is used as a hash index which then means that there can only be one. Instead, the option number can be used as a hash index for an array which contains the contents as long as this doesn't cause a massive decrease in performance. If it does, we can selectively do that for options that we think would have multiples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants