pathspider icon indicating copy to clipboard operation
pathspider copied to clipboard

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

Open irl opened this issue 7 years ago • 2 comments

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]

irl avatar Jan 09 '18 00:01 irl

"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).

britram avatar Jan 09 '18 10:01 britram

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.

irl avatar Jan 15 '18 22:01 irl