forked from osmocom/wireshark
Use valid channel parameters from wireless toolbar
Both the QT and GTK wireless toolbar used "-1" to indicate unused channel parameters. This was an undocumented feature that recently stopped working. Use the now documented way (NULL) to specify that some parameters are not used. Bug: 12896 Change-Id: I4a93a15ba1d880592b355b7eca155632a4b92ea0 Reviewed-on: https://code.wireshark.org/review/17700 Reviewed-by: Gilbert Ramirez <gram@alumni.rice.edu> Petri-Dish: Gilbert Ramirez <gram@alumni.rice.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
f674ef75d7
commit
8def685972
|
@ -170,7 +170,7 @@ tb80211_do_set_channel(char *iface, int freq, int type)
|
|||
|
||||
freq_s = g_strdup_printf("%d", freq);
|
||||
type_s = ws80211_chan_type_to_str(type);
|
||||
ret = sync_interface_set_80211_chan(iface, freq_s, type_s, "-1", "-1",
|
||||
ret = sync_interface_set_80211_chan(iface, freq_s, type_s, NULL, NULL,
|
||||
&data, &primary_msg, &secondary_msg, main_window_update);
|
||||
|
||||
/* Parse the error msg */
|
||||
|
|
|
@ -279,16 +279,22 @@ void WirelessFrame::setInterfaceInfo()
|
|||
int bandwidth = getBandwidthFromChanType(chan_type);
|
||||
int center_freq = getCenterFrequency(frequency, bandwidth);
|
||||
const gchar *chan_type_s = ws80211_chan_type_to_str(chan_type);
|
||||
gchar *center_freq_s = NULL;
|
||||
gchar *data, *primary_msg, *secondary_msg;
|
||||
int ret;
|
||||
|
||||
if (frequency < 0 || chan_type < 0) return;
|
||||
|
||||
if (center_freq != -1) {
|
||||
center_freq_s = g_strdup(QString::number(center_freq).toUtf8().constData());
|
||||
}
|
||||
|
||||
ret = sync_interface_set_80211_chan(cur_iface.toUtf8().constData(),
|
||||
QString::number(frequency).toUtf8().constData(), chan_type_s,
|
||||
QString::number(center_freq).toUtf8().constData(), "-1",
|
||||
center_freq_s, NULL,
|
||||
&data, &primary_msg, &secondary_msg, main_window_update);
|
||||
|
||||
g_free(center_freq_s);
|
||||
g_free(data);
|
||||
g_free(primary_msg);
|
||||
g_free(secondary_msg);
|
||||
|
|
Loading…
Reference in New Issue