From mithlesh@linsyssoft.com Thu Apr 9 14:48:18 2009 From: Mithlesh Thukral Date: Wed, 25 Mar 2009 15:50:34 +0530 (IST) Subject: Staging: sxg: Use correct queue_id for transmitting non-TCP packets To: Greg Kroah-Hartman Cc: Sahara Project , Christopher Harrer Message-ID: Use correct queue_id while transmitting non-TCP packets. They should always use queue 0. Signed-off-by: LinSysSoft Sahara Team Signed-off-by: Mithlesh Thukral --- drivers/staging/sxg/sxg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/drivers/staging/sxg/sxg.c +++ b/drivers/staging/sxg/sxg.c @@ -2615,7 +2615,9 @@ static int sxg_dumb_sgl(struct sxg_x64_s 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_s 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):