netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/1] net: ppp: reset nextseq counter when enabling SC_MULTILINK
@ 2014-07-15  9:51 Christoph Schulz
  2014-07-16  5:52 ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Schulz @ 2014-07-15  9:51 UTC (permalink / raw)
  To: netdev; +Cc: linux-ppp, Paul Mackerras

From: Christoph Schulz <develop@kristov.de>

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 <develop@kristov.de>
---
Note that the stock pppd does not yet support multilink PPP over a
demand-dialled interface. I used a locally patched version for testing.

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)

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 1/1] net: ppp: reset nextseq counter when enabling SC_MULTILINK
  2014-07-15  9:51 [PATCH net-next 1/1] net: ppp: reset nextseq counter when enabling SC_MULTILINK Christoph Schulz
@ 2014-07-16  5:52 ` David Miller
  2014-07-16 21:19   ` Christoph Schulz
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2014-07-16  5:52 UTC (permalink / raw)
  To: develop; +Cc: netdev, linux-ppp, paulus

From: Christoph Schulz <develop@kristov.de>
Date: Tue, 15 Jul 2014 11:51:03 +0200

> From: Christoph Schulz <develop@kristov.de>
> 
> 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 <develop@kristov.de>
> ---
> Note that the stock pppd does not yet support multilink PPP over a
> demand-dialled interface. I used a locally patched version for testing.

Applied, thanks Christoph.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 1/1] net: ppp: reset nextseq counter when enabling SC_MULTILINK
  2014-07-16  5:52 ` David Miller
@ 2014-07-16 21:19   ` Christoph Schulz
  2014-07-16 21:24     ` Christoph Schulz
  2014-07-16 21:27     ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Christoph Schulz @ 2014-07-16 21:19 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-ppp, paulus

Hello!

David Miller schrieb am Tue, 15 Jul 2014 22:52:59 -0700 (PDT):

> Applied, thanks Christoph.

Sorry, the extra code has to be surrounded by

#ifdef CONFIG_PPP_MULTILINK
...
#endif

I will submit an updated patch ASAP.


Best regards,

Christoph Schulz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 1/1] net: ppp: reset nextseq counter when enabling SC_MULTILINK
  2014-07-16 21:19   ` Christoph Schulz
@ 2014-07-16 21:24     ` Christoph Schulz
  2014-07-16 21:27       ` David Miller
  2014-07-16 21:27     ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Christoph Schulz @ 2014-07-16 21:24 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-ppp, paulus

Hello!

Christoph Schulz schrieb am Wed, 16 Jul 2014 23:19:50 +0200:

> I will submit an updated patch ASAP.

Sorry, how should I do it? Based on the *current* state of net-next,  
i.e. based on my original (but incomplete) patch? Or based on the  
net-next tree before my original patch was included?


Thank you in advance,

Christoph Schulz


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 1/1] net: ppp: reset nextseq counter when enabling SC_MULTILINK
  2014-07-16 21:19   ` Christoph Schulz
  2014-07-16 21:24     ` Christoph Schulz
@ 2014-07-16 21:27     ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2014-07-16 21:27 UTC (permalink / raw)
  To: develop; +Cc: netdev, linux-ppp, paulus

From: Christoph Schulz <develop@kristov.de>
Date: Wed, 16 Jul 2014 23:19:50 +0200

> I will submit an updated patch ASAP.

"updated patch" makes no sense in this context, your patch has been applied
already.  Therefore you have to submit a relative patch that fixes the problem.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 1/1] net: ppp: reset nextseq counter when enabling SC_MULTILINK
  2014-07-16 21:24     ` Christoph Schulz
@ 2014-07-16 21:27       ` David Miller
  2014-07-16 21:48         ` Christoph Schulz
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2014-07-16 21:27 UTC (permalink / raw)
  To: develop; +Cc: netdev, linux-ppp, paulus

From: Christoph Schulz <develop@kristov.de>
Date: Wed, 16 Jul 2014 23:24:43 +0200

> Sorry, how should I do it? Based on the *current* state of net-next,
> i.e. based on my original (but incomplete) patch? Or based on the
> net-next tree before my original patch was included?

Based upon the current state of net-next, you're sending me a bug
fix for the change you made.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 1/1] net: ppp: reset nextseq counter when enabling SC_MULTILINK
  2014-07-16 21:27       ` David Miller
@ 2014-07-16 21:48         ` Christoph Schulz
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Schulz @ 2014-07-16 21:48 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-ppp, paulus

Hello!

David Miller schrieb am Wed, 16 Jul 2014 14:27:54 -0700 (PDT):

>> Sorry, how should I do it? Based on the *current* state of net-next,
>> i.e. based on my original (but incomplete) patch? Or based on the
>> net-next tree before my original patch was included?
>
> Based upon the current state of net-next, you're sending me a bug
> fix for the change you made.

Thank you for the clarification. I just sent the bugfix patch to the  
mailing list. Sorry for my first erroneous patch -- I have never  
tested the patch without CONFIG_PPP_MULTILINK being defined. At least  
I learned something for the future...


Regards,

Christoph Schulz


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-16 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-15  9:51 [PATCH net-next 1/1] net: ppp: reset nextseq counter when enabling SC_MULTILINK Christoph Schulz
2014-07-16  5:52 ` David Miller
2014-07-16 21:19   ` Christoph Schulz
2014-07-16 21:24     ` Christoph Schulz
2014-07-16 21:27       ` David Miller
2014-07-16 21:48         ` Christoph Schulz
2014-07-16 21:27     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).