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

Incorrect http re-assembly #10

Closed
kjk opened this Issue Aug 4, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@kjk
Copy link

kjk commented Aug 4, 2018

trace_indexes_from_client_go.pcap.zip

Attached is pcap file that is incorrectly re-assembled into http stream.

As seen in this screenshot, the body of DELETE request is not correct:

screen shot 2018-08-04 at 1 01 12 am

To make sure it's not a bad pcap file, I looked at packets using http://www.tastycocoabytes.com/cpa/.

This is how body of the request should look like:

screen shot 2018-08-04 at 1 03 45 am

I used netgraph -input-pcap trace_indexes_from_client_go.pcap

@kjk

This comment has been minimized.

Copy link

kjk commented Aug 4, 2018

I think https://github.com/ga0/netgraph/blob/master/ngnet/httpstream.go#L74 might be an issue.

It merely sends r for processing.

According to https://godoc.org/github.com/google/gopacket/tcpassembly#Stream, []Reassembly slice will be re-used, so probably should make a copy of r before sending.

@ga0

This comment has been minimized.

Copy link
Owner

ga0 commented Aug 4, 2018

Thank you for posting this issue!
I'll try to solve it.

@ga0 ga0 self-assigned this Aug 4, 2018

@ga0 ga0 added the bug label Aug 4, 2018

@ga0 ga0 closed this in 5e67cc2 Aug 4, 2018

@ga0

This comment has been minimized.

Copy link
Owner

ga0 commented Aug 4, 2018

I missed to copy data from buffer here, if you are interested.

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