]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix build if you have a crypto library.
authorGuy Harris <[email protected]>
Mon, 11 Dec 2017 10:53:24 +0000 (02:53 -0800)
committerGuy Harris <[email protected]>
Mon, 11 Dec 2017 10:53:24 +0000 (02:53 -0800)
print-tcp.c

index 67c15edddb677c7033c2a9bc5f81efc2bd990270..5af9e0a024d45dbc43584fa7b4a350bba993fd5a 100644 (file)
@@ -895,10 +895,10 @@ tcp_verify_signature(netdissect_options *ndo,
          * Step 2: Update MD5 hash with TCP header, excluding options.
          * The TCP checksum must be set to zero.
          */
-        savecsum = tp1.th_sum;
-        tp1.th_sum = 0;
+        memcpy(&savecsum, tp1.th_sum, sizeof(savecsum));
+        memset(tp1.th_sum, 0, sizeof(tp1.th_sum));
         MD5_Update(&ctx, (const char *)&tp1, sizeof(struct tcphdr));
-        tp1.th_sum = savecsum;
+        memcpy(tp1.th_sum, &savecsum, sizeof(tp1.th_sum));
         /*
          * Step 3: Update MD5 hash with TCP segment data, if present.
          */