Mon Jan 30 13:15:43 2017 UTC ()
protect variable with the macro that uses it.


(christos)
diff -r1.13 -r1.14 src/external/bsd/tcpdump/dist/tcpdump.c

cvs diff -r1.13 -r1.14 src/external/bsd/tcpdump/dist/tcpdump.c (expand / switch to unified diff)

--- src/external/bsd/tcpdump/dist/tcpdump.c 2017/01/24 23:29:14 1.13
+++ src/external/bsd/tcpdump/dist/tcpdump.c 2017/01/30 13:15:43 1.14
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * 20 *
21 * Support for splitting captures into multiple files with a maximum 21 * Support for splitting captures into multiple files with a maximum
22 * file size: 22 * file size:
23 * 23 *
24 * Copyright (c) 2001 24 * Copyright (c) 2001
25 * Seth Webster <swebster@sst.ll.mit.edu> 25 * Seth Webster <swebster@sst.ll.mit.edu>
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29#ifndef lint 29#ifndef lint
30static const char copyright[] _U_ = 30static const char copyright[] _U_ =
31 "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\ 31 "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
32The Regents of the University of California. All rights reserved.\n"; 32The Regents of the University of California. All rights reserved.\n";
33__RCSID("$NetBSD: tcpdump.c,v 1.13 2017/01/24 23:29:14 christos Exp $"); 33__RCSID("$NetBSD: tcpdump.c,v 1.14 2017/01/30 13:15:43 christos Exp $");
34#endif 34#endif
35 35
36/* 36/*
37 * tcpdump - dump traffic on a network 37 * tcpdump - dump traffic on a network
38 * 38 *
39 * First written in 1987 by Van Jacobson, Lawrence Berkeley Laboratory. 39 * First written in 1987 by Van Jacobson, Lawrence Berkeley Laboratory.
40 * Mercilessly hacked and occasionally improved since then via the 40 * Mercilessly hacked and occasionally improved since then via the
41 * combined efforts of Van, Steve McCanne and Craig Leres of LBL. 41 * combined efforts of Van, Steve McCanne and Craig Leres of LBL.
42 */ 42 */
43 43
44#ifdef HAVE_CONFIG_H 44#ifdef HAVE_CONFIG_H
45#include "config.h" 45#include "config.h"
46#endif 46#endif
@@ -185,36 +185,38 @@ RETSIGTYPE requestinfo(int); @@ -185,36 +185,38 @@ RETSIGTYPE requestinfo(int);
185#endif 185#endif
186 186
187#if defined(USE_WIN32_MM_TIMER) 187#if defined(USE_WIN32_MM_TIMER)
188 #include <MMsystem.h> 188 #include <MMsystem.h>
189 static UINT timer_id; 189 static UINT timer_id;
190 static void CALLBACK verbose_stats_dump(UINT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR); 190 static void CALLBACK verbose_stats_dump(UINT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR);
191#elif defined(HAVE_ALARM) 191#elif defined(HAVE_ALARM)
192 static void verbose_stats_dump(int sig); 192 static void verbose_stats_dump(int sig);
193#endif 193#endif
194 194
195static void info(int); 195static void info(int);
196static u_int packets_captured; 196static u_int packets_captured;
197 197
 198#ifdef HAVE_PCAP_FINDALLDEVS
198static const struct tok status_flags[] = { 199static const struct tok status_flags[] = {
199#ifdef PCAP_IF_UP 200#ifdef PCAP_IF_UP
200 { PCAP_IF_UP, "Up" }, 201 { PCAP_IF_UP, "Up" },
201#endif 202#endif
202#ifdef PCAP_IF_RUNNING 203#ifdef PCAP_IF_RUNNING
203 { PCAP_IF_RUNNING, "Running" }, 204 { PCAP_IF_RUNNING, "Running" },
204#endif 205#endif
205 { PCAP_IF_LOOPBACK, "Loopback" }, 206 { PCAP_IF_LOOPBACK, "Loopback" },
206 { 0, NULL } 207 { 0, NULL }
207}; 208};
 209#endif
208 210
209static pcap_t *pd; 211static pcap_t *pd;
210 212
211static int supports_monitor_mode; 213static int supports_monitor_mode;
212 214
213extern int optind; 215extern int optind;
214extern int opterr; 216extern int opterr;
215extern char *optarg; 217extern char *optarg;
216 218
217struct dump_info { 219struct dump_info {
218 char *WFileName; 220 char *WFileName;
219 char *CurrentFileName; 221 char *CurrentFileName;
220 pcap_t *pd; 222 pcap_t *pd;