aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-11-01 07:38:54 +0000
committerGuy Harris <guy@alum.mit.edu>2000-11-01 07:38:54 +0000
commite023b751c0f93065ef32ec372275b2b6d0190ef7 (patch)
tree0dad65681f6a35aad832fbb12ce7ab141f64c492 /capture.c
parentb2929352b655990162018e8f73e8983baf03694c (diff)
Instead of failing if we can't find a netmask for the interface on which
we're capturing, just use a netmask of 0, and warn the user in Tethereal (doing it in Ethereal would be more disruptive, and doing so only once per interface in a session is a bit of work, as, in an "Update list of packets in real time" capture the child process would have to tell the parent that it couldn't get the netmask). svn path=/trunk/; revision=2546
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/capture.c b/capture.c
index 09302848dd..847dd8d208 100644
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.130 2000/10/21 04:20:07 guy Exp $
+ * $Id: capture.c,v 1.131 2000/11/01 07:38:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1179,9 +1179,16 @@ capture(void)
if (cfile.cfilter && !ld.from_pipe) {
/* A capture filter was specified; set it up. */
if (pcap_lookupnet (cfile.iface, &netnum, &netmask, err_str) < 0) {
- snprintf(errmsg, sizeof errmsg,
- "Can't use filter: Couldn't obtain netmask info (%s).", err_str);
- goto error;
+ /*
+ * Well, we can't get the netmask for this interface; it's used
+ * only for filters that check for broadcast IP addresses, so
+ * we just punt and use 0. It might be nice to warn the user,
+ * but that's a pain in a GUI application, as it'd involve popping
+ * up a message box, and it's not clear how often this would make
+ * a difference (only filters that check for IP broadcast addresses
+ * use the netmask).
+ */
+ netmask = 0;
}
if (pcap_compile(pch, &cfile.fcode, cfile.cfilter, 1, netmask) < 0) {
snprintf(errmsg, sizeof errmsg, "Unable to parse filter string (%s).",