Staging: sxg: Use correct queue_id for transmitting non-TCP packets

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, April 17, 2009 - 3:03 pm

Gitweb:     http://git.kernel.org/linus/8d17e6ad8113f7534d978b1b3511f62637483fcc
Commit:     8d17e6ad8113f7534d978b1b3511f62637483fcc
Parent:     1f895130c0b0dd293b924b1c6cecac90a2e35dc6
Author:     Mithlesh Thukral <mithlesh@linsyssoft.com>
AuthorDate: Wed Mar 25 15:50:34 2009 +0530
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Fri Apr 17 11:06:31 2009 -0700

    Staging: sxg: Use correct queue_id for transmitting non-TCP packets
    
    Use correct queue_id while transmitting non-TCP packets.
    They should always use queue 0.
    
    Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
    Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
---
 drivers/staging/sxg/sxg.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sxg/sxg.c b/drivers/staging/sxg/sxg.c
index 52d2ab9..d8edf42 100644
--- a/drivers/staging/sxg/sxg.c
+++ b/drivers/staging/sxg/sxg.c
@@ -2615,7 +2615,9 @@ static int sxg_dumb_sgl(struct sxg_x64_sgl *pSgl,
                 struct iphdr *ip;
 
                 ip = ip_hdr(skb);
-		if ((ip->protocol == IPPROTO_TCP)&&(DataLength >= sizeof(
+		if (ip->protocol != IPPROTO_TCP	|| !tcp_hdr(skb))
+			queue_id = 0;
+		else if ((ip->protocol == IPPROTO_TCP)&&(DataLength >= sizeof(
 							struct tcphdr))){
 			queue_id = ((ntohs(tcp_hdr(skb)->dest) == ISCSI_PORT) ?
 					(ntohs (tcp_hdr(skb)->source) &
@@ -2624,8 +2626,10 @@ static int sxg_dumb_sgl(struct sxg_x64_sgl *pSgl,
 						SXG_LARGE_SEND_QUEUE_MASK));
 		}
 	} else if (skb->protocol == htons(ETH_P_IPV6)) {
-		if ((ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) && (DataLength >=
-						 sizeof(struct tcphdr)) ) {
+		if (ipv6_hdr(skb)->nexthdr != IPPROTO_TCP || !tcp_hdr(skb))
+			queue_id = 0;
+		else if ((ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) && (DataLength
+						>= sizeof(struct tcphdr)) ) {
 			queue_id = ((ntohs(tcp_hdr(skb)->dest) == ISCSI_PORT) ?
 					(ntohs (tcp_hdr(skb)->source) &
 					SXG_LARGE_SEND_QUEUE_MASK):
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Staging: sxg: Use correct queue_id for transmitting non-TC ..., Linux Kernel Mailing ..., (Fri Apr 17, 3:03 pm)