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 835238 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 v2] ethernet: add reconnect delay for PPPoE connections (rh #602265)
0001-ethernet-add-reconnect-delay-for-PPPoE-connections-r.patch (text/plain), 5.28 KB, created by
Jirka Klimes
on 2013-12-11 11:47:37 UTC
(
hide
)
Description:
[PATCH v2] ethernet: add reconnect delay for PPPoE connections (rh #602265)
Filename:
MIME Type:
Creator:
Jirka Klimes
Created:
2013-12-11 11:47:37 UTC
Size:
5.28 KB
patch
obsolete
>From 64f2ee0de23fd635c18a59cbdc3d09c178b52a26 Mon Sep 17 00:00:00 2001 >From: Dan Williams <dcbw@redhat.com> >Date: Mon, 9 Dec 2013 09:33:13 +0100 >Subject: [PATCH] ethernet: add reconnect delay for PPPoE connections (rh > #602265) >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Attempting an immediate reconnect if the peer terminates the connection >sometimes results in the peer not being ready to negotiate a new >connection, while a short delay allows the peer to correctly tear >down the old connection and get listen for a new one. Introduce >a short delay when activating a PPPoE connection if a PPPoE >connection was recently deactivated. > >Rebased to master by jklimes. > >Signed-off-by: JiÅà KlimeÅ¡ <jklimes@redhat.com> >--- > src/devices/nm-device-ethernet.c | 62 ++++++++++++++++++++++++++++++++++------ > 1 file changed, 53 insertions(+), 9 deletions(-) > >diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c >index 062134b..9c4250d 100644 >--- a/src/devices/nm-device-ethernet.c >+++ b/src/devices/nm-device-ethernet.c >@@ -15,7 +15,7 @@ > * with this program; if not, write to the Free Software Foundation, Inc., > * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > * >- * Copyright (C) 2005 - 2012 Red Hat, Inc. >+ * Copyright (C) 2005 - 2013 Red Hat, Inc. > * Copyright (C) 2006 - 2008 Novell, Inc. > */ > >@@ -66,8 +66,12 @@ G_DEFINE_TYPE (NMDeviceEthernet, nm_device_ethernet, NM_TYPE_DEVICE) > > #define WIRED_SECRETS_TRIES "wired-secrets-tries" > >+#define PPPOE_RECONNECT_DELAY 7 >+ > #define NM_ETHERNET_ERROR (nm_ethernet_error_quark ()) > >+static NMSetting *device_get_setting (NMDevice *device, GType setting_type); >+ > typedef struct Supplicant { > NMSupplicantManager *mgr; > NMSupplicantInterface *iface; >@@ -99,6 +103,8 @@ typedef struct { > /* PPPoE */ > NMPPPManager *ppp_manager; > NMIP4Config *pending_ip4_config; >+ time_t last_pppoe_time; >+ guint pppoe_wait_id; > } NMDeviceEthernetPrivate; > > enum { >@@ -272,15 +278,10 @@ device_state_changed (NMDevice *device, > NMDeviceState old_state, > NMDeviceStateReason reason) > { >- switch (new_state) { >- case NM_DEVICE_STATE_ACTIVATED: >- case NM_DEVICE_STATE_FAILED: >- case NM_DEVICE_STATE_DISCONNECTED: >+ if ( new_state == NM_DEVICE_STATE_ACTIVATED >+ || new_state == NM_DEVICE_STATE_FAILED >+ || new_state == NM_DEVICE_STATE_DISCONNECTED) > clear_secrets_tries (device); >- break; >- default: >- break; >- } > } > > static void >@@ -891,14 +892,29 @@ supplicant_interface_init (NMDeviceEthernet *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)); >+ 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); > >@@ -914,6 +930,25 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) > 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) >+ */ >+ 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; >+ } > } > > return ret; >@@ -1141,6 +1176,11 @@ deactivate (NMDevice *device) > /* Clear wired secrets tries when deactivating */ > clear_secrets_tries (device); > >+ if (priv->pppoe_wait_id) { >+ g_source_remove (priv->pppoe_wait_id); >+ priv->pppoe_wait_id = 0; >+ } >+ > if (priv->pending_ip4_config) { > g_object_unref (priv->pending_ip4_config); > priv->pending_ip4_config = NULL; >@@ -1164,6 +1204,10 @@ deactivate (NMDevice *device) > } > } > >+ /* Set last PPPoE connection time */ >+ if (device_get_setting (device, NM_TYPE_SETTING_PPPOE)) >+ NM_DEVICE_ETHERNET_GET_PRIVATE (device)->last_pppoe_time = time (NULL); >+ > /* Reset MAC address back to initial address */ > nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_ETHER); > } >-- >1.7.11.7 >
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