Changeset 1734 for trunk/src/tcpreplay.c
- Timestamp:
- 03/20/07 22:20:18 (22 months ago)
- Files:
-
- 1 modified
-
trunk/src/tcpreplay.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tcpreplay.c
r1700 r1734 118 118 if (bytes_sent > 0) 119 119 packet_stats(&begin, &end, bytes_sent, pkts_sent, failed); 120 121 120 return 0; 122 121 } /* main() */ … … 131 130 pcap_t *pcap = NULL; 132 131 char ebuf[PCAP_ERRBUF_SIZE]; 132 int dlt; 133 133 134 134 #ifdef HAVE_TCPDUMP … … 150 150 errx(1, "Error opening pcap file: %s", ebuf); 151 151 152 #ifdef HAVE_PCAP_SNAPSHOT_OVERRIDE 153 /* libpcap >= 0.9.6 have this which handles broken RedHat libpcap files */ 154 pcap_snapshot_override(pcap, 65535); 155 #endif 156 157 dlt = sendpacket_get_dlt(options.intf1); 158 if ((dlt > 0) && (dlt != pcap_datalink(pcap))) 159 warnx("%s DLT does not match that of the outbound interface: %s", path, options.intf1->device); 160 152 161 send_packets(pcap); 153 162 pcap_close(pcap); … … 198 207 char *temp; 199 208 char ebuf[SENDPACKET_ERRBUF_SIZE]; 209 int int1dlt, int2dlt; 200 210 201 211 … … 252 262 errx(1, "Can't open %s: %s", options.intf1_name, ebuf); 253 263 264 int1dlt = sendpacket_get_dlt(options.intf1); 265 254 266 if (HAVE_OPT(INTF2)) { 255 267 options.intf2_name = (char *)safe_malloc(strlen(OPT_ARG(INTF2)) + 1); … … 259 271 if ((options.intf2 = sendpacket_open(options.intf2_name, ebuf)) == NULL) 260 272 errx(1, "Can't open %s: %s", options.intf2_name, ebuf); 273 274 int2dlt = sendpacket_get_dlt(options.intf2); 275 if (int2dlt != int1dlt) 276 errx(1, "DLT type missmatch for %s and %s", options.intf1_name, options.intf2_name); 261 277 } 262 278
