From fcb6fd3b6fcc6b3ed56cbd81c419b28920f2ec70 Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Mon, 5 Sep 2016 15:45:21 +0200 Subject: dumpcap: change types. Change-Id: I6520971e607623dadcb3ae392ce264bf49c621bd Reviewed-on: https://code.wireshark.org/review/17499 Petri-Dish: Dario Lombardo Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- caputils/ws80211_utils.c | 4 ++-- caputils/ws80211_utils.h | 2 +- dumpcap.c | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/caputils/ws80211_utils.c b/caputils/ws80211_utils.c index 4f9a6927b6..7e63105ecf 100644 --- a/caputils/ws80211_utils.c +++ b/caputils/ws80211_utils.c @@ -769,7 +769,7 @@ nla_put_failure: } DIAG_ON_CLANG(shorten-64-to-32) -int ws80211_set_freq(const char *name, int freq, int chan_type, int _U_ center_freq, int _U_ center_freq2) +int ws80211_set_freq(const char *name, guint32 freq, int chan_type, guint32 _U_ center_freq, guint32 _U_ center_freq2) { int devidx, err; struct nl_msg *msg; @@ -1063,7 +1063,7 @@ int ws80211_get_iface_info(const char *name, struct ws80211_iface_info *iface_in return 0; } -int ws80211_set_freq(const char *name, int freq, int chan_type, int _U_ center_freq, int _U_ center_freq2) +int ws80211_set_freq(const char *name, guint32 freq, int chan_type, guint32 _U_ center_freq, guint32 _U_ center_freq2) { GList *airpcap_if_list; int err; diff --git a/caputils/ws80211_utils.h b/caputils/ws80211_utils.h index 3f58576758..247dfe2050 100644 --- a/caputils/ws80211_utils.h +++ b/caputils/ws80211_utils.h @@ -104,7 +104,7 @@ void ws80211_free_interfaces(GArray *interfaces); * @param center_freq2 The 2nd center frequency in MHz (if 80+80MHz). * @return Zero on success, nonzero on failure. */ -int ws80211_set_freq(const char *name, int freq, int chan_type, int _U_ center_freq, int _U_ center_freq2); +int ws80211_set_freq(const char *name, guint32 freq, int chan_type, guint32 _U_ center_freq, guint32 _U_ center_freq2); int ws80211_str_to_chan_type(const gchar *s); /* GTK+ only? */ const gchar *ws80211_chan_type_to_str(int type); /* GTK+ only? */ diff --git a/dumpcap.c b/dumpcap.c index 591bea19f8..00bd079411 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -56,6 +56,7 @@ #include #include +#include #include #ifndef HAVE_GETOPT_LONG @@ -3676,12 +3677,12 @@ capture_loop_queue_packet_cb(u_char *pcap_opts_p, const struct pcap_pkthdr *phdr static int set_80211_channel(const char *iface, const char *opt) { - int freq = 0; + guint32 freq = 0; int type = -1; - int center_freq1 = -1; - int center_freq2 = -1; + guint32 center_freq1 = 0; + guint32 center_freq2 = 0; int args; - int ret; + int ret = 0; gchar **options = NULL; options = g_strsplit_set(opt, ",", 4); @@ -3721,7 +3722,6 @@ set_80211_channel(const char *iface, const char *opt) if (capture_child) pipe_write_block(2, SP_SUCCESS, NULL); - ret = 0; out: g_strfreev(options); -- cgit v1.2.1