diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-03-18 16:58:15 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-03-18 23:58:54 +0000 |
commit | 096e5231ff41eb1b7c9c13fa1c6217fa78d73c6b (patch) | |
tree | 32c20cb47bb1c6320ac32431bfa0f2abb4807604 /ui/iface_lists.c | |
parent | 9762c32709b2d2ed6f8d99b89c550c60a546fad9 (diff) | |
download | wireshark-096e5231ff41eb1b7c9c13fa1c6217fa78d73c6b.tar.gz |
Fix parsing of interface properties strings.
The first entry in the list does not have a leading comma, so a strstr()
for ",{ifname}(" will not work. Instead, use g_strsplit() with a comma
for all of the preferences.
Have common code for all the "uncomplicated" preferences. Have a
specialized handler for the one "complicated" preference.
Change-Id: I2144a98ab0cb70db56eaaba88175d6e03885de2a
Reviewed-on: https://code.wireshark.org/review/7741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/iface_lists.c')
-rw-r--r-- | ui/iface_lists.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ui/iface_lists.c b/ui/iface_lists.c index a1f761adc9..1310c30a3f 100644 --- a/ui/iface_lists.c +++ b/ui/iface_lists.c @@ -292,13 +292,10 @@ scan_local_interfaces(void (*update_cb)(void)) if ((device.pmode = capture_dev_user_pmode_find(if_info->name)) == -1) { device.pmode = global_capture_opts.default_options.promisc_mode; } - if ((device.has_snaplen = capture_dev_user_hassnap_find(if_info->name)) == -1) { + if (!capture_dev_user_snaplen_find(if_info->name, &device.has_snaplen, + &device.snaplen)) { device.has_snaplen = global_capture_opts.default_options.has_snaplen; - } - if (capture_dev_user_snaplen_find(if_info->name) == -1) { device.snaplen = global_capture_opts.default_options.snaplen; - } else { - device.snaplen = (guint)capture_dev_user_snaplen_find(if_info->name); } device.cfilter = g_strdup(global_capture_opts.default_options.cfilter); #if defined(_WIN32) || defined(HAVE_PCAP_CREATE) |