Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 835245 Details for
Bug 1023503
Port RHEL 6.5 PPPoE reconnect delay to git master
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
[PATCH] fixup! ethernet: add reconnect delay for PPPoE connections (rh #602265)
0001-fixup-ethernet-add-reconnect-delay-for-PPPoE-connect.patch (text/plain), 7.21 KB, created by
Thomas Haller
on 2013-12-11 12:14:20 UTC
(
hide
)
Description:
[PATCH] fixup! ethernet: add reconnect delay for PPPoE connections (rh #602265)
Filename:
MIME Type:
Creator:
Thomas Haller
Created:
2013-12-11 12:14:20 UTC
Size:
7.21 KB
patch
obsolete
>From 8d299e80ff8c1f738b1d5f21de68812e132e7d88 Mon Sep 17 00:00:00 2001 >From: Thomas Haller <thaller@redhat.com> >Date: Wed, 11 Dec 2013 13:10:37 +0100 >Subject: [PATCH 1/1] fixup! ethernet: add reconnect delay for PPPoE > connections (rh #602265) > >--- > src/devices/nm-device-ethernet.c | 35 ++++++++++++++++++++--------------- > 1 file changed, 20 insertions(+), 15 deletions(-) > >diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c >index 9c4250d..3167e95 100644 >--- a/src/devices/nm-device-ethernet.c >+++ b/src/devices/nm-device-ethernet.c >@@ -872,109 +872,109 @@ supplicant_interface_init (NMDeviceEthernet *self) > iface); > supplicant_interface_release (self); > return FALSE; > } > > /* Listen for it's state signals */ > priv->supplicant.iface_state_id = g_signal_connect (priv->supplicant.iface, > NM_SUPPLICANT_INTERFACE_STATE, > G_CALLBACK (supplicant_iface_state_cb), > self); > > /* Hook up error signal handler to capture association errors */ > priv->supplicant.iface_error_id = g_signal_connect (priv->supplicant.iface, > "connection-error", > G_CALLBACK (supplicant_iface_connection_error_cb), > self); > > /* Set up a timeout on the connection attempt to fail it after 25 seconds */ > priv->supplicant.con_timeout_id = g_timeout_add_seconds (25, supplicant_connection_timeout_cb, self); > > return TRUE; > } > > static gboolean > pppoe_reconnect_delay (gpointer user_data) > { > NMDevice *device = NM_DEVICE (user_data); > NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); > > priv->pppoe_wait_id = 0; >- nm_device_activate_schedule_stage2_device_config (device); > nm_log_info (LOGD_DEVICE, "(%s) PPPoE reconnect delay complete, resuming connection...", > nm_device_get_iface (device)); >+ nm_device_activate_schedule_stage2_device_config (device); > return FALSE; > } > > static NMActStageReturn > act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) > { > NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); > NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); > NMActRequest *req; > NMSettingWired *s_wired; > const GByteArray *cloned_mac; > NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS; >- time_t delay; > > g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); > > ret = NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->act_stage1_prepare (dev, reason); > if (ret == NM_ACT_STAGE_RETURN_SUCCESS) { > req = nm_device_get_act_request (NM_DEVICE (self)); > g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE); > > s_wired = (NMSettingWired *) device_get_setting (dev, NM_TYPE_SETTING_WIRED); > if (s_wired) { > /* Set device MAC address if the connection wants to change it */ > cloned_mac = nm_setting_wired_get_cloned_mac_address (s_wired); > if (cloned_mac && (cloned_mac->len == ETH_ALEN)) > nm_device_set_hw_addr (dev, cloned_mac->data, "set", LOGD_ETHER); > } > > /* If we're re-activating a PPPoE connection a short while after > * a previous PPPoE connection was torn down, wait a bit to allow the > * remote side to handle the disconnection. Otherwise the peer may >- * get confused and fail to negotiate the new connection. (rh #602265) >+ * get confused and fail to negotiate the new connection. > */ >- delay = time (NULL) - priv->last_pppoe_time; >- if ( device_get_setting (dev, NM_TYPE_SETTING_PPPOE) >- && (delay < PPPOE_RECONNECT_DELAY)) { >- nm_log_info (LOGD_DEVICE, "(%s) delaying PPPoE reconnect to ensure peer is ready...", >- nm_device_get_iface (dev)); >- g_warn_if_fail (priv->pppoe_wait_id == 0); >- if (priv->pppoe_wait_id) >- g_source_remove (priv->pppoe_wait_id); >- priv->pppoe_wait_id = g_timeout_add_seconds (delay, >- pppoe_reconnect_delay, >- self); >- ret = NM_ACT_STAGE_RETURN_POSTPONE; >+ if (priv->last_pppoe_time) { >+ time_t delay = time (NULL) - priv->last_pppoe_time; >+ >+ if (delay < PPPOE_RECONNECT_DELAY) { >+ nm_log_info (LOGD_DEVICE, "(%s) delaying PPPoE reconnect to ensure peer is ready...", >+ nm_device_get_iface (dev)); >+ g_assert (!priv->pppoe_wait_id); >+ priv->pppoe_wait_id = g_timeout_add_seconds (delay, >+ pppoe_reconnect_delay, >+ self); >+ ret = NM_ACT_STAGE_RETURN_POSTPONE; >+ } else >+ priv->last_pppoe_time = 0; > } > } > > return ret; > } > > static NMActStageReturn > nm_8021x_stage2_config (NMDeviceEthernet *self, NMDeviceStateReason *reason) > { > NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); > NMConnection *connection; > NMSetting8021x *security; > const char *setting_name; > const char *iface; > NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; > > connection = nm_device_get_connection (NM_DEVICE (self)); > g_assert (connection); > security = nm_connection_get_setting_802_1x (connection); > if (!security) { > nm_log_err (LOGD_DEVICE, "Invalid or missing 802.1X security"); > *reason = NM_DEVICE_STATE_REASON_CONFIG_FAILED; > return ret; > } > > if (!priv->supplicant.mgr) > priv->supplicant.mgr = nm_supplicant_manager_get (); > > iface = nm_device_get_iface (NM_DEVICE (self)); > >@@ -1364,60 +1364,65 @@ get_link_speed (NMDevice *device) > return; > > priv->speed = speed; > g_object_notify (G_OBJECT (device), "speed"); > > nm_log_dbg (LOGD_HW | LOGD_ETHER, "(%s): speed is now %d Mb/s", > nm_device_get_iface (device), speed); > } > > static void > carrier_changed (NMDevice *device, gboolean carrier) > { > if (carrier) > get_link_speed (device); > > NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->carrier_changed (device, carrier); > } > > static void > dispose (GObject *object) > { > NMDeviceEthernet *self = NM_DEVICE_ETHERNET (object); > NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); > > g_clear_object (&priv->supplicant.mgr); > g_free (priv->subchan1); > g_free (priv->subchan2); > g_free (priv->subchan3); > g_free (priv->subchannels); > >+ if (priv->pppoe_wait_id) { >+ g_source_remove (priv->pppoe_wait_id); >+ priv->pppoe_wait_id = 0; >+ } >+ > G_OBJECT_CLASS (nm_device_ethernet_parent_class)->dispose (object); > } > > static void > get_property (GObject *object, guint prop_id, > GValue *value, GParamSpec *pspec) > { > NMDeviceEthernet *self = NM_DEVICE_ETHERNET (object); > NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); > > switch (prop_id) { > case PROP_PERM_HW_ADDRESS: > g_value_take_string (value, nm_utils_hwaddr_ntoa (&priv->perm_hw_addr, ARPHRD_ETHER)); > break; > case PROP_SPEED: > g_value_set_uint (value, priv->speed); > break; > default: > G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); > break; > } > } > > static void > set_property (GObject *object, guint prop_id, > const GValue *value, GParamSpec *pspec) > { > switch (prop_id) { > default: > G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); >-- >1.8.5.rc3.2.gc302941 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1023503
:
816194
|
834237
|
835238
| 835245