Hello community,
here is the log from the commit of package wicked for openSUSE:Factory checked in at 2014-04-17 14:43:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-04-01 11:34:14.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.wicked.new/wicked.changes 2014-04-17 14:43:39.000000000 +0200
@@ -1,0 +2,11 @@
+Mon Apr 14 17:28:11 UTC 2014 - mt@suse.de
+
+- version 0.5.19
+- server/nanny: do not fail on missed dbus objects or object
+ creation errors due to already deleted interfaces in the
+ kernel while processing the event (bnc#867806,bnc#871388)
+- netlink: verify if device still exists on newlink events
+- nanny: fixed endless loop on policies without name and user
+ control default, added device mach with identify capabilities
+
+-------------------------------------------------------------------
Old:
----
wicked-0.5.18.tar.bz2
New:
----
wicked-0.5.19.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ wicked.spec ++++++
--- /var/tmp/diff_new_pack.Eu3RTs/_old 2014-04-17 14:43:39.000000000 +0200
+++ /var/tmp/diff_new_pack.Eu3RTs/_new 2014-04-17 14:43:39.000000000 +0200
@@ -18,7 +18,7 @@
%define release_prefix %{?snapshot:%{snapshot}}%{!?snapshot:0}
Name: wicked
-Version: 0.5.18
+Version: 0.5.19
Release: %{release_prefix}.0.0
Summary: Network configuration infrastructure
License: GPL-2.0
++++++ wicked-0.5.18.tar.bz2 -> wicked-0.5.19.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/ChangeLog.git new/wicked-0.5.19/ChangeLog.git
--- old/wicked-0.5.18/ChangeLog.git 2014-03-28 19:43:42.000000000 +0100
+++ new/wicked-0.5.19/ChangeLog.git 2014-04-14 19:27:29.000000000 +0200
@@ -1,3 +1,78 @@
+commit d9aef8cdd30ae9b0632fca787fef9a954564d4a3
+Author: Marius Tomaschewski
+Date: Mon Apr 14 19:22:39 2014 +0200
+
+ version 0.5.19
+
+commit ecd2a2e6dfb939f45904ce48d3f590a3d60dd619
+Author: Marius Tomaschewski
+Date: Thu Apr 10 21:49:17 2014 +0200
+
+ fsm: release device references on free
+
+commit 0ce76c25d233dcd4227e38e73ba9a915f2bc4e42
+Author: Marius Tomaschewski
+Date: Thu Apr 10 21:45:33 2014 +0200
+
+ netlink: verify if device exists on newlink events
+
+commit 58506b5be46a55a4a32a0afe32b5211256aaee91
+Author: Marius Tomaschewski
+Date: Thu Apr 10 21:41:10 2014 +0200
+
+ client: adjusted ifstatus output indenting
+
+commit 609127c5456b7111b0d534a7d983a81374d82729
+Author: Marius Tomaschewski
+Date: Thu Apr 10 21:20:02 2014 +0200
+
+ nanny: do not fail on events for deleted devices
+
+commit 8b139182a7f83f4d0b4fe1a05735a299c439b825
+Author: Marius Tomaschewski
+Date: Thu Apr 10 21:09:31 2014 +0200
+
+ server: do not fail on missed dbus objects
+
+ The events may arrive for non-existing devices when they
+ get deleted [in the kernel] while we're processing them.
+
+commit 5dac78d666a7b6849c9bcd480a250849542a464f
+Author: Marius Tomaschewski
+Date: Thu Apr 10 20:58:09 2014 +0200
+
+ dbus: do not fail on dbus object creation failures
+
+commit 87140f2b05b890861c7d57264ef5becbcd32bb55
+Author: Marius Tomaschewski
+Date: Thu Apr 10 20:35:12 2014 +0200
+
+ fsm: do not fail completely in ni_fsm_refresh_state
+
+commit c61f3e55284efb95ed2537dff686eab1418e89dd
+Author: Marius Tomaschewski
+Date: Wed Apr 9 11:55:25 2014 +0200
+
+ nanny: do not register device when object disapears
+
+commit 1b3f254deee181125bd06352f8482ba90462633f
+Author: Marius Tomaschewski
+Date: Wed Apr 2 12:00:49 2014 +0200
+
+ nanny: added initial device name,alias,ifindex match
+
+commit 75e56c6da0e9759ad05f6f696bafb230387a32d7
+Author: Marius Tomaschewski
+Date: Wed Apr 2 11:53:28 2014 +0200
+
+ nanny: user control off by default, show it correctly
+
+commit 743cac740e30caa774065a513cee09a63babc8ea
+Author: Marius Tomaschewski
+Date: Wed Apr 2 11:52:04 2014 +0200
+
+ nanny: fixed endless loop on policies without name
+
commit 058f194c521e5525e9fb793d264916cc72126811
Author: Marius Tomaschewski
Date: Fri Mar 28 19:41:59 2014 +0100
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/VERSION new/wicked-0.5.19/VERSION
--- old/wicked-0.5.18/VERSION 2014-03-28 19:42:17.000000000 +0100
+++ new/wicked-0.5.19/VERSION 2014-04-14 19:23:16.000000000 +0200
@@ -1 +1 @@
-0.5.18
+0.5.19
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/client/ifcheck.c new/wicked-0.5.19/client/ifcheck.c
--- old/wicked-0.5.18/client/ifcheck.c 2014-03-28 12:39:58.000000000 +0100
+++ new/wicked-0.5.19/client/ifcheck.c 2014-04-14 19:21:31.000000000 +0200
@@ -325,11 +325,17 @@
}
if (!ni_fsm_create_client(fsm)) {
+ /* Severe error we always explicitly return */
+ status = NI_WICKED_RC_ERROR;
+ goto cleanup;
+ }
+
+ if (!ni_fsm_refresh_state(fsm)) {
+ /* Severe error we always explicitly return */
status = NI_WICKED_RC_ERROR;
goto cleanup;
}
- ni_fsm_refresh_state(fsm);
status = NI_WICKED_ST_OK;
if (0 == checks.count)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/client/ifdown.c new/wicked-0.5.19/client/ifdown.c
--- old/wicked-0.5.18/client/ifdown.c 2014-02-25 14:03:37.000000000 +0100
+++ new/wicked-0.5.19/client/ifdown.c 2014-04-14 19:21:31.000000000 +0200
@@ -151,11 +151,15 @@
ifmarker.target_range.min = NI_FSM_STATE_NONE;
ifmarker.target_range.max = max_state;
- if (!ni_fsm_create_client(fsm))
+ if (!ni_fsm_create_client(fsm)) {
/* Severe error we always explicitly return */
return NI_WICKED_RC_ERROR;
+ }
- ni_fsm_refresh_state(fsm);
+ if (!ni_fsm_refresh_state(fsm)) {
+ /* Severe error we always explicitly return */
+ return NI_WICKED_RC_ERROR;
+ }
/* Get workers that match given criteria */
nmarked = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/client/ifreload.c new/wicked-0.5.19/client/ifreload.c
--- old/wicked-0.5.18/client/ifreload.c 2014-03-28 12:39:58.000000000 +0100
+++ new/wicked-0.5.19/client/ifreload.c 2014-04-14 19:21:31.000000000 +0200
@@ -147,7 +147,11 @@
goto cleanup;
}
- ni_fsm_refresh_state(fsm);
+ if (!ni_fsm_refresh_state(fsm)) {
+ /* Severe error we always explicitly return */
+ status = NI_WICKED_RC_ERROR;
+ goto cleanup;
+ }
if (opt_ifconfig.count == 0) {
const ni_string_array_t *sources = ni_config_sources("ifconfig");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/client/ifstatus.c new/wicked-0.5.19/client/ifstatus.c
--- old/wicked-0.5.18/client/ifstatus.c 2014-03-28 14:14:45.000000000 +0100
+++ new/wicked-0.5.19/client/ifstatus.c 2014-04-14 19:21:31.000000000 +0200
@@ -215,12 +215,12 @@
va_list ap;
if (!ni_string_empty(dev)) {
- printf("%-15s", dev);
+ printf("%-16s", dev);
} else {
printf("%-6s", "");
}
if (!ni_string_empty(tag)) {
- printf("%-8s ", tag);
+ printf("%-9s ", tag);
}
if (!ni_string_empty(fmt)) {
va_start(ap, fmt);
@@ -563,14 +563,16 @@
}
if (!ni_fsm_create_client(fsm)) {
+ /* Severe error we always explicitly return */
status = NI_WICKED_ST_ERROR;
goto cleanup;
}
- /* TODO: we connect to wickedd here. currently, it
- * may exit(1), that is with NI_WICKED_ST_ERROR...
- */
- ni_fsm_refresh_state(fsm);
+ if (!ni_fsm_refresh_state(fsm)) {
+ /* Severe error we always explicitly return */
+ status = NI_WICKED_ST_ERROR;
+ goto cleanup;
+ }
if (check_config && opt_ifconfig.count == 0) {
const ni_string_array_t *sources = ni_config_sources("ifconfig");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/client/ifup.c new/wicked-0.5.19/client/ifup.c
--- old/wicked-0.5.18/client/ifup.c 2014-03-28 12:39:58.000000000 +0100
+++ new/wicked-0.5.19/client/ifup.c 2014-04-14 19:21:31.000000000 +0200
@@ -206,7 +206,11 @@
goto cleanup;
}
- ni_fsm_refresh_state(fsm);
+ if (!ni_fsm_refresh_state(fsm)) {
+ /* Severe error we always explicitly return */
+ status = NI_WICKED_RC_ERROR;
+ goto cleanup;
+ }
if (opt_ifconfig.count == 0) {
const ni_string_array_t *sources = ni_config_sources("ifconfig");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/configure new/wicked-0.5.19/configure
--- old/wicked-0.5.18/configure 2014-03-28 19:43:07.000000000 +0100
+++ new/wicked-0.5.19/configure 2014-04-14 19:25:13.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.18.
+# Generated by GNU Autoconf 2.69 for wicked 0.5.19.
#
# 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.18'
-PACKAGE_STRING='wicked 0.5.18'
+PACKAGE_VERSION='0.5.19'
+PACKAGE_STRING='wicked 0.5.19'
PACKAGE_BUGREPORT='http://bugs.opensuse.org'
PACKAGE_URL='https://github.com/openSUSE/wicked'
@@ -1377,7 +1377,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.18 to adapt to many kinds of systems.
+\`configure' configures wicked 0.5.19 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1447,7 +1447,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of wicked 0.5.18:";;
+ short | recursive ) echo "Configuration of wicked 0.5.19:";;
esac
cat <<\_ACEOF
@@ -1596,7 +1596,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-wicked configure 0.5.18
+wicked configure 0.5.19
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2195,7 +2195,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.18, which was
+It was created by wicked $as_me 0.5.19, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3058,7 +3058,7 @@
# Define the identity of the package.
PACKAGE='wicked'
- VERSION='0.5.18'
+ VERSION='0.5.19'
cat >>confdefs.h <<_ACEOF
@@ -3122,7 +3122,7 @@
# with (CUR-AGE) used in the library soname.
#
CUR=5
-REV=18
+REV=19
AGE=5
# Calculate package (soname version) suffix for the spec file.
@@ -14769,7 +14769,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.18, which was
+This file was extended by wicked $as_me 0.5.19, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14836,7 +14836,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.18
+wicked config.status 0.5.19
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.18/configure.ac new/wicked-0.5.19/configure.ac
--- old/wicked-0.5.18/configure.ac 2014-03-28 19:42:17.000000000 +0100
+++ new/wicked-0.5.19/configure.ac 2014-04-14 19:23:16.000000000 +0200
@@ -18,7 +18,7 @@
# with (CUR-AGE) used in the library soname.
#
CUR=5
-REV=18
+REV=19
AGE=5
# Calculate package (soname version) suffix for the spec file.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/include/wicked/fsm.h new/wicked-0.5.19/include/wicked/fsm.h
--- old/wicked-0.5.18/include/wicked/fsm.h 2014-03-28 12:39:58.000000000 +0100
+++ new/wicked-0.5.19/include/wicked/fsm.h 2014-04-14 19:21:31.000000000 +0200
@@ -251,7 +251,7 @@
extern ni_bool_t ni_fsm_policies_changed_since(const ni_fsm_t *, unsigned int *tstamp);
extern ni_dbus_client_t * ni_fsm_create_client(ni_fsm_t *);
-extern void ni_fsm_refresh_state(ni_fsm_t *);
+extern ni_bool_t ni_fsm_refresh_state(ni_fsm_t *);
extern unsigned int ni_fsm_schedule(ni_fsm_t *);
extern ni_bool_t ni_fsm_do(ni_fsm_t *fsm, long *timeout_p);
extern void ni_fsm_mainloop(ni_fsm_t *);
@@ -277,6 +277,9 @@
extern const char * ni_ifworker_state_name(unsigned int 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 *);
+extern ni_bool_t ni_ifworker_match_netdev_alias(const ni_ifworker_t *, const char *);
+extern ni_bool_t ni_ifworker_match_netdev_ifindex(const ni_ifworker_t *, unsigned int);
extern ni_bool_t ni_ifworker_match_alias(const ni_ifworker_t *, const char *);
extern void ni_ifworker_set_config(ni_ifworker_t *, xml_node_t *, const char *);
extern ni_bool_t ni_ifworker_check_config(const ni_ifworker_t *, const xml_node_t *, const char *);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/nanny/device.c new/wicked-0.5.19/nanny/device.c
--- old/wicked-0.5.18/nanny/device.c 2014-02-26 20:35:14.000000000 +0100
+++ new/wicked-0.5.19/nanny/device.c 2014-04-14 19:21:31.000000000 +0200
@@ -429,8 +429,6 @@
{
ni_managed_device_t *mdev;
- ni_assert(w);
-
for (mdev = mgr->device_list; mdev; mdev = mdev->next) {
if (mdev->worker == w)
return mdev;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/nanny/main.c new/wicked-0.5.19/nanny/main.c
--- old/wicked-0.5.18/nanny/main.c 2014-03-28 12:39:58.000000000 +0100
+++ new/wicked-0.5.19/nanny/main.c 2014-04-14 19:21:31.000000000 +0200
@@ -300,9 +300,10 @@
// A new device was added. Could be a virtual device like
// a VLAN or vif, or a hotplug device
// Create a worker and a managed_netif for this device.
- w = ni_fsm_recv_new_netif_path(mgr->fsm, object_path);
- ni_nanny_register_device(mgr, w);
- ni_nanny_schedule_recheck(mgr, w);
+ if ((w = ni_fsm_recv_new_netif_path(mgr->fsm, object_path))) {
+ ni_nanny_register_device(mgr, w);
+ ni_nanny_schedule_recheck(mgr, w);
+ }
return;
}
@@ -311,28 +312,32 @@
signal_name, object_path);
return;
}
-
- ni_assert(w->type == NI_IFWORKER_TYPE_NETDEV);
- ni_assert(w->device);
+ if (w->type != NI_IFWORKER_TYPE_NETDEV || w->device == NULL) {
+ ni_error("%s: received signal \"%s\" from \"%s\" (not a managed network device)",
+ w->name, signal_name, object_path);
+ return;
+ }
if (event == NI_EVENT_DEVICE_DELETE) {
- ni_debug_nanny("%s: received signal %s from %s", w->name, signal_name, object_path);
+ ni_debug_nanny("%s: received signal \"%s\" from \"%s\"",
+ w->name, signal_name, object_path);
// delete the worker and the managed netif
ni_nanny_unregister_device(mgr, w);
return;
}
if ((mdev = ni_nanny_get_device(mgr, w)) == NULL) {
- ni_debug_nanny("%s: received signal %s from %s (not a managed device)",
+ ni_debug_nanny("%s: received signal \"%s\" from \"%s\" (not a managed device)",
w->name, signal_name, object_path);
return;
}
- ni_debug_nanny("%s: received signal %s; state=%s, policy=%s%s",
+ ni_debug_nanny("%s: received signal %s; state=%s, policy=%s%s%s",
w->name, signal_name,
ni_managed_state_to_string(mdev->state),
mdev->selected_policy? ni_fsm_policy_name(mdev->selected_policy->fsm_policy): "<none>",
- mdev->monitor? ", user controlled" : "");
+ mdev->allowed? ", user control allowed" : "",
+ mdev->monitor? ", monitored" : "");
switch (event) {
case NI_EVENT_LINK_DOWN:
@@ -387,9 +392,10 @@
// We receive a deviceCreate signal when a modem was plugged in
if (event == NI_EVENT_DEVICE_CREATE) {
- w = ni_fsm_recv_new_modem_path(mgr->fsm, object_path);
- ni_nanny_register_device(mgr, w);
- ni_nanny_schedule_recheck(mgr, w);
+ if ((w = ni_fsm_recv_new_modem_path(mgr->fsm, object_path))) {
+ ni_nanny_register_device(mgr, w);
+ ni_nanny_schedule_recheck(mgr, w);
+ }
return;
}
@@ -399,10 +405,13 @@
return;
}
- ni_debug_nanny("%s: received signal %s from %s", w->name, signal_name, object_path);
- ni_assert(w->type == NI_IFWORKER_TYPE_MODEM);
- ni_assert(w->modem);
+ if (w->type != NI_IFWORKER_TYPE_MODEM || w->modem == NULL) {
+ ni_error("%s: received signal \"%s\" from \"%s\" (not a managed modem device)",
+ w->name, signal_name, object_path);
+ return;
+ }
+ ni_debug_nanny("%s: received signal %s from %s", w->name, signal_name, object_path);
if (event == NI_EVENT_DEVICE_DELETE) {
// delete the worker and the managed modem
ni_nanny_unregister_device(mgr, w);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/nanny/nanny.c new/wicked-0.5.19/nanny/nanny.c
--- old/wicked-0.5.18/nanny/nanny.c 2014-03-18 15:10:50.000000000 +0100
+++ new/wicked-0.5.19/nanny/nanny.c 2014-04-14 19:21:31.000000000 +0200
@@ -324,7 +324,7 @@
break;
}
- mdev->allowed = TRUE;
+ mdev->allowed = FALSE;
if (match->auto_enable)
mdev->monitor = TRUE;
}
@@ -332,7 +332,7 @@
ni_debug_nanny("new device %s, class %s%s%s", w->name,
mdev->object->class->name,
mdev->allowed? ", user control allowed" : "",
- mdev->monitor? ", auto-enabled" : "");
+ mdev->monitor? ", monitored (auto-enabled)" : "");
if (mdev->monitor)
ni_nanny_schedule_recheck(mgr, w);
@@ -640,7 +640,7 @@
do {
snprintf(namebuf, sizeof(namebuf), "policy%u", counter++);
- } while (ni_fsm_policy_by_name(mgr->fsm, namebuf) == NULL);
+ } while (ni_fsm_policy_by_name(mgr->fsm, namebuf) && counter);
name = namebuf;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/server/main.c new/wicked-0.5.19/server/main.c
--- old/wicked-0.5.18/server/main.c 2014-03-28 12:39:58.000000000 +0100
+++ new/wicked-0.5.19/server/main.c 2014-04-14 19:21:31.000000000 +0200
@@ -347,10 +347,14 @@
/* A new netif was discovered; create a dbus server object
* enacpsulating it. */
object = ni_objectmodel_register_netif(dbus_server, dev, NULL);
- } else
- if (!(object = ni_objectmodel_get_netif_object(dbus_server, dev))) {
- ni_error("cannot send %s event for model \"%s\" - no dbus device",
- ni_event_type_to_name(event), dev->name);
+ } else {
+ object = ni_objectmodel_get_netif_object(dbus_server, dev);
+ }
+ if (!object) {
+ /* usually a "bad event", e.g. when the underlying netdev
+ * does not exists any more, but events still arrive ... */
+ ni_debug_events("cannot handle %s event for model \"%s\" - no dbus object",
+ ni_event_type_to_name(event), dev->name);
return;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/src/dbus-object.c new/wicked-0.5.19/src/dbus-object.c
--- old/wicked-0.5.18/src/dbus-object.c 2014-02-18 15:27:29.000000000 +0100
+++ new/wicked-0.5.19/src/dbus-object.c 2014-04-14 19:21:31.000000000 +0200
@@ -301,7 +301,7 @@
const ni_dbus_service_t *svc;
unsigned int i;
- if (object->interfaces == NULL)
+ if (object == NULL || object->interfaces == NULL)
return NULL;
for (i = 0; (svc = object->interfaces[i]) != NULL; ++i) {
@@ -364,7 +364,7 @@
const ni_dbus_service_t *svc;
unsigned int i, found = 0;
- if (object->interfaces == NULL || method == NULL)
+ if (object == NULL || object->interfaces == NULL || method == NULL)
return 0;
for (i = 0; (svc = object->interfaces[i]) != NULL; ++i) {
@@ -383,7 +383,7 @@
const ni_dbus_service_t *svc, *best = NULL;
unsigned int i;
- if (object->interfaces == NULL)
+ if (object == NULL || object->interfaces == NULL)
return NULL;
for (i = 0; (svc = object->interfaces[i]) != NULL; ++i) {
@@ -404,7 +404,7 @@
const ni_dbus_service_t *svc;
unsigned int i;
- if (object->interfaces == NULL)
+ if (object == NULL || object->interfaces == NULL)
return NULL;
for (i = 0; (svc = object->interfaces[i]) != NULL; ++i) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/src/dbus-objects/interface.c new/wicked-0.5.19/src/dbus-objects/interface.c
--- old/wicked-0.5.18/src/dbus-objects/interface.c 2014-03-28 14:14:45.000000000 +0100
+++ new/wicked-0.5.19/src/dbus-objects/interface.c 2014-04-14 19:21:31.000000000 +0200
@@ -374,8 +374,10 @@
object = ni_dbus_object_new(class, NULL, ni_netdev_get(dev));
}
- if (object == NULL)
- ni_fatal("Unable to create dbus object for network interface %s", dev->name);
+ if (object == NULL) {
+ ni_error("Unable to create dbus object for network interface %s", dev->name);
+ return NULL;
+ }
ni_objectmodel_bind_compatible_interfaces(object);
return object;
@@ -504,8 +506,16 @@
ni_netdev_t *
ni_objectmodel_unwrap_netif(const ni_dbus_object_t *object, DBusError *error)
{
- ni_netdev_t *dev = object->handle;
+ ni_netdev_t *dev;
+
+ if (!object) {
+ if (error)
+ dbus_set_error(error, DBUS_ERROR_FAILED,
+ "Cannot unwrap network interface from a NULL dbus object");
+ return NULL;
+ }
+ dev = object->handle;
if (ni_dbus_object_isa(object, &ni_objectmodel_netif_class))
return dev;
if (error)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/src/dbus-objects/modem.c new/wicked-0.5.19/src/dbus-objects/modem.c
--- old/wicked-0.5.18/src/dbus-objects/modem.c 2014-03-28 12:39:58.000000000 +0100
+++ new/wicked-0.5.19/src/dbus-objects/modem.c 2014-04-14 19:21:31.000000000 +0200
@@ -198,8 +198,11 @@
object = ni_dbus_object_new(class, NULL, ni_modem_hold(modem));
}
- if (object == NULL)
- ni_fatal("Unable to create proxy object for modem %s (%s)", modem->device, modem->real_path);
+ if (object == NULL) {
+ ni_error("Unable to create proxy object for modem %s (%s)",
+ modem->device, modem->real_path);
+ return NULL;
+ }
ni_objectmodel_bind_compatible_interfaces(object);
return object;
@@ -262,8 +265,16 @@
ni_modem_t *
ni_objectmodel_unwrap_modem(const ni_dbus_object_t *object, DBusError *error)
{
- ni_modem_t *modem = object->handle;
+ ni_modem_t *modem;
+
+ if (!object) {
+ if (error)
+ dbus_set_error(error, DBUS_ERROR_FAILED,
+ "Cannot unwrap modem from a NULL dbus object");
+ return NULL;
+ }
+ modem = object->handle;
if (ni_dbus_object_isa(object, &ni_objectmodel_mm_modem_class))
return modem;
if (ni_dbus_object_isa(object, &ni_objectmodel_modem_class))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/src/fsm-policy.c new/wicked-0.5.19/src/fsm-policy.c
--- old/wicked-0.5.18/src/fsm-policy.c 2014-03-18 15:10:50.000000000 +0100
+++ new/wicked-0.5.19/src/fsm-policy.c 2014-04-14 19:21:31.000000000 +0200
@@ -1180,37 +1180,71 @@
/*
* <device>...</device>
+ * device:name...
+ * device:alias...
+ * device:ifindex...
*/
static ni_bool_t
-__ni_fsm_policy_match_device_check(const ni_ifcondition_t *cond, ni_ifworker_t *w)
+__ni_fsm_policy_match_device_name_check(const ni_ifcondition_t *cond, ni_ifworker_t *w)
{
- ni_warn("<device> condition not implemented yet");
- return FALSE;
+ return ni_ifworker_match_netdev_name(w, cond->args.string);
}
-
-static ni_ifcondition_t *
-ni_ifcondition_device(xml_node_t *node)
+static ni_bool_t
+__ni_fsm_policy_match_device_alias_check(const ni_ifcondition_t *cond, ni_ifworker_t *w)
{
- ni_ifcondition_t *result;
+ return ni_ifworker_match_netdev_alias(w, cond->args.string);
+}
+static ni_bool_t
+__ni_fsm_policy_match_device_ifindex_check(const ni_ifcondition_t *cond, ni_ifworker_t *w)
+{
+ unsigned int ifindex;
- result = ni_ifcondition_new(__ni_fsm_policy_match_device_check);
- result->args.device.node = node;
- return result;
+ if (ni_parse_uint(cond->args.string, &ifindex, 10) < 0 || !ifindex)
+ return FALSE;
+ return ni_ifworker_match_netdev_ifindex(w, ifindex);
}
-/*
- * <device-alias>foobidoo</device-alias>
- */
-static ni_bool_t
-__ni_fsm_policy_match_device_alias_check(const ni_ifcondition_t *cond, ni_ifworker_t *w)
+static ni_ifcondition_t *
+ni_ifcondition_device_element(xml_node_t *node, const char *name)
{
- return ni_ifworker_match_alias(w, cond->args.string);
+ if (ni_string_eq(name, "name")) {
+ return ni_ifcondition_new_cdata(__ni_fsm_policy_match_device_name_check, node);
+ }
+ if (ni_string_eq(name, "alias")) {
+ return ni_ifcondition_new_cdata(__ni_fsm_policy_match_device_alias_check, node);
+ }
+ if (ni_string_eq(name, "ifindex")) {
+ return ni_ifcondition_new_cdata(__ni_fsm_policy_match_device_ifindex_check, node);
+ }
+ ni_error("%s: unknown device condition <%s>", xml_node_location(node), name);
+ return NULL;
}
static ni_ifcondition_t *
-ni_ifcondition_device_alias(xml_node_t *node)
+ni_ifcondition_device(xml_node_t *node)
{
- return ni_ifcondition_new_cdata(__ni_fsm_policy_match_device_alias_check, node);
+ ni_ifcondition_t *result = NULL;
+
+ if (!node->children && node->cdata)
+ return ni_ifcondition_new_cdata(__ni_fsm_policy_match_device_name_check, node);
+
+ for (node = node->children; node; node = node->next) {
+ ni_ifcondition_t *cond;
+
+ cond = ni_ifcondition_device_element(node, node->name);
+ if (cond == NULL) {
+ if (result)
+ ni_ifcondition_free(result);
+ return NULL;
+ }
+
+ if (result == NULL)
+ result = cond;
+ else
+ result = ni_ifcondition_and_terms(result, cond);
+ }
+
+ return result;
}
/*
@@ -1468,30 +1502,30 @@
return ni_ifcondition_none(node);
if (!strcmp(node->name, "type"))
return ni_ifcondition_type(node);
- if (!strcmp(node->name, "device"))
- return ni_ifcondition_device(node);
if (!strcmp(node->name, "class"))
return ni_ifcondition_class(node);
if (!strcmp(node->name, "sharable"))
return ni_ifcondition_sharable(node);
if (!strcmp(node->name, "link-type"))
return ni_ifcondition_linktype(node);
- if (!strcmp(node->name, "device-alias"))
- return ni_ifcondition_device_alias(node);
if (!strcmp(node->name, "control-mode"))
return ni_ifcondition_control_mode(node);
if (!strcmp(node->name, "boot-stage"))
return ni_ifcondition_boot_stage(node);
if (!strcmp(node->name, "minimum-device-state"))
return ni_ifcondition_min_device_state(node);
+ if (!strcmp(node->name, "device"))
+ return ni_ifcondition_device(node);
+ if (!strncmp(node->name, "device:", sizeof("device:")-1))
+ return ni_ifcondition_device_element(node, node->name + sizeof("device:")-1);
if (!strcmp(node->name, "modem"))
return ni_ifcondition_modem(node);
- if (!strncmp(node->name, "modem:", 6))
- return ni_ifcondition_modem_element(node, node->name + 6);
+ if (!strncmp(node->name, "modem:", sizeof("modem:")-1))
+ return ni_ifcondition_modem_element(node, node->name + sizeof("modem:")-1);
if (!strcmp(node->name, "wireless"))
return ni_ifcondition_wireless(node);
- if (!strncmp(node->name, "wireless:", 9))
- return ni_ifcondition_wireless_element(node, node->name + 9);
+ if (!strncmp(node->name, "wireless:", sizeof("wireless:")-1))
+ return ni_ifcondition_wireless_element(node, node->name + sizeof("wireless:")-1);
ni_error("%s: unsupported policy conditional <%s>", xml_node_location(node), node->name);
return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/src/fsm.c new/wicked-0.5.19/src/fsm.c
--- old/wicked-0.5.18/src/fsm.c 2014-03-28 14:14:45.000000000 +0100
+++ new/wicked-0.5.19/src/fsm.c 2014-04-14 19:21:31.000000000 +0200
@@ -41,9 +41,9 @@
static int ni_ifworker_bind_device_apis(ni_ifworker_t *, const ni_dbus_service_t *);
static void ni_ifworker_control_init(ni_ifworker_control_t *);
static void ni_ifworker_control_destroy(ni_ifworker_control_t *);
-static void __ni_ifworker_refresh_netdevs(ni_fsm_t *);
+static ni_bool_t __ni_ifworker_refresh_netdevs(ni_fsm_t *);
#ifdef MODEM
-static void __ni_ifworker_refresh_modems(ni_fsm_t *);
+static ni_bool_t __ni_ifworker_refresh_modems(ni_fsm_t *);
#endif
static int ni_fsm_user_prompt_default(const ni_fsm_prompt_t *, xml_node_t *, void *);
static void ni_ifworker_refresh_client_info(ni_ifworker_t *, ni_device_clientinfo_t *);
@@ -176,6 +176,10 @@
{
ni_string_free(&w->name);
ni_ifworker_reset(w);
+ if (w->device)
+ ni_netdev_put(w->device);
+ if (w->modem)
+ ni_modem_release(w->modem);
free(w);
}
@@ -593,6 +597,81 @@
}
ni_bool_t
+ni_ifworker_match_netdev_name(const ni_ifworker_t *w, const char *ifname)
+{
+ xml_node_t *node;
+
+ if (!ifname)
+ return FALSE;
+
+ if (w->device && ni_string_eq(w->device->name, ifname))
+ return TRUE;
+
+ if (w->config.node && (node = xml_node_get_child(w->config.node, "name"))) {
+ const char *namespace = xml_node_get_attr(node, "namespace");
+ if (!namespace && ni_string_eq(node->cdata, ifname))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static ni_bool_t
+__ni_ifworker_match_netdev_ifindex(unsigned int ifindex, const char *value)
+{
+ unsigned int index;
+
+ if (ni_parse_uint(value, &index, 10) < 0 || !index)
+ return FALSE;
+ return ifindex == index;
+}
+
+ni_bool_t
+ni_ifworker_match_netdev_ifindex(const ni_ifworker_t *w, unsigned int ifindex)
+{
+ xml_node_t *node;
+
+ if (!ifindex)
+ return FALSE;
+
+ if (w->device && w->device->link.ifindex == ifindex)
+ return TRUE;
+
+ if (w->config.node && (node = xml_node_get_child(w->config.node, "name"))) {
+ const char *namespace = xml_node_get_attr(node, "namespace");
+
+ if (namespace && ni_string_eq(namespace, "ifindex"))
+ return __ni_ifworker_match_netdev_ifindex(ifindex, node->cdata);
+ }
+ return FALSE;
+}
+
+ni_bool_t
+ni_ifworker_match_netdev_alias(const ni_ifworker_t *w, const char *ifalias)
+{
+ xml_node_t *node;
+
+ if (!ifalias)
+ return FALSE;
+
+ if (w->device && ni_string_eq(w->device->link.alias, ifalias))
+ return TRUE;
+
+ if (w->config.node && (node = xml_node_get_child(w->config.node, "alias"))) {
+ if (ni_string_eq(node->cdata, ifalias))
+ return TRUE;
+ }
+ if (w->config.node && (node = xml_node_get_child(w->config.node, "name"))) {
+ const char *namespace = xml_node_get_attr(node, "namespace");
+
+ if (namespace && ni_string_eq(namespace, "alias"))
+ return ni_string_eq(node->cdata, ifalias);
+ }
+
+ return FALSE;
+}
+
+ni_bool_t
ni_ifworker_match_alias(const ni_ifworker_t *w, const char *alias)
{
xml_node_t *node;
@@ -603,7 +682,7 @@
if (w->device && ni_string_eq(w->device->link.alias, alias))
return TRUE;
- if (w->config.node && (node = xml_node_get_child(w->config.node, "alias")) != NULL) {
+ if (w->config.node && (node = xml_node_get_child(w->config.node, "alias"))) {
if (ni_string_eq(node->cdata, alias))
return TRUE;
}
@@ -2373,7 +2452,7 @@
}
}
-void
+ni_bool_t
ni_fsm_refresh_state(ni_fsm_t *fsm)
{
ni_ifworker_t *w;
@@ -2390,9 +2469,11 @@
w->readonly = fsm->readonly;
}
- __ni_ifworker_refresh_netdevs(fsm);
+ if (!__ni_ifworker_refresh_netdevs(fsm))
+ return FALSE;
#ifdef MODEM
- __ni_ifworker_refresh_modems(fsm);
+ if (!__ni_ifworker_refresh_modems(fsm))
+ return FALSE;
#endif
for (i = 0; i < fsm->workers.count; ++i) {
@@ -2416,23 +2497,29 @@
} else if (!w->done)
ni_ifworker_update_state(w, NI_FSM_STATE_DEVICE_EXISTS, __NI_FSM_STATE_MAX);
}
+ return TRUE;
}
-static void
+static ni_bool_t
__ni_ifworker_refresh_netdevs(ni_fsm_t *fsm)
{
static ni_dbus_object_t *list_object = NULL;
ni_dbus_object_t *object;
- if (!list_object && !(list_object = ni_call_get_netif_list_object()))
- ni_fatal("unable to get server's interface list");
+ if (!list_object && !(list_object = ni_call_get_netif_list_object())) {
+ ni_error("unable to get server's interface list");
+ return FALSE;
+ }
/* Call ObjectManager.GetManagedObjects to get list of objects and their properties */
- if (!ni_dbus_object_refresh_children(list_object))
- ni_fatal("Couldn't refresh list of active network interfaces");
+ if (!ni_dbus_object_refresh_children(list_object)) {
+ ni_error("Couldn't refresh list of active network interfaces");
+ return FALSE;
+ }
for (object = list_object->children; object; object = object->next)
ni_fsm_recv_new_netif(fsm, object, FALSE);
+ return TRUE;
}
ni_ifworker_t *
@@ -2493,30 +2580,37 @@
static ni_dbus_object_t *list_object = NULL;
ni_dbus_object_t *object;
- if (!list_object && !(list_object = ni_call_get_netif_list_object()))
- ni_fatal("unable to get server's netdev list");
+ if (!list_object && !(list_object = ni_call_get_netif_list_object())) {
+ ni_error("unable to get server's netdev list");
+ return NULL;
+ }
object = ni_dbus_object_create(list_object, path, NULL, NULL);
return ni_fsm_recv_new_netif(fsm, object, TRUE);
}
#ifdef MODEM
-static void
+static ni_bool_t
__ni_ifworker_refresh_modems(ni_fsm_t *fsm)
{
static ni_dbus_object_t *list_object = NULL;
ni_dbus_object_t *object;
- if (!list_object && !(list_object = ni_call_get_modem_list_object()))
- ni_fatal("unable to get server's modem list");
+ if (!list_object && !(list_object = ni_call_get_modem_list_object())) {
+ ni_error("unable to get server's modem list");
+ return FALSE;
+ }
/* Call ObjectManager.GetManagedObjects to get list of objects and their properties */
- if (!ni_dbus_object_refresh_children(list_object))
- ni_fatal("Couldn't refresh list of available modems");
+ if (!ni_dbus_object_refresh_children(list_object)) {
+ ni_error("Couldn't refresh list of available modems");
+ return FALSE;
+ }
for (object = list_object->children; object; object = object->next) {
ni_fsm_recv_new_modem(fsm, object, FALSE);
}
+ return TRUE;
}
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/src/ifevent.c new/wicked-0.5.19/src/ifevent.c
--- old/wicked-0.5.18/src/ifevent.c 2014-02-25 14:03:37.000000000 +0100
+++ new/wicked-0.5.19/src/ifevent.c 2014-04-14 19:21:31.000000000 +0200
@@ -144,6 +144,13 @@
return rv;
}
+static inline ni_bool_t
+__ni_netdev_still_exists(unsigned int ifindex)
+{
+ char namebuf[IF_NAMESIZE+1] = {'\0'};
+ return if_indextoname(ifindex, namebuf) != NULL;
+}
+
/*
* Process NEWLINK event
*/
@@ -169,6 +176,16 @@
}
old = ni_netdev_by_index(nc, ifi->ifi_index);
+ if (!__ni_netdev_still_exists(ifi->ifi_index)) {
+ if (old) {
+ __ni_netdev_event(nc, old, NI_EVENT_DEVICE_DELETE);
+ ni_netconfig_device_remove(nc, old);
+ ni_client_state_drop(old->link.ifindex);
+ return 0;
+ }
+ return -1;
+ }
+
if (old != NULL) {
old_flags = old->link.ifflags;
dev = old;
@@ -244,6 +261,8 @@
{
struct ifinfomsg *ifi;
ni_netdev_t *dev;
+ struct nlattr *nla;
+ const char *ifname = NULL;
if (!(ifi = ni_rtnl_ifinfomsg(h, RTM_DELLINK)))
return -1;
@@ -253,9 +272,14 @@
return 0;
}
+ if ((nla = nlmsg_find_attr(h, sizeof(*ifi), IFLA_IFNAME)) != NULL) {
+ ifname = (char *) nla_data(nla);
+ }
+
/* Open code interface removal. */
if ((dev = ni_netdev_by_index(nc, ifi->ifi_index)) == NULL) {
- ni_error("bad RTM_DELLINK message for unknown interface index %d", ifi->ifi_index);
+ ni_debug_events("RTM_DELLINK message for unknown interface %s index %d",
+ ifname, ifi->ifi_index);
return -1;
} else {
dev->link.ifflags = __ni_netdev_translate_ifflags(ifi->ifi_flags);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wicked-0.5.18/wicked.spec new/wicked-0.5.19/wicked.spec
--- old/wicked-0.5.18/wicked.spec 2014-03-28 19:43:13.000000000 +0100
+++ new/wicked-0.5.19/wicked.spec 2014-04-14 19:25:19.000000000 +0200
@@ -18,7 +18,7 @@
%define release_prefix %{?snapshot:%{snapshot}}%{!?snapshot:0}
Name: wicked
-Version: 0.5.18
+Version: 0.5.19
Release: %{release_prefix}.0.0
Summary: Network configuration infrastructure
License: GPL-2.0
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org