patch-2.0.24 linux/drivers/net/slhc.c

Next file: linux/drivers/net/tulip.c
Previous file: linux/drivers/net/ni65.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.23/linux/drivers/net/slhc.c linux/drivers/net/slhc.c
@@ -246,6 +246,14 @@
 	struct iphdr *ip;
 	struct tcphdr *th, *oth;
 
+
+	/*
+	 *	Don't play with runt packets.
+	 */
+	 
+	if(isize<sizeof(struct iphdr))
+		return isize;
+		
 	ip = (struct iphdr *) icp;
 
 	/* Bail if this packet isn't TCP, or is an IP fragment */
@@ -264,9 +272,10 @@
 	hlen = ip->ihl*4 + th->doff*4;
 
 	/*  Bail if the TCP packet isn't `compressible' (i.e., ACK isn't set or
-	 *  some other control bit is set).
+	 *  some other control bit is set). Also uncompressible if
+	 *  its a runt.
 	 */
-	if(th->syn || th->fin || th->rst ||
+	if(hlen > isize || th->syn || th->fin || th->rst ||
 	    ! (th->ack)){
 		/* TCP connection stuff; send as regular IP */
 		comp->sls_o_tcp++;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov