[En-Nut-Discussion] Help needed with Ethernut and PPP connection

Michal Kuna mkuna at brainscope.cz
Tue Apr 11 10:11:34 CEST 2006


pbisiac at inwind.it wrote:

>Hello, I am asking for help from the forum because I couldn't manage to setup a PPP connection with any italian provider (Telecom Italia, Wind, Tiscali).
>I am using ethernut 1.3G, OS 4.1.1, GCC for AVR. I connected the second serial (on the expansion bus) to a US robotics 56K modem via a level converter (MAX232), while the first serial is used for debugging. I am using the example "ppp.c" slightly modified, wich I enclose for completeness:
>
>  
>
........

>Does anybody had similar problems ?
>Thanks in advance,
>
>Paolo
>
>
>_______________________________________________
>En-Nut-Discussion mailing list
>En-Nut-Discussion at egnite.de
>http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
>  
>
Hello,

I had _maybe_ similar problem with PPP. You can try this patch on 
'lcpin.c'. This bug was reported over year but still persist in source 
code 'lcpin.c' (today CVS).

....

        *if* (len) {
            *if* (xcpr != xcpo) {
                xcpr->xcpo_type = xcpo->xcpo_type;
                xcpr->xcpo_len = len;
                *for* (i = 0; i < len - 2; i++)
                    //* bug fix by Michel Hendriks. Thanks! *//
                    xcpr->xcpo_.uc[i] = xcpo->xcpo_.uc[i];
            }
            xcpr = (XCPOPT *) ((char *) xcpr + len);
            xcps += len;
        }
#ifdef	MK_MODIF
/// ---------------- mk modif - begin -----------------------/
/// Bug rewrite original 'xcpo->xcpo_len' with rejected data for some long/
/// uknown option. 'len' is OK.	/
	*if*(len) {
          xcpl -= len;
          xcpo = (XCPOPT *) ((char *) xcpo + len);
	}
	*else* {
          xcpl -= xcpo->xcpo_len;
          xcpo = (XCPOPT *) ((char *) xcpo + xcpo->xcpo_len);
	}
/// ---------------- mk modif - end -------------------------/
#else	
	xcpl -= xcpo->xcpo_len;
	xcpo = (XCPOPT *) ((char *) xcpo + xcpo->xcpo_len);
#endif	
    }

    *if* (xcps) {
        nb->nb_ap.sz = xcps;
        rc = XCP_CONFREJ;
    }

.....

This bug is active ONLY if Nut reject long unknown options (probably 
very infrequent situation !). I debug it between W2k and Nut with PPP 
connection. The patch is not elegant, but solve this basic problem. But 
maybe it's today 'out-of-date' because it's depend on other code - real 
buffers location. This was only testing project before year (Enut 1.3F 
Nut 3.9.1.0 and lcpin.c 1.5) and I have not current results ... :(  sorry.

Michal Kuna



More information about the En-Nut-Discussion mailing list