tcptrace BUG: ns.c doesn't correctly read ack and seqnr in 18 values of F ullTCP

From: R.Schramp@kpn.com
Date: 08/09/02

  • Next message: jackson ttetan: "tcptrace examples"

    Message-ID: <59063B5B4D98D311BC0D0001FA7E452209CA8829@l04.research.kpn.com>
    From: R.Schramp@kpn.com
    Subject: tcptrace BUG: ns.c  doesn't correctly read ack and seqnr in 18 values of F ullTCP
    Date: Fri, 9 Aug 2002 09:14:30 +0200 
    
    

    Hello All,

    I think the "ns" reading code contains a small bug: Reading the FullTCP data
    lines only the ack seqnr or the seqnr are filled in but never both.
    I think as both elements are available in the trace file they should be
    filled in as well. (At least correcting the code gave me better results in
    tcp-trace)

    Best regards,

    Ruud Schramp

    FAULTY CODE:

    int pread_ns_fulltcp(
        struct timeval *ptime,
        int *plen,
        int *ptlen,
        void **pphys,
        int *pphystype,
        struct ip **ppip,
        void **pplast)
    {
    ......
            if (is_tcp && (*plen > hdrlen)) { /*for empty tcp packets acting as
    acks*/
                tcpb->th_seq = htonl(seqno);
                tcpb->th_ack = 0;
            } else {
                tcpb->th_seq = 0;
                tcpb->th_ack = htonl(ackno);
            }
    ......
    }

    Corrected CODE:

    int pread_ns_fulltcp(
        struct timeval *ptime,
        int *plen,
        int *ptlen,
        void **pphys,
        int *pphystype,
        struct ip **ppip,
        void **pplast)
    {
    ......
            if (is_tcp && (*plen > hdrlen)) { /*for empty tcp packets acting as
    acks*/
                tcpb->th_seq = htonl(seqno);
                tcpb->th_ack = htonl(ackno);
            } else {
                tcpb->th_seq = htonl(seqno);
                tcpb->th_ack = htonl(ackno);
            }
    ......
    }

    or perhaps even better code

    int pread_ns_fulltcp(
        struct timeval *ptime,
        int *plen,
        int *ptlen,
        void **pphys,
        int *pphystype,
        struct ip **ppip,
        void **pplast)
    {
    ......
              tcpb->th_seq = htonl(seqno);
              tcpb->th_ack = htonl(ackno);
    ......
    }

    ----------------------------------------------------------------------------
    To unsubscribe, send a message with body containing "unsubscribe tcptrace" to
    majordomo@tcptrace.org.



    This archive was generated by hypermail 2b30 : 08/09/02 EDT