Page MenuHomeFreeBSD

fix tcp:kernel::debug-input trace: the given tcphdr (args[1]) is already partially in host order (namely seq, ack, window size, urgent pointer)
ClosedPublic

Authored by hannes_mehnert.org on Oct 12 2017, 5:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 11:57 AM
Unknown Object (File)
Tue, Nov 12, 2:18 AM
Unknown Object (File)
Thu, Oct 31, 2:44 PM
Unknown Object (File)
Oct 14 2024, 1:05 PM
Unknown Object (File)
Oct 3 2024, 9:08 AM
Unknown Object (File)
Oct 2 2024, 2:28 PM
Unknown Object (File)
Oct 2 2024, 3:39 AM
Unknown Object (File)
Oct 2 2024, 2:40 AM
Subscribers

Details

Summary

tcp.d provides both tcpinfo_t and tcpinfoh_t - where the former is for tcphdr structs in network order, and the latter for tcphdr which are partially in host order.
now, debug__input is used in tcp_input and tcp_do_segment, but only after tcp_fields_to_host(th) (in line 766) was called.

Sponsored by: REMS (rems.io)

Test Plan

start a tcpdump (to see the sequence number of a session) and run the following D program at the same time:

tcp:kernel::debug-input {
    printf("seq %u\n", args[1]->tcp_seq);
}

before this patch (on a little endian machine), you'll see the wrong sequence number. after, it is the one you expected (and the same as in tcpdump)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

hannes_mehnert.org retitled this revision from fix tcp:kernel::debug-input trace: the given tcphdr (args[1]) is already partially in host order (namely seq, ack, window size) to fix tcp:kernel::debug-input trace: the given tcphdr (args[1]) is already partially in host order (namely seq, ack, window size, urgent pointer).Oct 12 2017, 6:04 PM

debug__drop as well uses a partially host-order converted tcphdr

after checking, same applies to debug__drop (only used in tcp_stacks/fastpath.c). debug__output is fine as is

Thanks, this seems right to me.

This revision is now accepted and ready to land.Jan 25 2018, 3:05 PM
This revision was automatically updated to reflect the committed changes.