Bug 8332 - Add PPPTIMEOUT support
Summary: Add PPPTIMEOUT support
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: etcnet (show other bugs)
Version: unstable
Hardware: all Linux
: P5 enhancement
Assignee: Mikhail Efremov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-24 15:40 MSD by Sir Raorn
Modified: 2005-10-28 12:08 MSD (History)
5 users (show)

See Also:


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

Note You need to log in before you can comment on or make changes to this bug.
Description Sir Raorn 2005-10-24 15:40:49 MSD
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 Sir Raorn 2005-10-24 15:41:27 MSD
Created attachment 1213 [details]
etcnet-0.7.12-ppp-timeout.patch
Comment 2 Sir Raorn 2005-10-24 15:45:00 MSD
Comment on attachment 1213 [details]
etcnet-0.7.12-ppp-timeout.patch

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 Sir Raorn 2005-10-24 15:45:57 MSD
Comment on attachment 1213 [details]
etcnet-0.7.12-ppp-timeout.patch

>+[ -n "$PPPTIMEOUT" -a "$PPPTIMEOUT" -gt 3 ] && BASIC_PPPOPTIONS="$BASIC_PPPOPTIONS lcp-echo-interval $(("$PPPTIMEOUT" / 3)) lcp-echo-failure 3"

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

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

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

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

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