Commit 25aa0a07 authored by Thomas Haller's avatar Thomas Haller
Browse files

libnm-core: fix crash in NMSettingAdsl:verify()


Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
parent 645ab39b
......@@ -225,20 +225,22 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
if (strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA) &&
strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE) &&
strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_IPOATM)) {
if ( !priv->protocol
|| ( strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA)
&& strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE)
&& strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_IPOATM))){
g_set_error (error,
NM_SETTING_ADSL_ERROR,
NM_SETTING_ADSL_ERROR_INVALID_PROPERTY,
_("'%s' is not a valid value for the property"),
priv->protocol);
priv->protocol ? priv->protocol : "(null)");
g_prefix_error (error, "%s.%s: ", NM_SETTING_ADSL_SETTING_NAME, NM_SETTING_ADSL_PROTOCOL);
return FALSE;
}
if (strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_VCMUX) &&
strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_LLC) ) {
if ( priv->encapsulation
&& ( strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_VCMUX)
&& strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_LLC) )) {
g_set_error (error,
NM_SETTING_ADSL_ERROR,
NM_SETTING_ADSL_ERROR_INVALID_PROPERTY,
......
......@@ -226,20 +226,22 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
if (strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA) &&
strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE) &&
strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_IPOATM)) {
if ( !priv->protocol
|| ( strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA)
&& strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE)
&& strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_IPOATM))){
g_set_error (error,
NM_SETTING_ADSL_ERROR,
NM_SETTING_ADSL_ERROR_INVALID_PROPERTY,
_("'%s' is not a valid value for the property"),
priv->protocol);
priv->protocol ? priv->protocol : "(null)");
g_prefix_error (error, "%s.%s: ", NM_SETTING_ADSL_SETTING_NAME, NM_SETTING_ADSL_PROTOCOL);
return FALSE;
}
if (strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_VCMUX) &&
strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_LLC) ) {
if ( priv->encapsulation
&& ( strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_VCMUX)
&& strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_LLC) )) {
g_set_error (error,
NM_SETTING_ADSL_ERROR,
NM_SETTING_ADSL_ERROR_INVALID_PROPERTY,
......
......@@ -257,7 +257,7 @@ br2684_assign_vcc (NMDeviceAdsl *self, NMSettingAdsl *s_adsl)
_LOGD (LOGD_ADSL, "assigning address %d.%d.%d encapsulation %s",
priv->atm_index, addr.sap_addr.vpi, addr.sap_addr.vci,
encapsulation);
encapsulation ? encapsulation : "(none)");
err = connect (priv->brfd, (struct sockaddr*) &addr, sizeof (addr));
if (err != 0) {
......
......@@ -992,7 +992,7 @@ create_pppd_cmd_line (NMPPPManager *self,
if (g_strcmp0 (encaps, NM_SETTING_ADSL_ENCAPSULATION_LLC) == 0)
nm_cmd_line_add_string (cmd, "llc-encaps");
else if (g_strcmp0 (encaps, NM_SETTING_ADSL_ENCAPSULATION_VCMUX) == 0)
else /*if (g_strcmp0 (encaps, NM_SETTING_ADSL_ENCAPSULATION_VCMUX) == 0)*/
nm_cmd_line_add_string (cmd, "vc-encaps");
} else if (!strcmp (protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment