Eivind | 16 Jul 2007 20:35
Picon

Re: GRE: Discarding packet by header check


I've had the same problem as you with a Intel IXP 425 processor board. I have
PPP 2.4.3 and pptpd 1.3.4. Google returned little information on the
subject, however; this little post shows me at least that someone else
is/was having the same problem. 

I managed to solve this problem by using the "packed" attribute to the
structure defined in pptpdefs.h. The attribute is an artifact of the gcc
compiler, and may not work on other compilers. In fact, if someone have a
better way to fix it, perhaps we should have the maintainer of the pptpd
project pick up this change for future releases of pptpd?

With best regards,
- Eivind

patch:
==== //tps/pptpd/1.3.4/mainline/src/pptpdefs.h#2 (text) ====

312c312
< };
---
> } __attribute__((packed));

I also broke the if-statement apart for easier debugging and to know what
*really* failed in the check.

==== //tps/pptpd/1.3.4/mainline/src/pptpgre.c#2 (text) ====

358,365c358,384
<       if (((ntoh8(header->ver) & 0x7F) != PPTP_GRE_VER) ||    /* version
should be 1   */
<           (ntoh16(header->protocol) != PPTP_GRE_PROTO) ||     /* GRE
protocol for PPTP */
<           PPTP_GRE_IS_C(ntoh8(header->flags)) ||      /* flag C should be
clear   */
<           PPTP_GRE_IS_R(ntoh8(header->flags)) ||      /* flag R should be
clear   */
<           (!PPTP_GRE_IS_K(ntoh8(header->flags))) ||   /* flag K should be
set     */
<           ((ntoh8(header->flags) & 0xF) != 0)) {      /* routing and
recursion ctrl = 0  */
<               /* if invalid, discard this packet */
<               syslog(LOG_ERR, "GRE: Discarding packet by header check");
---
>       if ((ntoh8(header->ver) & 0x7F) != PPTP_GRE_VER) {          /*
> Version should be 1      */
>               syslog(LOG_ERR, "GRE: Discarding packet (Invalid GRE
> version)");
>               stats.rx_invalid++;
>               return 0;
>
>     } else if (ntoh16(header->protocol) != PPTP_GRE_PROTO) {    /* GRE
> protocol for PPTP    */
>               syslog(LOG_ERR, "GRE: Discarding packet (Invalid GRE
> protocol)");
>               stats.rx_invalid++;
>               return 0;
>
>     } else if (PPTP_GRE_IS_C(ntoh8(header->flags))) {           /* Flag C
> should be clear   */
>               syslog(LOG_ERR, "GRE: Discarding packet (flag C should be
> clear)");
>               stats.rx_invalid++;
>               return 0;
>
>     } else if (PPTP_GRE_IS_R(ntoh8(header->flags))) {           /* Flag R
> should be clear   */
>               syslog(LOG_ERR, "GRE: Discarding packet (flag R should be
> clear)");
>               stats.rx_invalid++;
>               return 0;
>
>     } else if (!PPTP_GRE_IS_K(ntoh8(header->flags))) {          /* Flag K
> should be set     */
>               syslog(LOG_ERR, "GRE: Discarding packet (flag K should be
> set)");
>               stats.rx_invalid++;
>               return 0;
>
>     } else if ((ntoh8(header->flags) & 0xF) != 0) {             /* Routing
> and recursion ctrl = 0  */
>               syslog(LOG_ERR, "GRE: Discarding packet (Routing and
> recursion ctrl == 0?)");

??-6 wrote:
> 
>     First I want to say sorry. I post a letter two days ago, but it is
> full of jumbled-codes. Now I post it again. Expecting for your request!
> 
> hello,
>     I want to construct a VPN server on Network Processor --- Intel IXP
> 2400 (which is embedded in Radisys Enp2611). The broad runs MontaVista
> Linux preview kit 3.0, and I have compiled PPP 2.4.1 into the kernel. 
>     I cross-compiled Poptop 1.2.3 with linux host, and put its binary
> files and configure files into target? file catalog.
> 	After running pptpd, I connected to the vpn server using a Windows 2000
> PC. But when Windows displays "user/password", it stops and it is error
> 619 (there is no link on appointed port).  
>     The log is:
> # cat /var/log/messages
> #######################################################################
> MGR: Max connections reached, extra IP addresses ignored
> MGR: Manager process started
> MGR: Maximum of 100 connections available
> MGR: Launching /usr/local/sbin/pptpctrl to handle client
> CTRL: local address = 192.168.1.1
> CTRL: remote address = 192.168.0.150
> CTRL: pppd options file = /etc/ppp/options.pptpd
> CTRL: Client 10.1.1.2 control connection started
> CTRL: Received PPTP Control Message (type: 1)
> CTRL: Made a START CTRL CONN RPLY packet
> CTRL: I wrote 156 bytes to the client.
> CTRL: Sent packet to client
> CTRL: Received PPTP Control Message (type: 7)
> CTRL: Set parameters to 100000000 maxbps, 64 window size
> CTRL: Made a OUT CALL RPLY packet
> CTRL: Starting call (launching pppd, opening GRE)
> CTRL: pty_fd = 6
> CTRL: tty_fd = 7
> CTRL: I wrote 32 bytes to the client.
> CTRL (PPPD Launcher): program binary = /usr/sbin/pppd
> CTRL (PPPD Launcher): local address = 192.168.1.1
> CTRL (PPPD Launcher): remote address = 192.168.0.150
> CTRL: Sent packet to client
> CTRL: Received PPTP Control Message (type: 15)
> CTRL: Got a SET LINK INFO packet with standard ACCMs
> pppd 2.4.3 started by root, uid 0
> using channel 1
> Using interface ppp0
> Connect: ppp0 -> /dev/pts/1
> sent [LCP ConfReq id=0x1 syncmap 0x0> uth chap MD5> agic 0x69016181> comp>
> ccomp>]
> GRE: Discarding packet by header check
> GRE: Discarding packet by header check
> GRE: Discarding packet by header check
> sent [LCP ConfReq id=0x1 syncmap 0x0> uth chap MD5> agic 0x69016181> comp>
> ccomp>]
> GRE: Discarding packet by header check
> GRE: Discarding packet by header check
> sent [LCP ConfReq id=0x1 syncmap 0x0> uth chap MD5> agic 0x69016181> comp>
> ccomp>]
> GRE: Discarding packet by header check
> GRE: Discarding packet by header check
> sent [LCP ConfReq id=0x1 syncmap 0x0> uth chap MD5> agic 0x69016181> comp>
> ccomp>]
> GRE: Discarding packet by header check
> sent [LCP ConfReq id=0x1 syncmap 0x0> uth chap MD5> agic 0x69016181> comp>
> ccomp>]
> GRE: Discarding packet by header check
> GRE: Discarding packet by header check
> sent [LCP ConfReq id=0x1 syncmap 0x0> uth chap MD5> agic 0x69016181> comp>
> ccomp>]
> GRE: Discarding packet by header check
> GRE: Discarding packet by header check
> ......
> LCP: timeout sending Config-Requests 
> Connection terminated.
> #######################################################################
> 
>     I dumped and checked the packets. After comparing with poptop's source
> code, I found the pptp reply packet is right, and the "GRE: Discarding
> packet by header check" message should not be displayed. 
>     Is it a bug? Or it is my fault when cross-compiling poptop? Or poptop
> can not run on NP board? (Can poptop run on ARM machine?)
>     Now I am deeply flurried. Can anyone help me? Thanks in advance.
> 
>  	                 dingle
>                dingle <at> seu.edu.cn 
>                    2006-04-17
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Poptop-server mailing list
> Poptop-server <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/poptop-server
> 
> 

--

-- 
View this message in context: http://www.nabble.com/GRE%3A-Discarding-packet-by-header-check-tf1459799.html#a11624693
Sent from the poptop-server mailing list archive at Nabble.com.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Gmane