Skip to content

Commit

Permalink
Merge pull request #382 from mtomaschewski/ipv6-tentative-1
Browse files Browse the repository at this point in the history
ipv6: wait for addresses to become usable (bnc#882259)
  • Loading branch information
mtomaschewski committed Aug 27, 2014
2 parents 59e5d8c + 38f6f58 commit 90e310e
Show file tree
Hide file tree
Showing 7 changed files with 323 additions and 59 deletions.
3 changes: 2 additions & 1 deletion client/ifstatus.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ __ifstatus_of_device_leases(ni_netdev_t *dev, unsigned int *st)
if (lease->state == NI_ADDRCONF_STATE_NONE)
continue;

if (lease->state == NI_ADDRCONF_STATE_RELEASING ||
if (lease->state == NI_ADDRCONF_STATE_APPLYING ||
lease->state == NI_ADDRCONF_STATE_RELEASING ||
lease->state == NI_ADDRCONF_STATE_REQUESTING) {
if (!__is_peer_lease_up(dev, lease)) {
*st = NI_WICKED_ST_IN_PROGRESS;
Expand Down
6 changes: 6 additions & 0 deletions include/wicked/addrconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ enum {
enum {
NI_ADDRCONF_STATE_NONE,
NI_ADDRCONF_STATE_REQUESTING,
NI_ADDRCONF_STATE_APPLYING,
NI_ADDRCONF_STATE_GRANTED,
NI_ADDRCONF_STATE_RELEASING,
NI_ADDRCONF_STATE_RELEASED,
Expand Down Expand Up @@ -79,9 +80,14 @@ typedef enum ni_dhcp6_mode {
struct ni_dhcp6_status;
struct ni_dhcp6_ia;

typedef struct ni_addrconf_updater ni_addrconf_updater_t;

struct ni_addrconf_lease {
ni_addrconf_lease_t * next;

ni_addrconf_updater_t * updater; /* update actions */
ni_addrconf_lease_t * old; /* replaced old lease */

unsigned int seqno; /* globally unique sequence # */
ni_addrconf_mode_t type;
unsigned int family;
Expand Down
5 changes: 4 additions & 1 deletion src/dbus-objects/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,11 @@ ni_objectmodel_addrconf_signal_handler(ni_dbus_connection_t *conn, ni_dbus_messa
*
* Note, lease may be NULL after this, as the interface object
* takes ownership of it.
*
* Return code 0 is success, < 0 error where we do not emit events.
*/
__ni_system_interface_update_lease(ifp, &lease);
if (__ni_system_interface_update_lease(ifp, &lease) < 0)
goto done;

/* Potentially, there's a client somewhere waiting for that event.
* We use the UUID that's passed back and forth to make sure we
Expand Down
1 change: 1 addition & 0 deletions src/fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4175,6 +4175,7 @@ address_acquired_callback_handler(ni_ifworker_t *w, const ni_objectmodel_callbac
ni_stringbuf_destroy(&buf);

if (other->state == NI_ADDRCONF_STATE_GRANTED ||
other->state == NI_ADDRCONF_STATE_APPLYING ||
other->state == NI_ADDRCONF_STATE_REQUESTING)
return TRUE;
}
Expand Down
Loading

0 comments on commit 90e310e

Please sign in to comment.