tcpdump mailing list archives

[Patch] print-dhcp6.c


From: Gisle Vanem <gvanem () broadpark no>
Date: Tue, 26 Mar 2013 14:08:14 +0100

This file doesn't compile using MSVC v16 (from VC-Express 2010)
because it has variable definitions after statements ('<< problem X' below). tcpdump should be in pure C, not C++ or gcc features. Right?

Patch:

--- Git-Latest\print-dhcp6.c    Thu Feb 28 16:10:44 2013
+++ print-dhcp6.c       Mon Mar 04 13:25:40 2013
@@ -335,6 +335,8 @@
       size_t optlen;
       u_int8_t auth_proto;
       u_int authinfolen, authrealmlen;
+       int remain_len;  /* Length of remaining options */
+       int label_len;   /* Label length */

       if (cp == ep)
               return;
@@ -723,10 +725,9 @@
                               break;
                       }
                       tp = (u_char *)(dh6o + 1);
-                       int remain_len = optlen;              << !! problem 1
+                       remain_len = optlen;
                       printf(" ");
                       /* Encoding is described in section 3.1 of RFC 1035 */
-                       int label_len; /* Label length */      << !! problem 2
                       while (remain_len && *tp) {
                               label_len =  *tp++;
                               if (label_len < remain_len - 1) {

-------------------

--gv
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Current thread: