mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-08 15:00:35 +01:00
wimax: fix dbus-glib assert when wimax strength overflows
Ran into a case right underneath a tower where the Intel WiMAX SDK reported signal strength as 32767 which is pretty clearly an overflow of a 16-bit int somewhere in the WiMAX stack. Since our internal NMWimaxNsp GObject property for signal-quality has a max value of 100, dbus-glib got pretty angry when GObject failed to return something because the property value was out of range, leading to malformed message and the bus daemon kicking us off, and finally an assertion somewhere. Fun.
This commit is contained in:
parent
16948ce927
commit
0e348bad2a
2 changed files with 2 additions and 2 deletions
|
|
@ -1075,7 +1075,7 @@ wmx_scan_result_cb (struct wmxsdk *wmxsdk,
|
|||
if (net_type != nm_wimax_nsp_get_network_type (nsp))
|
||||
g_object_set (nsp, NM_WIMAX_NSP_NETWORK_TYPE, net_type, NULL);
|
||||
|
||||
signalq = sdk_nsp->linkQuality;
|
||||
signalq = CLAMP (sdk_nsp->linkQuality, 0, 100);
|
||||
if (signalq != nm_wimax_nsp_get_signal_quality (nsp))
|
||||
g_object_set (nsp, NM_WIMAX_NSP_SIGNAL_QUALITY, signalq, NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ set_property (GObject *object, guint prop_id,
|
|||
case PROP_SIGNAL_QUALITY:
|
||||
quality = g_value_get_uint (value);
|
||||
if (quality != priv->signal_quality) {
|
||||
priv->signal_quality = quality;
|
||||
priv->signal_quality = CLAMP (quality, 0, 100);
|
||||
g_object_notify (object, NM_WIMAX_NSP_SIGNAL_QUALITY);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue