Lines 89-97
_LOG_DECLARE_SELF (NMDevice);
Link Here
|
89 |
#define CARRIER_WAIT_TIME_MS 5000 |
89 |
#define CARRIER_WAIT_TIME_MS 5000 |
90 |
#define CARRIER_WAIT_TIME_AFTER_MTU_MS 10000 |
90 |
#define CARRIER_WAIT_TIME_AFTER_MTU_MS 10000 |
91 |
|
91 |
|
92 |
#define CARRIER_DEFER_TIME_MS 4000 |
|
|
93 |
#define CARRIER_DEFER_TIME_AFTER_MTU_MS 10000 |
94 |
|
95 |
#define NM_DEVICE_AUTH_RETRIES_UNSET -1 |
92 |
#define NM_DEVICE_AUTH_RETRIES_UNSET -1 |
96 |
#define NM_DEVICE_AUTH_RETRIES_INFINITY -2 |
93 |
#define NM_DEVICE_AUTH_RETRIES_INFINITY -2 |
97 |
#define NM_DEVICE_AUTH_RETRIES_DEFAULT 3 |
94 |
#define NM_DEVICE_AUTH_RETRIES_DEFAULT 3 |
Lines 338-344
typedef struct _NMDevicePrivate {
Link Here
|
338 |
* NM changes the MTU it sets @carrier_wait_until_ms to CARRIER_WAIT_TIME_AFTER_MTU_MS |
335 |
* NM changes the MTU it sets @carrier_wait_until_ms to CARRIER_WAIT_TIME_AFTER_MTU_MS |
339 |
* in the future. This is used to extend the grace period in this particular case. */ |
336 |
* in the future. This is used to extend the grace period in this particular case. */ |
340 |
gint64 carrier_wait_until_ms; |
337 |
gint64 carrier_wait_until_ms; |
341 |
gint64 carrier_defer_until_ms; |
|
|
342 |
|
338 |
|
343 |
bool carrier:1; |
339 |
bool carrier:1; |
344 |
bool ignore_carrier:1; |
340 |
bool ignore_carrier:1; |
Lines 534-539
static gboolean addrconf6_start_with_link_ready (NMDevice *self);
Link Here
|
534 |
static NMActStageReturn linklocal6_start (NMDevice *self); |
530 |
static NMActStageReturn linklocal6_start (NMDevice *self); |
535 |
|
531 |
|
536 |
static void _carrier_wait_check_queued_act_request (NMDevice *self); |
532 |
static void _carrier_wait_check_queued_act_request (NMDevice *self); |
|
|
533 |
static gint64 _get_carrier_wait_ms (NMDevice *self); |
537 |
|
534 |
|
538 |
static const char *_activation_func_to_string (ActivationHandleFunc func); |
535 |
static const char *_activation_func_to_string (ActivationHandleFunc func); |
539 |
static void activation_source_handle_cb (NMDevice *self, int addr_family); |
536 |
static void activation_source_handle_cb (NMDevice *self, int addr_family); |
Lines 2528-2534
nm_device_set_carrier (NMDevice *self, gboolean carrier)
Link Here
|
2528 |
gint64 now_ms, until_ms; |
2525 |
gint64 now_ms, until_ms; |
2529 |
|
2526 |
|
2530 |
now_ms = nm_utils_get_monotonic_timestamp_ms (); |
2527 |
now_ms = nm_utils_get_monotonic_timestamp_ms (); |
2531 |
until_ms = NM_MAX (now_ms + CARRIER_DEFER_TIME_MS, priv->carrier_defer_until_ms); |
2528 |
until_ms = NM_MAX (now_ms + _get_carrier_wait_ms (self), priv->carrier_wait_until_ms); |
2532 |
priv->carrier_defer_id = g_timeout_add (until_ms - now_ms, carrier_disconnected_action_cb, self); |
2529 |
priv->carrier_defer_id = g_timeout_add (until_ms - now_ms, carrier_disconnected_action_cb, self); |
2533 |
_LOGD (LOGD_DEVICE, "carrier: link disconnected (deferring action for %ld milli seconds) (id=%u)", |
2530 |
_LOGD (LOGD_DEVICE, "carrier: link disconnected (deferring action for %ld milli seconds) (id=%u)", |
2534 |
(long) (until_ms - now_ms), priv->carrier_defer_id); |
2531 |
(long) (until_ms - now_ms), priv->carrier_defer_id); |
Lines 7415-7421
_commit_mtu (NMDevice *self, const NMIP4Config *config)
Link Here
|
7415 |
if ( (mtu_desired && mtu_desired != mtu_plat) |
7412 |
if ( (mtu_desired && mtu_desired != mtu_plat) |
7416 |
|| (ip6_mtu && ip6_mtu != _IP6_MTU_SYS ())) { |
7413 |
|| (ip6_mtu && ip6_mtu != _IP6_MTU_SYS ())) { |
7417 |
gboolean anticipated_failure = FALSE; |
7414 |
gboolean anticipated_failure = FALSE; |
7418 |
gint64 now_ms; |
|
|
7419 |
|
7415 |
|
7420 |
if (!priv->mtu_initial && !priv->ip6_mtu_initial) { |
7416 |
if (!priv->mtu_initial && !priv->ip6_mtu_initial) { |
7421 |
/* before touching any of the MTU paramters, record the |
7417 |
/* before touching any of the MTU paramters, record the |
Lines 7434-7442
_commit_mtu (NMDevice *self, const NMIP4Config *config)
Link Here
|
7434 |
? "Are the MTU sizes of the slaves large enough?" |
7430 |
? "Are the MTU sizes of the slaves large enough?" |
7435 |
: "Did you configure the MTU correctly?")); |
7431 |
: "Did you configure the MTU correctly?")); |
7436 |
} |
7432 |
} |
7437 |
now_ms = nm_utils_get_monotonic_timestamp_ms (); |
7433 |
priv->carrier_wait_until_ms = nm_utils_get_monotonic_timestamp_ms () + CARRIER_WAIT_TIME_AFTER_MTU_MS; |
7438 |
priv->carrier_wait_until_ms = now_ms + CARRIER_WAIT_TIME_AFTER_MTU_MS; |
|
|
7439 |
priv->carrier_defer_until_ms = now_ms + CARRIER_DEFER_TIME_AFTER_MTU_MS; |
7440 |
} |
7434 |
} |
7441 |
|
7435 |
|
7442 |
if (ip6_mtu && ip6_mtu != _IP6_MTU_SYS ()) { |
7436 |
if (ip6_mtu && ip6_mtu != _IP6_MTU_SYS ()) { |
Lines 7451-7459
_commit_mtu (NMDevice *self, const NMIP4Config *config)
Link Here
|
7451 |
? ": Is the underlying MTU value successfully set?" |
7445 |
? ": Is the underlying MTU value successfully set?" |
7452 |
: ""); |
7446 |
: ""); |
7453 |
} |
7447 |
} |
7454 |
now_ms = nm_utils_get_monotonic_timestamp_ms (); |
7448 |
priv->carrier_wait_until_ms = nm_utils_get_monotonic_timestamp_ms () + CARRIER_WAIT_TIME_AFTER_MTU_MS; |
7455 |
priv->carrier_wait_until_ms = now_ms + CARRIER_WAIT_TIME_AFTER_MTU_MS; |
|
|
7456 |
priv->carrier_defer_until_ms = now_ms + CARRIER_DEFER_TIME_AFTER_MTU_MS; |
7457 |
} |
7449 |
} |
7458 |
} |
7450 |
} |
7459 |
#undef _IP6_MTU_SYS |
7451 |
#undef _IP6_MTU_SYS |
Lines 12581-12592
nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason, CleanupType clean
Link Here
|
12581 |
_LOGT (LOGD_DEVICE, "mtu: reset device-mtu: %u, ipv6-mtu: %u, ifindex: %d", |
12573 |
_LOGT (LOGD_DEVICE, "mtu: reset device-mtu: %u, ipv6-mtu: %u, ifindex: %d", |
12582 |
(guint) priv->mtu_initial, (guint) priv->ip6_mtu_initial, ifindex); |
12574 |
(guint) priv->mtu_initial, (guint) priv->ip6_mtu_initial, ifindex); |
12583 |
if (priv->mtu_initial) { |
12575 |
if (priv->mtu_initial) { |
12584 |
gint64 now; |
|
|
12585 |
|
12586 |
nm_platform_link_set_mtu (nm_device_get_platform (self), ifindex, priv->mtu_initial); |
12576 |
nm_platform_link_set_mtu (nm_device_get_platform (self), ifindex, priv->mtu_initial); |
12587 |
now = nm_utils_get_monotonic_timestamp_ms (); |
12577 |
priv->carrier_wait_until_ms = nm_utils_get_monotonic_timestamp_ms () + CARRIER_WAIT_TIME_AFTER_MTU_MS; |
12588 |
priv->carrier_wait_until_ms = now + CARRIER_WAIT_TIME_AFTER_MTU_MS; |
|
|
12589 |
priv->carrier_defer_until_ms = now + CARRIER_DEFER_TIME_AFTER_MTU_MS; |
12590 |
} |
12578 |
} |
12591 |
if (priv->ip6_mtu_initial) { |
12579 |
if (priv->ip6_mtu_initial) { |
12592 |
char sbuf[64]; |
12580 |
char sbuf[64]; |
12593 |
- |
|
|