Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jun 2002 20:10:31 +0200
From:      Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To:        Brian Somers <brian@FreeBSD.ORG>
Cc:        cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/netgraph ng_pppoe.c
Message-ID:  <20020628201031.A89906@curry.mchp.siemens.de>
In-Reply-To: <200206272128.g5RLSi9e029446@freefall.freebsd.org>; from brian@FreeBSD.ORG on Thu, Jun 27, 2002 at 02:28:44PM -0700
References:  <200206272128.g5RLSi9e029446@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 27-Jun-2002 at 14:28:44 -0700, Brian Somers wrote:
> brian       2002/06/27 14:28:44 PDT
> 
>   Modified files:        (Branch: RELENG_4)
>     sys/netgraph         ng_pppoe.c 
>   Log:
>   Remove calls to send_sessionid().
>   
>   I have no idea what the problem is (yet).  Andre Albsmeier has reported
>   that removing these fixes his PPPoE connection again - although the
>   calls don't seem to affect PPPoE here.
>   
>   This is a temporary fix 'till I figure out what's broken.

Without any tuning ppp waits for the carrier for 5 seconds (see ppp(8)).
The problem is that the additional send_sessionid() delayed this process
slightly but still enough that the timeout expired and the connection was
lost. I found this when I noticed that removing send_acname() made my
connection work again even with send_sessionid() enabled. (I assume that
send_acname() produces a similar delay as send_sessionid().)

It might be that the german TDSL modems (I got the Siemens one) and/or
the DSLAM are a little bit slower than others.

You can work around this by simply adding

set cd 10

to ppp.conf. However, I would suggest to increase the default value
in ppp already (We have many users in germany which use the same DSL
hardware as I do :-)).

I have also made a small patch for for ppp/ether.c so the new SESSIONID
message appears nicely in syslog and the env variable gets set:

Jun 28 20:03:27 <daemon.info> gate ppp[475]: Phase: deflink: closed -> opening
Jun 28 20:03:27 <daemon.info> gate ppp[475]: Phase: deflink: Connected!
Jun 28 20:03:27 <daemon.info> gate ppp[475]: Phase: deflink: opening -> dial
Jun 28 20:03:27 <daemon.info> gate ppp[475]: Phase: deflink: dial -> carrier
Jun 28 20:03:31 <daemon.info> gate ppp[475]: Phase: Received NGM_PPPOE_ACNAME (hook "MUNX13-erx")
Jun 28 20:03:32 <daemon.info> gate ppp[475]: Phase: Received NGM_PPPOE_SESSIONID (hook "0x17fc")
Jun 28 20:03:33 <daemon.info> gate ppp[475]: Phase: Received NGM_PPPOE_SUCCESS
Jun 28 20:03:33 <daemon.info> gate ppp[475]: Phase: deflink: carrier -> login


This is the patch (partly stolen from pppoed):


--- ether.c.ORI	Mon Jun 24 20:17:26 2002
+++ ether.c	Fri Jun 28 20:02:24 2002
@@ -204,8 +204,8 @@
   char msgbuf[sizeof(struct ng_mesg) + sizeof(struct ngpppoe_sts)];
   struct ng_mesg *rep = (struct ng_mesg *)msgbuf;
   struct ngpppoe_sts *sts = (struct ngpppoe_sts *)(msgbuf + sizeof *rep);
-  char unknown[14];
-  const char *msg;
+  char unknown[14], sessionid[7];
+  const char *msg, *asciiptr;
   struct timeval t;
   fd_set *r;
   int asciilen, ret;
@@ -242,6 +242,7 @@
   }
 
   asciilen = 0;
+  asciiptr = NULL;
   switch (rep->header.cmd) {
     case NGM_PPPOE_SET_FLAG:	msg = "SET_FLAG";	break;
     case NGM_PPPOE_CONNECT:	msg = "CONNECT";	break;
@@ -256,6 +257,15 @@
       if (setenv("ACNAME", sts->hook, 1) != 0)
         log_Printf(LogWARN, "setenv: cannot set ACNAME=%s: %m", sts->hook);
       asciilen = rep->header.arglen;
+      asciiptr = sts->hook;
+      break;
+    case NGM_PPPOE_SESSIONID:
+      msg = "SESSIONID";
+      snprintf(sessionid, sizeof sessionid, "0x%04x", *(u_int16_t *)sts);
+      if (setenv("SESSIONID", sessionid, 1) != 0)
+        log_Printf(LogWARN, "setenv: cannot set SESSIONID=%s: %m", sessionid);
+      asciilen = strlen( sessionid );
+      asciiptr = sessionid;
       break;
     default:
       snprintf(unknown, sizeof unknown, "<%d>", (int)rep->header.cmd);
@@ -265,7 +275,7 @@
 
   if (asciilen)
     log_Printf(LogPHASE, "Received NGM_PPPOE_%s (hook \"%.*s\")\n",
-               msg, asciilen, sts->hook);
+               msg, asciilen, asciiptr);
   else
     log_Printf(LogPHASE, "Received NGM_PPPOE_%s\n", msg);
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020628201031.A89906>