From: Christoph Schulz Date: Tue, 15 Jul 2014 09:51:03 +0000 (+0200) Subject: net: ppp: reset nextseq counter when enabling SC_MULTILINK X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=d762d038497c9df51c19fcbe69b094b3bf8e5568;p=deliverable%2Flinux.git net: ppp: reset nextseq counter when enabling SC_MULTILINK 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 5c002b1ef169..c38ee903bd59 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)