Index: cpukit/libnetworking/ChangeLog
===================================================================
--- cpukit/libnetworking/ChangeLog	(revision 06a31dab005f516b6366cbd220f48a412eeb526a)
+++ cpukit/libnetworking/ChangeLog	(revision 7e23f208897a963f1815d49d1150ff716350d672)
@@ -1,2 +1,9 @@
+2004-01-30	Wilfried Busalski <w.busalski@lancier-monitoring.de>
+
+	PR pppd/564
+	* net/if_ppp.c, net/if_pppvar.h, net/ppp_tty.c: ppp0 Interface lose
+	packets if the system use a slow baudrate for the modem or the
+	tcp/ip-packet is fragmented.
+
 2003-09-15	Jay Monkman <jtm@smothsmothie.com>
 
Index: cpukit/libnetworking/net/if_ppp.c
===================================================================
--- cpukit/libnetworking/net/if_ppp.c	(revision 06a31dab005f516b6366cbd220f48a412eeb526a)
+++ cpukit/libnetworking/net/if_ppp.c	(revision 7e23f208897a963f1815d49d1150ff716350d672)
@@ -251,4 +251,6 @@
   struct mbuf                *m;
   struct rtems_termios_tty   *tp;
+  
+  int frag;
 
   /* enter processing loop */
@@ -259,5 +261,7 @@
       /* received event from interrupt handler - free current mbuf */
       rtems_bsdnet_semaphore_obtain();
+
       m_freem(sc->sc_outm);
+      
       rtems_bsdnet_semaphore_release();
 
@@ -295,4 +299,5 @@
       /* clear process flag */
       iprocess = (int)0;
+      frag=0;
 
       /* initialize output values */
@@ -303,20 +308,34 @@
       sc->sc_outfcslen = (short   )0;
 
+/*	  printf("Start Transmit Packet..\n"); */
+
       /* loop over all mbufs in chain */
       mf     = NULL;
       mp     = NULL;
       m      = sc->sc_outm;
+
+      sc->sc_outmc  = m;
+      sc->sc_outlen = m->m_len;
+      sc->sc_outbuf = mtod(m, u_char *);
+
       while (( m != (struct mbuf *)0 ) && ( m->m_len > 0 )) {
-        /* check to see if first mbuf value has been set */
-        if ( sc->sc_outmc == (struct mbuf *)0 ) {
-          /* set values to start with this mbuf */
-          sc->sc_outmc  = m;
-          sc->sc_outlen = m->m_len;
-          sc->sc_outbuf = mtod(m, u_char *);
-        }
+      	frag++;
 
         /* update the FCS value and then check next packet length */
-        sc->sc_outfcs = pppfcs(sc->sc_outfcs, mtod(m, u_char *), m->m_len);
-
+        if(m->m_len){
+       	 sc->sc_outfcs = pppfcs(sc->sc_outfcs, mtod(m, u_char *), m->m_len);
+       	}
+
+        if(( m->m_next != NULL ) && ( m->m_next->m_len == 0 )) {
+			if(mf){
+				printf(" if_ppp.c : MBUF Error !!!!\n");
+			}
+			else{
+            	mf = m->m_next;
+	        	m->m_next = NULL;
+			}
+		}
+
+#ifdef LALL_X
         /* check next packet to see if it is empty */
         while (( m->m_next != NULL ) && ( m->m_next->m_len == 0 )) {
@@ -338,5 +357,5 @@
           mp->m_next = NULL;
         }
-
+#endif
         /* move to next packet */
         m = m->m_next;
@@ -352,5 +371,5 @@
   
         /* write out frame byte to start the transmission */
-	sc->sc_outchar = (u_char)PPP_FLAG;
+		sc->sc_outchar = (u_char)PPP_FLAG;
         (*tp->device.write)(tp->minor, &sc->sc_outchar, 1);
       }
Index: cpukit/libnetworking/net/if_pppvar.h
===================================================================
--- cpukit/libnetworking/net/if_pppvar.h	(revision 06a31dab005f516b6366cbd220f48a412eeb526a)
+++ cpukit/libnetworking/net/if_pppvar.h	(revision 7e23f208897a963f1815d49d1150ff716350d672)
@@ -1,3 +1,3 @@
-/*	$Id$	*/
+/*  $Id$ */
 /*
  * if_pppvar.h - private structures and declarations for PPP.
@@ -138,3 +138,4 @@
 #define SC_TX_FCS       0x0002
 #define SC_TX_ESCAPE    0x0004
+#define SC_TX_LASTCHAR	0x0008
 #define SC_TX_PENDING   0x0010
Index: cpukit/libnetworking/net/ppp_tty.c
===================================================================
--- cpukit/libnetworking/net/ppp_tty.c	(revision 06a31dab005f516b6366cbd220f48a412eeb526a)
+++ cpukit/libnetworking/net/ppp_tty.c	(revision 7e23f208897a963f1815d49d1150ff716350d672)
@@ -571,4 +571,12 @@
   if (( sc != NULL ) && ( sc->sc_outflag & SC_TX_BUSY )) {
     /* check to see if we need to get the next buffer */
+
+    /* Ready with PPP_FLAG Character ? */
+    if(sc->sc_outflag & SC_TX_LASTCHAR){
+        sc->sc_outflag &= ~(SC_TX_BUSY | SC_TX_FCS | SC_TX_LASTCHAR);
+        rtems_event_send(sc->sc_txtask, TX_TRANSMIT);	/* Ready for the next Packet */
+        return(0);
+    }
+
     if ( sc->sc_outoff >= sc->sc_outlen ) {
       /* loop to get next non-zero length buffer */
@@ -594,8 +602,9 @@
       else {
         /* done with this packet */
-        sc->sc_outflag &= ~SC_TX_BUSY;
-	sc->sc_outchar = (u_char)PPP_FLAG;
+        sc->sc_outflag |= SC_TX_LASTCHAR;
+        sc->sc_outflag &=~(SC_TX_FCS);
+		sc->sc_outchar = (u_char)PPP_FLAG;
         (*tp->device.write)(tp->minor, &sc->sc_outchar, 1);
-        rtems_event_send(sc->sc_txtask, TX_TRANSMIT);
+        return(0);
       }
     }
