{
struct ppp_option *config = elem;
struct pppcp_data *data = user_data;
- GList *list = NULL;
- struct ppp_option *option;
+ guint type = config->type;
+ GList *list;
/*
* determine whether this config option is in the
* acceptable options list
*/
- if (g_list_length(data->acceptable_options)) {
- guint type = config->type;
+ if (g_list_length(data->acceptable_options) == 0)
+ return;
- list = g_list_find_custom(data->acceptable_options,
+ list = g_list_find_custom(data->acceptable_options,
GUINT_TO_POINTER(type), is_option);
- }
-
if (!list) {
+ struct ppp_option *option;
+
/*
* if the option did not exist, we need to store a copy
* of the option in the unacceptable_options list so it
option = g_try_malloc0(config->length);
if (option == NULL)
return;
+
option->type = config->type;
option->length = config->length;
data->unacceptable_options =
g_list_append(data->unacceptable_options, option);
}
-
}
static void remove_config_option(gpointer elem, gpointer user_data)
{
struct ppp_option *config = elem;
struct pppcp_data *data = user_data;
+ guint type = config->type;
GList *list;
/*
* determine whether this config option is in the
* applied options list
*/
- if (g_list_length(data->config_options)) {
- guint type = config->type;
+ if (g_list_length(data->config_options) == 0)
+ return;
- list = g_list_find_custom(data->config_options,
- GUINT_TO_POINTER(type), is_option);
- if (list)
- data->config_options =
+ list = g_list_find_custom(data->config_options,
+ GUINT_TO_POINTER(type), is_option);
+ if (list)
+ data->config_options =
g_list_delete_link(data->config_options, list);
- }
}
static guint8 pppcp_process_configure_request(struct pppcp_data *data,