[Click] [Patch] IPPrint tcp sequence fix

Harald Schiöberg harald at net.t-labs.tu-berlin.de
Wed Apr 9 04:19:22 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

IPPrint doesn't get the sequencenumber range of packets right.
(the tcp-offset-field starts counting at the tcp-header, not the packet
header)

Here is the fix:

diff --git a/elements/ip/ipprint.cc b/elements/ip/ipprint.cc
index 2185b96..a620847 100644
- --- a/elements/ip/ipprint.cc
+++ b/elements/ip/ipprint.cc
@@ -174,7 +174,7 @@ IPPrint::tcp_line(StringAccum &sa, const Packet *p,
int transport_le
        goto truncated_tcp;

     ip_len = ntohs(iph->ip_len);
- -    seqlen = ip_len - (tcph->th_off << 2);
+    seqlen = ip_len - sizeof(click_ip) - (tcph->th_off << 2);
     if (tcph->th_flags & TH_SYN)
        sa << 'S', seqlen++;
     if (tcph->th_flags & TH_FIN)




- --
Harald Schiöberg
Technische Universität Berlin | T-Laboratories | FG INET
www: http://www.net.t-labs.tu-berlin.de
Phone: +49-(0)30-8353-58476 | Fax: +49-(0)391 534 783 47
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/HwKJgyxs71kcx4RAkdiAJwK4ZmKbt7psZYUWfRvIWBHbGkULQCfWTot
pOoqjYgl/wFepC6SlVFJc+0=
=pOCd
-----END PGP SIGNATURE-----



More information about the click mailing list