Bug 21726

Summary: RETRYCONNECT=no broken
Product: [Retired] Red Hat Linux Reporter: Jonathan Stanford <jomast>
Component: wvdialAssignee: Harald Hoyer <harald>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-07-08 15:12:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
allows option for wvdial abort on NO DIALTONE or BUSY errors none

Description Jonathan Stanford 2000-12-05 02:05:37 UTC
Despite RETRYCONNECT=no being set in /etc/sysconfg/network-scripts/ifcfg-ppp0
pppd will still try to reconnect when the modem resonds with the "NO DIAL
TONE" error!

(yes... the modem i'm testing with puts out "NO DIAL TONE" instead of "NO
DIALTONE".... this might be part of the bug)

-Jonathan Stanford
<jomast>

Comment 1 Jonathan Stanford 2000-12-05 18:28:41 UTC
A modified wvdial is required.  I've attached the patch so that you can include
it with the bug report.(courtesy of Ken Humborg)

diff -urN wvdial-1.41/wvdial/wvdial.cc wvdial-1.41.1/wvdial/wvdial.cc
--- wvdial-1.41/wvdial/wvdial.cc	Sun May  7 19:56:18 2000
+++ wvdial-1.41.1/wvdial/wvdial.cc	Sun May  7 18:00:49 2000
@@ -157,10 +157,18 @@
 	}
     }

+    int retval;
+
+    if ((dialer.status() != WvDialer::Idle) || !dialer.isok()) {
+
retval = 1;
+    } else {
+
retval = 0;
+    }
+
     dialer.hangup();

     if( syslog )
 	delete syslog;

-    return( 0 );
+    return( retval );
 }
diff -urN wvdial-1.41/wvdial/wvdialer.cc wvdial-1.41.1/wvdial/wvdialer.cc
--- wvdial-1.41/wvdial/wvdialer.cc	Sun May  7 19:56:18 2000
+++ wvdial-1.41.1/wvdial/wvdialer.cc	Sun May  7 19:48:29 2000
@@ -391,6 +391,8 @@
     	{ "Stupid Mode",     NULL, &options.stupid_mode,   "", false        },
     	{ "New PPPD",	     NULL, &options.new_pppd, 	   "", true         },
     	{ "Auto Reconnect",  NULL, &options.auto_reconnect,"", true	    },
+    	{ "Abort On Busy",   NULL, &options.abort_on_busy, "", false	    },
+    	{ "Abort On No Dialtone",   NULL, &options.abort_on_no_dialtone, "", false	    },
     	{ NULL,		     NULL, NULL,                   "", 0            }
     };

@@ -556,17 +558,27 @@
 	return;
     case 2:	// NO DIALTONE
     case 3:	// NO DIAL TONE
-
err( "No dial tone.  Trying again in 5 seconds.\n" );
-
stat = PreDial2;
-
connect_attempts++;
-
dial_stat = 3;
+
if( options.abort_on_no_dialtone == true ) {
+
    err( "No dial tone.\n" );
+
    stat = ModemError;
+
} else {
+
    err( "No dial tone.  Trying again in 5 seconds.\n" );
+
    stat = PreDial2;
+
    connect_attempts++;
+
    dial_stat = 3;
+
}
 	return;
     case 4:	// BUSY
-
log( WvLog::Warning, "The line is busy.  Trying again.\n" );
-
stat = PreDial1;
-
connect_attempts++;
-
dial_stat = 4;
-
sleep( 2 );
+
if( options.abort_on_busy == true ) {
+
    log( WvLog::Warning, "The line is busy.\n" );
+
    stat = ModemError;
+
} else {
+
    log( WvLog::Warning, "The line is busy.  Trying again.\n" );
+
    stat = PreDial1;
+
    connect_attempts++;
+
    dial_stat = 4;
+
    sleep( 2 );
+
}
 	return;
     case 5:	// ERROR
 	err( "Invalid dial command.\n" );
diff -urN wvdial-1.41/wvdial/wvdialer.h wvdial-1.41.1/wvdial/wvdialer.h
--- wvdial-1.41/wvdial/wvdialer.h	Sun May  7 19:56:18 2000
+++ wvdial-1.41.1/wvdial/wvdialer.h	Sun May  7 19:48:49 2000
@@ -107,6 +107,8 @@
     	int		stupid_mode;
     	int		new_pppd;
     	int		auto_reconnect;
+    	int		abort_on_busy;
+    	int		abort_on_no_dialtone;
     } options;

 private:
diff -urN wvdial-1.41/wvdial.1 wvdial-1.41.1/wvdial.1
--- wvdial-1.41/wvdial.1	Sun Nov 28 21:16:21 1999
+++ wvdial-1.41.1/wvdial.1	Sun May  7 19:52:50 2000
@@ -314,6 +314,18 @@
 will attempt to automatically reestablish a connection if you are
 randomly disconnected by the other side.
 This option is "on" by default.
+.TP
+.I Abort On Busy
+If enabled,
+.B wvdial
+will not retry the connection if the modem says that the line is busy.
+This option is "off" by default.
+.TP
+.I Abort On No Dialtone
+If enabled,
+.B wvdial
+will not retry the connection if the modem says that there is no dialtone.
+This option is "off" by default.
 .PP
 The
 .BR wvdialconf (1)



Comment 2 Jonathan Stanford 2000-12-05 18:31:32 UTC
Created attachment 6070 [details]
allows option for wvdial abort on NO DIALTONE or BUSY errors

Comment 3 Bill Nottingham 2000-12-05 19:22:06 UTC
Assigning to the wvdial package.

Comment 4 Jonathan Stanford 2000-12-11 13:27:41 UTC
after appling this patch, it still apears to not work for me.... BUT, just
yesterday it started working like it should (aborting on NO DIAL TONE).  The
only thing that i see that has happened is that i have rebooted.  Not sure why
this would have a berring on the matter, but i cant argue with the results....

Comment 5 Harald Hoyer 2005-07-08 15:12:50 UTC
should work in current versions