aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-09-22 09:42:57 +0000
committerGuy Harris <guy@alum.mit.edu>2004-09-22 09:42:57 +0000
commit01f8ed1c48c880e5b214ea6b4f261d315dfb4510 (patch)
tree74a82b06a80715d3bf3012700b1c4d8f24df9d65 /capture.c
parent8dedbeed1cd700846478d9de90e0d3b2e364d684 (diff)
If we have "pcap_datalink_val_to_name()", use it when we construct a
"-y" argument for the capture subprocess - the capture subprocess will expect a symbolic value, not a numeric value, if we have "pcap_datalink_name_to_val()". (We assume that if one is present the other will be present as well.) svn path=/trunk/; revision=12064
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/capture.c b/capture.c
index 4b6cf86e79..c93b234fb8 100644
--- a/capture.c
+++ b/capture.c
@@ -420,7 +420,12 @@ sync_pipe_do_capture(gboolean is_tempfile) {
if (capture_opts.linktype != -1) {
argv = sync_pipe_add_arg(argv, &argc, "-y");
+#ifdef HAVE_PCAP_DATALINK_VAL_TO_NAME
+ sprintf(ssnap,"%s",pcap_datalink_val_to_name(capture_opts.linktype));
+#else
+ /* XXX - just treat it as a number */
sprintf(ssnap,"%d",capture_opts.linktype);
+#endif
argv = sync_pipe_add_arg(argv, &argc, ssnap);
}