]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix compilation with old versions of MSVC.
authorGisle Vanem <[email protected]>
Tue, 11 Mar 2014 20:21:30 +0000 (13:21 -0700)
committerGuy Harris <[email protected]>
Tue, 11 Mar 2014 20:21:30 +0000 (13:21 -0700)
Some old versions of MSVC have broken C preprocessors and failed to
handle #ifdef/#else/#endif in the middle of a macro call.  Just

print-ahcp.c

index 1d498735acb069d9a08f25eb26df58d326293551..00289008b7332fbbe852542ec2a9f5e2590c9d63 100644 (file)
@@ -150,13 +150,11 @@ ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha
                if (cp + 16 > ep)
                        goto corrupt;
                ND_TCHECK2(*cp, 16);
-               ND_PRINT((ndo, "%s%s", sep,
 #ifdef INET6
-                      ip6addr_string(cp)
+               ND_PRINT((ndo, "%s%s", sep, ip6addr_string(cp)));
 #else
-                      "(compiled w/o IPv6)"
+               ND_PRINT((ndo, "%s(compiled w/o IPv6)", sep));
 #endif /* INET6 */
-                      ));
                cp += 16;
                sep = ", ";
        }
@@ -202,13 +200,11 @@ ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
                if (cp + 17 > ep)
                        goto corrupt;
                ND_TCHECK2(*cp, 17);
-               ND_PRINT((ndo, "%s%s/%u", sep,
 #ifdef INET6
-                      ip6addr_string(cp),
+               ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(cp), *(cp + 16)));
 #else
-                      "(compiled w/o IPv6)",
+               ND_PRINT((ndo, "%s(compiled w/o IPv6)/%u", sep, *(cp + 16)));
 #endif /* INET6 */
-                      *(cp + 16)));
                cp += 17;
                sep = ", ";
        }