patch-1.3.30 linux/net/ax25/ax25_out.c

Next file: linux/net/ax25/ax25_route.c
Previous file: linux/net/ax25/ax25_in.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.29/linux/net/ax25/ax25_out.c linux/net/ax25/ax25_out.c
@@ -61,7 +61,7 @@
 	
 	mtu = ax25->device->mtu;
 	
-	if (skb->len > mtu) {
+	if ((skb->len - 1) > mtu) {
 		mtu -= 2;		/* Allow for fragment control info */
 		
 		fragno = skb->len / mtu;
@@ -164,12 +164,13 @@
 		 * the window is full. Send a poll on the final I frame if
 		 * the window is filled.
 		 */
-		do {
-			/*
-			 * Dequeue the frame and copy it.
-			 */
-			skb  = skb_dequeue(&ax25->write_queue);
 
+		/*
+		 * Dequeue the frame and copy it.
+		 */
+		skb  = skb_dequeue(&ax25->write_queue);
+
+		do {
 			if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
 				skb_queue_head(&ax25->write_queue, skb);
 				return;
@@ -195,7 +196,7 @@
 #ifdef notdef
 		} while (!last);
 #else
-		} while (!last && skb_peek(&ax25->write_queue) != NULL);
+		} while (!last && (skb = skb_dequeue(&ax25->write_queue)) != NULL);
 #endif
 		ax25->condition &= ~ACK_PENDING_CONDITION;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this