Hello community, here is the log from the commit of package wicked for openSUSE:Factory checked in at 2014-06-06 14:36:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/wicked (Old) and /work/SRC/openSUSE:Factory/.wicked.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "wicked" Changes: -------- --- /work/SRC/openSUSE:Factory/wicked/wicked.changes 2014-06-02 07:02:56.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.wicked.new/wicked.changes 2014-06-06 14:36:31.000000000 +0200 @@ -1,0 +2,8 @@ +Tue Jun 3 11:18:29 UTC 2014 - [email protected] + +- version 0.5.28 +- client: avoid FSM refreshes and unsolicited state updates causing + to exit at assert, drop config origin and UUID on ifdown causing + ifreload to do nothing (bnc#876848,bnc#880664). + +------------------------------------------------------------------- Old: ---- wicked-0.5.27.tar.bz2 New: ---- wicked-0.5.28.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ wicked.spec ++++++ --- /var/tmp/diff_new_pack.2SEjcS/_old 2014-06-06 14:36:33.000000000 +0200 +++ /var/tmp/diff_new_pack.2SEjcS/_new 2014-06-06 14:36:33.000000000 +0200 @@ -18,7 +18,7 @@ %define release_prefix %{?snapshot:%{snapshot}}%{!?snapshot:0} Name: wicked -Version: 0.5.27 +Version: 0.5.28 Release: %{release_prefix}.0.0 Summary: Network configuration infrastructure License: GPL-2.0 ++++++ wicked-0.5.27.tar.bz2 -> wicked-0.5.28.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/ChangeLog new/wicked-0.5.28/ChangeLog --- old/wicked-0.5.27/ChangeLog 2014-05-28 21:19:10.000000000 +0200 +++ new/wicked-0.5.28/ChangeLog 2014-06-03 13:28:39.000000000 +0200 @@ -1,3 +1,71 @@ +commit 12be2b810b7d22d7aafc8236a58f8ee46180fafc +Author: Marius Tomaschewski <[email protected]> +Date: Tue Jun 3 13:17:01 2014 +0200 + + version 0.5.28 + +commit 3172f597e2bd8c3907226a45f273fe73df7dff56 +Author: Pawel Wieczorkiewicz <[email protected]> +Date: Tue Jun 3 10:30:26 2014 +0200 + + fsm: Remove internal refreshes + +commit 2a867db5b90e27db023b0961415682d0c81faaa1 +Author: Pawel Wieczorkiewicz <[email protected]> +Date: Wed May 28 18:02:18 2014 +0200 + + fsm: Set initial state of existing devices on refresh + +commit 44c24c9bfe4b1fae54c1ec6d40c5f0e14775a937 +Author: Pawel Wieczorkiewicz <[email protected]> +Date: Wed May 28 17:58:30 2014 +0200 + + fsm: Do not refresh client-info state + +commit 69e21ffdf3a01895802db4e95e5b2be986a399a3 +Author: Pawel Wieczorkiewicz <[email protected]> +Date: Mon Jun 2 18:45:35 2014 +0200 + + fsm: Clean client-info origin and UUID on ifdown + +commit e0a42398ff43b527b499ba0c87f9c22715a52ab3 +Author: Pawel Wieczorkiewicz <[email protected]> +Date: Mon Jun 2 18:39:02 2014 +0200 + + fsm: Resolve devices hierarchy before marking + +commit 1bb4b6cc01f5391bd36e167323a5a4a8e9e2bebe +Author: Pawel Wieczorkiewicz <[email protected]> +Date: Mon Jun 2 18:37:56 2014 +0200 + + fsm: Schedule device-ready state for physical devices + +commit f5c8e7afe663996cb79dbdb1100755ee0ef06ef1 +Author: Pawel Wieczorkiewicz <[email protected]> +Date: Mon Jun 2 17:25:34 2014 +0200 + + fsm: Update client-info only on final state + +commit fd1682faa674a72b3e4b914872a0663f664fd23e +Author: Pawel Wieczorkiewicz <[email protected]> +Date: Sun Jun 1 19:39:00 2014 +0200 + + server: Discover initial client-state and persistent + + Do no discover initial values from the client. + +commit 7b7f4e308ac6160eb224d4d80b4da64ee29c96af +Author: Pawel Wieczorkiewicz <[email protected]> +Date: Sun Jun 1 19:31:14 2014 +0200 + + fsm: Introduce ni_fsm_state_t type + +commit 8178912e4a9818cab9b3419c90def2fdeada8624 +Author: Pawel Wieczorkiewicz <[email protected]> +Date: Sun Jun 1 19:30:26 2014 +0200 + + ifdown: disable unused function + commit 2e25824ce55b62fba86990b74340b87c79275eb9 Author: Marius Tomaschewski <[email protected]> Date: Wed May 28 21:17:13 2014 +0200 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/VERSION new/wicked-0.5.28/VERSION --- old/wicked-0.5.27/VERSION 2014-05-28 21:17:00.000000000 +0200 +++ new/wicked-0.5.28/VERSION 2014-06-03 13:16:31.000000000 +0200 @@ -1 +1 @@ -0.5.27 +0.5.28 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/client/ifcheck.c new/wicked-0.5.28/client/ifcheck.c --- old/wicked-0.5.27/client/ifcheck.c 2014-05-15 14:14:28.000000000 +0200 +++ new/wicked-0.5.28/client/ifcheck.c 2014-06-03 13:16:23.000000000 +0200 @@ -80,7 +80,7 @@ ni_device_clientinfo_t *ci; if (dev && (ci = dev->client_info)) { - unsigned int state; + ni_fsm_state_t state; if (ni_ifworker_state_from_name(ci->state, &state)) return state; @@ -156,9 +156,9 @@ } ni_bool_t -ni_ifcheck_worker_not_in_state(ni_ifworker_t *w, unsigned int state_val) +ni_ifcheck_worker_not_in_state(ni_ifworker_t *w, ni_fsm_state_t state_val) { - unsigned int state_dev; + ni_fsm_state_t state_dev; ni_assert(w); state_dev = __ifcheck_device_fsm_state(w->device); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/client/ifdown.c new/wicked-0.5.28/client/ifdown.c --- old/wicked-0.5.27/client/ifdown.c 2014-05-28 14:51:39.000000000 +0200 +++ new/wicked-0.5.28/client/ifdown.c 2014-06-03 13:16:23.000000000 +0200 @@ -40,6 +40,7 @@ #include "wicked-client.h" #include "ifdown.h" +#if 0 static ni_bool_t ni_ifdown_fire_nanny(ni_ifworker_t *w) { @@ -80,6 +81,7 @@ return TRUE; } +#endif int ni_do_ifdown(int argc, char **argv) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/client/policy.c new/wicked-0.5.28/client/policy.c --- old/wicked-0.5.27/client/policy.c 2014-05-27 11:47:40.000000000 +0200 +++ new/wicked-0.5.28/client/policy.c 2014-06-03 13:16:23.000000000 +0200 @@ -49,7 +49,7 @@ } ni_bool_t -ni_ifpolicy_match_add_min_state(xml_node_t *policy, unsigned int state) +ni_ifpolicy_match_add_min_state(xml_node_t *policy, ni_fsm_state_t state) { if (ni_ifworker_is_valid_state(state)) { const char *sname = ni_ifworker_state_name(state); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/client/wicked-client.h new/wicked-0.5.28/client/wicked-client.h --- old/wicked-0.5.27/client/wicked-client.h 2014-05-28 21:09:26.000000000 +0200 +++ new/wicked-0.5.28/client/wicked-client.h 2014-06-03 13:16:23.000000000 +0200 @@ -126,7 +126,7 @@ ni_client_get_state_strings(ni_stringbuf_t *sb, const ni_uint_range_t *range) { if (sb) { - unsigned int state; + ni_fsm_state_t state; for (state = (range ? range->min : NI_FSM_STATE_NONE); state <= (range ? range->max : __NI_FSM_STATE_MAX - 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/configure new/wicked-0.5.28/configure --- old/wicked-0.5.27/configure 2014-05-28 21:18:35.000000000 +0200 +++ new/wicked-0.5.28/configure 2014-06-03 13:27:00.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for wicked 0.5.27. +# Generated by GNU Autoconf 2.69 for wicked 0.5.28. # # Report bugs to <http://bugs.opensuse.org>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='wicked' PACKAGE_TARNAME='wicked' -PACKAGE_VERSION='0.5.27' -PACKAGE_STRING='wicked 0.5.27' +PACKAGE_VERSION='0.5.28' +PACKAGE_STRING='wicked 0.5.28' PACKAGE_BUGREPORT='http://bugs.opensuse.org' PACKAGE_URL='https://github.com/openSUSE/wicked' @@ -1378,7 +1378,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures wicked 0.5.27 to adapt to many kinds of systems. +\`configure' configures wicked 0.5.28 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1448,7 +1448,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of wicked 0.5.27:";; + short | recursive ) echo "Configuration of wicked 0.5.28:";; esac cat <<\_ACEOF @@ -1598,7 +1598,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -wicked configure 0.5.27 +wicked configure 0.5.28 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2197,7 +2197,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by wicked $as_me 0.5.27, which was +It was created by wicked $as_me 0.5.28, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3060,7 +3060,7 @@ # Define the identity of the package. PACKAGE='wicked' - VERSION='0.5.27' + VERSION='0.5.28' cat >>confdefs.h <<_ACEOF @@ -3125,7 +3125,7 @@ # CUR=5 AGE=5 -REV=27 +REV=28 # Calculate package (soname version) suffix for the spec file. LIBWICKED_PACKAGE_SUFFIX="$((${CUR}-${AGE}))" @@ -14785,7 +14785,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by wicked $as_me 0.5.27, which was +This file was extended by wicked $as_me 0.5.28, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14852,7 +14852,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -wicked config.status 0.5.27 +wicked config.status 0.5.28 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/configure.ac new/wicked-0.5.28/configure.ac --- old/wicked-0.5.27/configure.ac 2014-05-28 21:17:04.000000000 +0200 +++ new/wicked-0.5.28/configure.ac 2014-06-03 13:16:39.000000000 +0200 @@ -19,7 +19,7 @@ # CUR=5 AGE=5 -REV=27 +REV=28 # Calculate package (soname version) suffix for the spec file. AC_SUBST(LIBWICKED_PACKAGE_SUFFIX, "$((${CUR}-${AGE}))") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/include/wicked/fsm.h new/wicked-0.5.28/include/wicked/fsm.h --- old/wicked-0.5.27/include/wicked/fsm.h 2014-05-27 11:47:40.000000000 +0200 +++ new/wicked-0.5.28/include/wicked/fsm.h 2014-06-03 13:16:23.000000000 +0200 @@ -19,7 +19,7 @@ /* * Interface state information */ -enum { +typedef enum ni_fsm_state { NI_FSM_STATE_NONE = 0, NI_FSM_STATE_DEVICE_DOWN, NI_FSM_STATE_DEVICE_EXISTS, @@ -33,7 +33,7 @@ NI_FSM_STATE_ADDRCONF_UP, __NI_FSM_STATE_MAX -}; +} ni_fsm_state_t; typedef enum ni_config_origin_prio { NI_CONFIG_ORIGIN_PRIO_FIRMWARE, @@ -167,7 +167,7 @@ } device_api; struct { - unsigned int state; + ni_fsm_state_t state; ni_fsm_transition_t *wait_for; ni_fsm_transition_t *next_action; ni_fsm_transition_t *action_table; @@ -278,7 +278,7 @@ extern ni_ifworker_type_t ni_ifworker_type_from_string(const char *); extern const char * ni_ifworker_type_to_string(ni_ifworker_type_t); extern inline ni_bool_t ni_ifworker_state_in_range(const ni_uint_range_t *, const unsigned int); -extern const char * ni_ifworker_state_name(unsigned int state); +extern const char * ni_ifworker_state_name(ni_fsm_state_t state); extern ni_bool_t ni_ifworker_state_from_name(const char *, unsigned int *); extern ni_fsm_require_t * ni_ifworker_reachability_check_new(xml_node_t *); extern ni_bool_t ni_ifworker_match_netdev_name(const ni_ifworker_t *, const char *); @@ -380,7 +380,7 @@ * Returns true if a state is one of the FSM defined states */ static inline ni_bool_t -ni_ifworker_is_valid_state(unsigned int state) +ni_ifworker_is_valid_state(ni_fsm_state_t state) { return state > NI_FSM_STATE_NONE && state < __NI_FSM_STATE_MAX; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/include/wicked/netinfo.h new/wicked-0.5.28/include/wicked/netinfo.h --- old/wicked-0.5.27/include/wicked/netinfo.h 2014-05-28 21:09:26.000000000 +0200 +++ new/wicked-0.5.28/include/wicked/netinfo.h 2014-06-03 13:16:23.000000000 +0200 @@ -219,7 +219,8 @@ extern ni_device_clientinfo_t * ni_netdev_get_client_info(ni_netdev_t *); extern void ni_netdev_set_client_state(ni_netdev_t *, ni_client_state_t *); extern ni_client_state_t * ni_netdev_get_client_state(ni_netdev_t *); -extern void ni_netdev_load_client_state(ni_netdev_t *); +extern ni_bool_t ni_netdev_load_client_state(ni_netdev_t *); +extern void ni_netdev_discover_client_state(ni_netdev_t *); extern ni_bool_t ni_netdev_supports_arp(ni_netdev_t *); extern void ni_netdev_clear_addresses(ni_netdev_t *); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/server/main.c new/wicked-0.5.28/server/main.c --- old/wicked-0.5.27/server/main.c 2014-05-27 11:47:41.000000000 +0200 +++ new/wicked-0.5.28/server/main.c 2014-06-03 13:16:23.000000000 +0200 @@ -312,7 +312,10 @@ for (ifp = ni_netconfig_devlist(nc); ifp; ifp = ifp->next) { discover_udev_netdev_state(ifp); ni_objectmodel_register_netif(server, ifp, NULL); - ni_netdev_load_client_state(ifp); + if (!ni_netdev_get_client_state(ifp)) { + if (!ni_netdev_load_client_state(ifp)) + ni_netdev_discover_client_state(ifp); + } } #ifdef MODEM for (modem = ni_netconfig_modem_list(nc); modem; modem = modem->list.next) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/src/client/client_state.c new/wicked-0.5.28/src/client/client_state.c --- old/wicked-0.5.27/src/client/client_state.c 2014-05-27 11:47:41.000000000 +0200 +++ new/wicked-0.5.28/src/client/client_state.c 2014-06-03 13:16:23.000000000 +0200 @@ -147,7 +147,7 @@ } static inline void -__ni_client_state_update_state(ni_client_state_t *client_state, unsigned int state) +__ni_client_state_update_state(ni_client_state_t *client_state, ni_fsm_state_t state) { ni_timer_get_time(&client_state->last_time); if (!ni_client_state_is_valid_state(client_state->init_state)) { @@ -160,7 +160,7 @@ * Exported functions */ ni_client_state_t * -ni_client_state_new(unsigned int state) +ni_client_state_new(ni_fsm_state_t state) { ni_client_state_t *client_state; @@ -199,7 +199,7 @@ } ni_bool_t -ni_client_state_set_state(ni_client_state_t *client_state, unsigned int state) +ni_client_state_set_state(ni_client_state_t *client_state, ni_fsm_state_t state) { if (client_state) { if (ni_client_state_is_valid_state(state)) { @@ -211,7 +211,7 @@ } ni_bool_t -ni_client_state_is_valid_state(unsigned int state) +ni_client_state_is_valid_state(ni_fsm_state_t state) { return state > NI_FSM_STATE_NONE && state < __NI_FSM_STATE_MAX; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/src/fsm-policy.c new/wicked-0.5.28/src/fsm-policy.c --- old/wicked-0.5.27/src/fsm-policy.c 2014-05-27 11:47:41.000000000 +0200 +++ new/wicked-0.5.28/src/fsm-policy.c 2014-06-03 13:16:23.000000000 +0200 @@ -1312,7 +1312,7 @@ static ni_ifcondition_t * ni_ifcondition_min_device_state(xml_node_t *node) { - unsigned int state; + ni_fsm_state_t state; if (!ni_ifworker_state_from_name(node->cdata, &state)) { ni_error("%s: invalid device state \"%s\"", xml_node_location(node), node->cdata); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/src/fsm.c new/wicked-0.5.28/src/fsm.c --- old/wicked-0.5.27/src/fsm.c 2014-05-27 11:47:41.000000000 +0200 +++ new/wicked-0.5.28/src/fsm.c 2014-06-03 13:16:23.000000000 +0200 @@ -464,13 +464,13 @@ }; inline ni_bool_t -ni_ifworker_state_in_range(const ni_uint_range_t *range, const unsigned int state) +ni_ifworker_state_in_range(const ni_uint_range_t *range, const ni_fsm_state_t state) { return state >= range->min && state <= range->max; } const char * -ni_ifworker_state_name(unsigned int state) +ni_ifworker_state_name(ni_fsm_state_t state) { return ni_format_uint_mapped(state, __state_names); } @@ -1016,12 +1016,13 @@ if (w->fsm.wait_for && w->fsm.wait_for->next_state == new_state) w->fsm.wait_for = NULL; - if (w->object && new_state != NI_FSM_STATE_DEVICE_DOWN && !w->readonly) - ni_ifworker_update_client_info(w); - if (w->target_state == new_state) { - if (w->object && prev_state < new_state && !w->readonly) - ni_ifworker_update_client_state(w); + if (w->object && !w->readonly) { + if (prev_state < new_state) + ni_ifworker_update_client_state(w); + if (new_state != NI_FSM_STATE_DEVICE_DOWN) + ni_ifworker_update_client_info(w); + } ni_ifworker_success(w); } } @@ -1079,11 +1080,7 @@ static void ni_ifworker_refresh_client_info(ni_ifworker_t *w, ni_device_clientinfo_t *client_info) { - unsigned int state; - ni_assert(w && client_info); - if (ni_ifworker_state_from_name(client_info->state, &state)) - ni_ifworker_set_state(w, state); ni_ifworker_set_config_origin(w, client_info->config_origin); w->config.uuid = client_info->config_uuid; @@ -1990,12 +1987,24 @@ ni_ifworkers_check_loops(fsm, marked); + /* Collect all workers in the device graph, and sort them + * by increasing depth. + */ + ni_ifworkers_flatten(marked); + /* Mark all our primary devices with the requested marker values */ for (i = 0; i < marked->count; ++i) { ni_ifworker_t *w = marked->data[i]; ni_client_state_t *cs = &w->client_state; w->target_range = marker->target_range; + + /* Clean client-info origin and UUID on ifdown */ + if (marker->target_range.max < NI_FSM_STATE_DEVICE_UP) { + ni_string_free(&w->config.origin); + memset(&w->config.uuid, 0, sizeof(w->config.uuid)); + } + NI_CLIENT_STATE_SET_CONTROL_FLAG(cs->persistent, marker->persistent == TRUE, TRUE); } @@ -2010,11 +2019,6 @@ { unsigned int i, count = 0; - /* Collect all workers in the device graph, and sort them - * by increasing depth. - */ - ni_ifworkers_flatten(marked); - for (i = 0; i < marked->count; ++i) { ni_ifworker_t *w = marked->data[i]; int rv; @@ -2133,7 +2137,6 @@ { unsigned int min_state = w->target_range.min; unsigned int max_state = w->target_range.max; - unsigned int cur_state = w->fsm.state; unsigned int j; int rv; @@ -2184,16 +2187,8 @@ ni_ifworker_state_name(w->fsm.state), ni_ifworker_state_name(w->target_state)); - if (w->target_state != NI_FSM_STATE_NONE) { - ni_client_state_t *cs = &w->client_state; - - if (!ni_client_state_is_valid(cs)) { - ni_client_state_set_state(cs, cur_state); - NI_CLIENT_STATE_SET_CONTROL_FLAG(cs->persistent, - cur_state >= NI_FSM_STATE_LINK_UP, TRUE); - } + if (w->target_state != NI_FSM_STATE_NONE) ni_ifworker_set_timeout(w, timeout); - } /* For each of the DBus calls we will execute on this device, * check whether there are constraints on child devices that @@ -2582,24 +2577,11 @@ for (i = 0; i < fsm->workers.count; ++i) { w = fsm->workers.data[i]; - if (w->object == NULL) { - ni_debug_application("device %s (%s) disappeared", w->name, w->object_path); - ni_ifworker_update_state(w, NI_FSM_STATE_NONE, NI_FSM_STATE_DEVICE_DOWN); - - if (w->device) { - ni_netdev_put(w->device); - w->device = NULL; - } - if (w->modem) { - ni_modem_release(w->modem); - w->modem = NULL; - } - if (ni_ifworker_active(w) && !w->device_api.factory_method) - ni_ifworker_fail(w, "device was deleted"); - w->dead = TRUE; - } else if (!w->done) + /* Set initial state of existing devices */ + if (w->object != NULL) ni_ifworker_update_state(w, NI_FSM_STATE_DEVICE_EXISTS, __NI_FSM_STATE_MAX); } + return TRUE; } @@ -2665,15 +2647,6 @@ found->ifindex = dev->link.ifindex; found->object = object; - /* Don't touch devices we're done with */ - - if (!found->done) { - if (ni_netdev_link_is_up(dev)) - ni_ifworker_update_state(found, NI_FSM_STATE_LINK_UP, __NI_FSM_STATE_MAX); - else - ni_ifworker_update_state(found, 0, NI_FSM_STATE_LINK_UP - 1); - } - return found; } @@ -3393,7 +3366,7 @@ /* ifdown: when device cannot be deleted, don't try. */ if (NI_FSM_STATE_DEVICE_DOWN == target_state) { if (!ni_ifworker_can_delete(w)) - target_state -= increment; /* One up */ + target_state = NI_FSM_STATE_DEVICE_READY; else ni_debug_application("%s: Deleting device", w->name); } @@ -3503,9 +3476,6 @@ while (1) { int made_progress = 0; - ni_debug_application("-- refreshing interface state --"); - ni_fsm_refresh_state(fsm); - for (i = 0; i < fsm->workers.count; ++i) { ni_ifworker_t *w = fsm->workers.data[i]; ni_fsm_transition_t *action; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/src/netdev.c new/wicked-0.5.28/src/netdev.c --- old/wicked-0.5.27/src/netdev.c 2014-05-28 21:09:26.000000000 +0200 +++ new/wicked-0.5.28/src/netdev.c 2014-06-03 13:16:23.000000000 +0200 @@ -32,6 +32,7 @@ #include <wicked/ipv6.h> #include <wicked/pci.h> #include <wicked/lldp.h> +#include <wicked/fsm.h> #include "netinfo_priv.h" #include "util_priv.h" #include "appconfig.h" @@ -568,19 +569,44 @@ return dev ? dev->client_state : NULL; } -void +ni_bool_t ni_netdev_load_client_state(ni_netdev_t *dev) { ni_client_state_t client_state; - if (!ni_netdev_get_client_state(dev)) { - ni_client_state_init(&client_state); - if (ni_client_state_load(&client_state, dev->link.ifindex)) { - ni_netdev_set_client_state(dev, ni_client_state_clone(&client_state)); - ni_debug_ifconfig("loading client-state structure from a file for %s", - dev->name); - } + ni_assert(dev); + + ni_client_state_init(&client_state); + if (ni_client_state_load(&client_state, dev->link.ifindex)) { + ni_netdev_set_client_state(dev, ni_client_state_clone(&client_state)); + ni_debug_ifconfig("loading client-state structure from a file for %s", + dev->name); + return TRUE; } + + return FALSE; +} + +void +ni_netdev_discover_client_state(ni_netdev_t *dev) +{ + ni_fsm_state_t state = NI_FSM_STATE_DEVICE_EXISTS; + ni_client_state_t *cs; + + ni_assert(dev); + + if (ni_netdev_device_is_up(dev)) + state = NI_FSM_STATE_DEVICE_UP; + if (ni_netdev_link_is_up(dev)) + state = NI_FSM_STATE_LINK_UP; + if (ni_netdev_network_is_up(dev)) + state = NI_FSM_STATE_LINK_UP; + + cs = ni_client_state_new(state); + NI_CLIENT_STATE_SET_CONTROL_FLAG(cs->persistent, + state >= NI_FSM_STATE_LINK_UP, TRUE); + + ni_netdev_set_client_state(dev, cs); } /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.27/wicked.spec new/wicked-0.5.28/wicked.spec --- old/wicked-0.5.27/wicked.spec 2014-05-28 21:18:41.000000000 +0200 +++ new/wicked-0.5.28/wicked.spec 2014-06-03 13:27:06.000000000 +0200 @@ -18,7 +18,7 @@ %define release_prefix %{?snapshot:%{snapshot}}%{!?snapshot:0} Name: wicked -Version: 0.5.27 +Version: 0.5.28 Release: %{release_prefix}.0.0 Summary: Network configuration infrastructure License: GPL-2.0 -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
