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)
Sun, May 5, 11:46 PM
Unknown Object (File)
Mar 13 2024, 11:14 PM
Unknown Object (File)
Feb 13 2024, 11:20 PM
Unknown Object (File)
Feb 6 2024, 4:26 AM
Unknown Object (File)
Feb 4 2024, 10:10 PM
Unknown Object (File)
Dec 30 2023, 5:42 PM
Unknown Object (File)
Dec 20 2023, 3:15 AM
Unknown Object (File)
Dec 13 2023, 2:50 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.