Bug 8332 - Add PPPTIMEOUT support
: Add PPPTIMEOUT support
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/etcnet)
: unstable
: all Linux
: P5 enhancement
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2005-10-24 15:40 by
Modified: 2005-10-28 12:08 (History)


Attachments
etcnet-0.7.12-ppp-timeout.patch (936 bytes, patch)
2005-10-24 15:41, Sir Raorn
no flags Details | Diff
etcnet-0.7.12-ppp-timeout.patch (934 bytes, patch)
2005-10-24 15:47, Sir Raorn
no flags Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2005-10-24 15:40:49
Attached patch adds PPPTIMEOUT option.  For modem and pptp links it sets
lcp-echo-interval to $PPPTIMEOUT/3 and lcp-echo-failure to 3.  For pppoe links
it also adds -T $PPPTIMEOUT*4/3 to PTYOPTION.

from pppoe(8):

       -T timeout
              The  -T  option  causes pppoe to exit if no session
              traffic is detected for timeout seconds.  I  recom­
              mend  that  you  use this option as an extra safety
              measure, but if you do, you should make  sure  that
              PPP  generates  enough  traffic so the timeout will
              normally not be triggered.  The best way to do this
              is  to  use  the  lcp-echo-interval option to pppd.
              You should set the PPPoE timeout to be  about  four
              times the LCP echo interval.

Not sure if this really needed...
------- Comment #1 From 2005-10-24 15:41:27 -------
Created an attachment (id=1213) [details]
etcnet-0.7.12-ppp-timeout.patch
------- Comment #2 From 2005-10-24 15:45:00 -------
(From update of attachment 1213 [details])
diff -Naurp etcnet-0.7.12-orig/etc/net/scripts/create-ppp
etcnet-0.7.12/etc/net/scripts/create-ppp
--- etcnet-0.7.12-orig/etc/net/scripts/create-ppp	2005-08-03 21:56:15
+0400
+++ etcnet-0.7.12/etc/net/scripts/create-ppp	2005-10-24 15:34:06 +0400
@@ -44,6 +44,7 @@ BASIC_PPPOPTIONS="$BASIC_PPPOPTIONS${PPP
 is_yes "$PPPPERSIST" && BASIC_PPPOPTIONS="$BASIC_PPPOPTIONS persist"
 BASIC_PPPOPTIONS="$BASIC_PPPOPTIONS${PPPHOLDOFF:+ holdoff $PPPHOLDOFF}"
 BASIC_PPPOPTIONS="$BASIC_PPPOPTIONS${PPPIDLE:+ idle $PPPIDLE}"
+[ -n "$PPPTIMEOUT" -a "$PPPTIMEOUT" -gt 3 ] &&
BASIC_PPPOPTIONS="$BASIC_PPPOPTIONS lcp-echo-interval $(($PPPTIMEOUT / 3))
lcp-echo-failure 3"

 case "$PPPTYPE" in
	pptp)
@@ -67,6 +68,7 @@ case "$PPPTYPE" in
			exit 1
		}
		PTYOPTION="$PPPOE -I $HOST -U"
+		[ -n "$PPPTIMEOUT" -a "$PPPTIMEOUT" -gt 3 ] &&
PTYOPTION="$PTYOPTION -T $(($PPPTIMEOUT * 4 / 3))"
	;;
	dialup)
		BASIC_PPPOPTIONS="$BASIC_PPPOPTIONS modem"
------- Comment #3 From 2005-10-24 15:45:57 -------
(From update of attachment 1213 [details])
>+[ -n "$PPPTIMEOUT" -a "$PPPTIMEOUT" -gt 3 ] && BASIC_PPPOPTIONS="$BASIC_PPPOPTIONS lcp-echo-interval $(("$PPPTIMEOUT" / 3)) lcp-echo-failure 3"

$(($PPPTIMEOUT / 3)) конечно, без кавычек.
------- Comment #4 From 2005-10-24 15:47:51 -------
Created an attachment (id=1214) [details]
etcnet-0.7.12-ppp-timeout.patch

Чё-т я запутался...  Вот кошерный патч.
------- Comment #5 From 2005-10-25 20:02:44 -------
Хорошая идея.
------- Comment #6 From 2005-10-26 10:16:19 -------
Мне кажется, это лишнее:
+		[ -n "$PPPTIMEOUT" -a "$PPPTIMEOUT" -gt 3 ] && PTYOPTION="$PTYOPTION -T
$(($PPPTIMEOUT * 4 / 3))"

LCP сделает своё дело.
------- Comment #7 From 2005-10-26 22:17:38 -------
Приложено к 0.7.15.
------- Comment #8 From 2005-10-26 23:25:01 -------
(In reply to comment #6)
> Мне кажется, это лишнее:
...
> LCP сделает своё дело.

Ну в общем я погоняю это какое-то время на 0.7.14 с прописаными вручную
lcp-echo-*, если что - переоткрою.  Чесгря, я из-за этого -T всё и затевал, но
пока не видел витуации когда это реально было бы нужно.

P.S. Записал себе в TODO - попробовать синхронный режим и linux plugin.
------- Comment #9 From 2005-10-28 12:08:35 -------
Версия 0.7.15 отправлена в incoming/Sisyphus