diff -ru diald-1.0.orig/proxy_slip.c diald-1.0/proxy_slip.c --- diald-1.0.orig/proxy_slip.c 2001-06-16 15:51:39.000000000 -0400 +++ diald-1.0/proxy_slip.c 2005-10-04 10:39:41.951883000 -0400 @@ -51,7 +51,11 @@ proxy_slip_send(proxy_t *proxy, unsigned short wprot, unsigned char *p, size_t len) { - /* send an initial END character to flush out any data that may + /* ignore the wprot param. + * As this is a SLIP link then ETH_P_IP is implied and will be prepended at + * remote end. + * + * send an initial END character to flush out any data that may * have accumulated in the receiver due to line noise */ putc(END,proxy_mfp); @@ -91,7 +95,10 @@ */ putc(END,proxy_mfp); - return 0; + /* Ensure the packet goes now. + * Return EOF if failed, 0 otherwise. + */ + return fflush(proxy_mfp); } @@ -108,6 +115,10 @@ int c; int received = 0; + /* Insert the protocol at the beginning of the buffer. + * If real data is received, the buffer length is adjusted just before + * returning + */ *(unsigned short *)p = htons(ETH_P_IP); p += sizeof(unsigned short); len -= sizeof(unsigned short); @@ -138,7 +149,7 @@ * turn sent to try to detect line noise. */ if(received) - return received; + return received + sizeof(unsigned short); else break;