Make handling of inconsistent transport layer parameters more consistent.
authortuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 18 Dec 2012 22:29:44 +0000 (22:29 +0000)
committertuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 18 Dec 2012 22:29:44 +0000 (22:29 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@46599 f5534014-38df-0310-8fa8-9805f1628bb7

text2pcap.c

index 26b52ef0c39193921d955def770bd7033fffb24a..04f89a5b0176f67235cf50e174d34904fb916e27 100644 (file)
@@ -1283,7 +1283,10 @@ parse_options (int argc, char *argv[])
             break;
 
         case 's':
-            hdr_sctp       = TRUE;
+            hdr_sctp = TRUE;
+            hdr_data_chunk = FALSE;
+            hdr_tcp = FALSE;
+            hdr_udp = FALSE;
             hdr_sctp_src   = strtol(optarg, &p, 10);
             if (p == optarg || (*p != ',' && *p != '\0')) {
                 fprintf(stderr, "Bad src port for '-%c'\n", c);
@@ -1318,8 +1321,10 @@ parse_options (int argc, char *argv[])
             hdr_ethernet_proto = 0x800;
             break;
         case 'S':
-            hdr_sctp       = TRUE;
+            hdr_sctp = TRUE;
             hdr_data_chunk = TRUE;
+            hdr_tcp = FALSE;
+            hdr_udp = FALSE;
             hdr_sctp_src   = strtol(optarg, &p, 10);
             if (p == optarg || (*p != ',' && *p != '\0')) {
                 fprintf(stderr, "Bad src port for '-%c'\n", c);
@@ -1361,6 +1366,8 @@ parse_options (int argc, char *argv[])
         case 'u':
             hdr_udp = TRUE;
             hdr_tcp = FALSE;
+            hdr_sctp = FALSE;
+            hdr_data_chunk = FALSE;
             hdr_src_port = strtol(optarg, &p, 10);
             if (p == optarg || (*p != ',' && *p != '\0')) {
                 fprintf(stderr, "Bad src port for '-u'\n");
@@ -1386,6 +1393,8 @@ parse_options (int argc, char *argv[])
         case 'T':
             hdr_tcp = TRUE;
             hdr_udp = FALSE;
+            hdr_sctp = FALSE;
+            hdr_data_chunk = FALSE;
             hdr_src_port = strtol(optarg, &p, 10);
             if (p == optarg || (*p != ',' && *p != '\0')) {
                 fprintf(stderr, "Bad src port for '-T'\n");