From patchwork Tue Jul 15 09:51:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Schulz X-Patchwork-Id: 369923 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5EFB1140144 for ; Tue, 15 Jul 2014 19:51:19 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758583AbaGOJvO (ORCPT ); Tue, 15 Jul 2014 05:51:14 -0400 Received: from server721-han.de-nserver.de ([85.158.180.102]:46901 "EHLO server721-han.de-nserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758516AbaGOJvJ (ORCPT ); Tue, 15 Jul 2014 05:51:09 -0400 Received: (qmail 24122 invoked from network); 15 Jul 2014 11:51:07 +0200 X-Fcrdns: Yes Received: from a89-182-115-105.net-htp.de (HELO onion.schulz.ip-v6.eu) (89.182.115.105) (smtp-auth username mail@kristov.de, mechanism plain) by server721-han.de-nserver.de (qpsmtpd/0.92) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPSA; Tue, 15 Jul 2014 11:51:07 +0200 Received: from [2001:6f8:13da:1:c000:b5ec:3f20:baa] (helo=peacock.schulz.ip-v6.eu) by onion.schulz.ip-v6.eu with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.80.1) (envelope-from ) id 1X6zO4-0001td-L8; Tue, 15 Jul 2014 11:51:05 +0200 Received: from peacock.schulz.ip-v6.eu ([2001:6f8:13da:1:225:22ff:fe6c:68f4]) by peacock.schulz.ip-v6.eu with esmtps (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1X6zO4-0004N7-3U; Tue, 15 Jul 2014 11:51:04 +0200 Message-ID: <53C4F987.1040401@kristov.de> Date: Tue, 15 Jul 2014 11:51:03 +0200 From: Christoph Schulz User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "netdev@vger.kernel.org" CC: linux-ppp@vger.kernel.org, Paul Mackerras Subject: [PATCH net-next 1/1] net: ppp: reset nextseq counter when enabling SC_MULTILINK X-User-Auth: Auth by mail@kristov.de through 89.182.115.105 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Christoph Schulz If using a demand-dialled PPP unit for a PPP multilink master, the pppd daemon needs to reset the sequence counter between two connections. This allows the daemon to reuse the PPP unit instead of destroying and recreating it. As there is no API to reset the counter, this patch resets the counter whenever the SC_MULTILINK flag is set. Signed-off-by: Christoph Schulz --- Note that the stock pppd does not yet support multilink PPP over a demand-dialled interface. I used a locally patched version for testing. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 91d6c12..a0aae43 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c @@ -661,6 +661,8 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) break; ppp_lock(ppp); cflags = ppp->flags & ~val; + if (!(ppp->flags & SC_MULTILINK) && (val & SC_MULTILINK)) + ppp->nextseq = 0; ppp->flags = val & SC_FLAG_BITS; ppp_unlock(ppp); if (cflags & SC_CCP_OPEN)