]> The Tcpdump Group git mirrors - tcpdump/commitdiff
From Gisle Vanem: don't use GCC features such as the ability to declare
authorguy <guy>
Mon, 5 Dec 2005 21:48:10 +0000 (21:48 +0000)
committerguy <guy>
Mon, 5 Dec 2005 21:48:10 +0000 (21:48 +0000)
variables in the middle of the block., and #if out dccp_hdr_data()
(which is unused, and defined in such a fashion that it doesn't work on
MSVC++, with the structure name and the function name the same).

dccp.h
print-dccp.c

diff --git a/dccp.h b/dccp.h
index d3cb885cb7b83d959c16c0305621f030237c26be..23609338a6d1499dad706d890310e0ee2076987e 100644 (file)
--- a/dccp.h
+++ b/dccp.h
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/dccp.h,v 1.1.2.2 2005-09-20 06:25:45 guy Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/dccp.h,v 1.1.2.3 2005-12-05 21:48:10 guy Exp $ (LBL) */
 /*
  * Copyright (C) Arnaldo Carvalho de Melo 2004
  * Copyright (C) Ian McDonald 2005 <[email protected]>
@@ -86,12 +86,14 @@ struct dccp_hdr_response {
        u_int32_t                       dccph_resp_service;
 };
 
+#if 0
 static inline struct dccp_hdr_data *dccp_hdr_data(struct dccp_hdr *hdrg)
 {
        const int ext = DCCPH_X(hdrg) ? sizeof(struct dccp_hdr_ext) : 0;
 
        return (struct dccp_hdr_data *)(((u_char *)hdrg) + sizeof(hdrg) + ext);
 }
+#endif
 
 /**
  * struct dccp_hdr_reset - Unconditionally shut down a connection
index 5ad016460f6fb470f7b0242a67be7508ba96c147..9c0cee6f14bab019b6c7d6ca5ee8b723b8da936f 100644 (file)
@@ -9,7 +9,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-dccp.c,v 1.1.2.4 2005-12-05 21:46:37 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-dccp.c,v 1.1.2.5 2005-12-05 21:48:10 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -165,15 +165,19 @@ static void dccp_print_ack_no(const u_char *bp)
        const struct dccp_hdr *dh = (const struct dccp_hdr *)bp;
        const struct dccp_hdr_ack_bits *dh_ack =
                (struct dccp_hdr_ack_bits *)(bp + dccp_basic_hdr_len(dh));
+       u_int32_t ack_high;
+       u_int64_t ackno;
 
        TCHECK2(*dh_ack,4);
-       u_int32_t ack_high = DCCPH_ACK(dh_ack);
-       u_int64_t ackno = EXTRACT_24BITS(&ack_high) & 0xFFFFFF;
+       ack_high = DCCPH_ACK(dh_ack);
+       ackno = EXTRACT_24BITS(&ack_high) & 0xFFFFFF;
 
        if (DCCPH_X(dh) != 0) {
+               u_int32_t ack_low;
+
                TCHECK2(*dh_ack,8);
-               u_int32_t ack_low = dh_ack->dccph_ack_nr_low;
-               
+               ack_low = dh_ack->dccph_ack_nr_low;
+
                ackno &= 0x00FFFF;  /* clear reserved field */
                ackno = (ackno << 32) + EXTRACT_32BITS(&ack_low);
        }