From: Amit Kumar Salecha <amit.salecha@qlogic.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, ameen.rahman@qlogic.com,
anirban.chakraborty@qlogic.com,
Rajesh Borundia <rajesh.borundia@qlogic.com>
Subject: [PATCHv2 NEXT 06/10] qlcnic: fix panic while using eth_hdr
Date: Tue, 31 Aug 2010 20:17:49 -0700 [thread overview]
Message-ID: <1283311073-7165-7-git-send-email-amit.salecha@qlogic.com> (raw)
In-Reply-To: <1283311073-7165-1-git-send-email-amit.salecha@qlogic.com>
From: Rajesh Borundia <rajesh.borundia@qlogic.com>
o skb->mac_header is not set, so machine panics while using function eth_hdr.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/qlcnic/qlcnic_main.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 9a3ebb8..789fe81 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -1991,6 +1991,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
struct qlcnic_skb_frag *buffrag;
struct cmd_desc_type0 *hwdesc, *first_desc;
struct pci_dev *pdev;
+ struct ethhdr *phdr;
int i, k;
u32 producer;
@@ -2003,7 +2004,8 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
}
if (adapter->flags & QLCNIC_MACSPOOF) {
- if (compare_ether_addr(eth_hdr(skb)->h_source,
+ phdr = (struct ethhdr *)skb->data;
+ if (compare_ether_addr(phdr->h_source,
adapter->mac_addr))
goto drop_packet;
}
--
1.6.0.2
next prev parent reply other threads:[~2010-09-01 3:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-01 3:17 [PATCHv2 0/10]qlcnic: Fixes and enhancement Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 01/10] qlcnic: backout firmware initialization update Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 02/10] qlcnic: add api version in reg dump Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 03/10] qlcnic: fix mac addr read Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 04/10] qlcnic: fix for setting default eswitch config Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 05/10] qlcnic: fix mac anti spoof policy Amit Kumar Salecha
2010-09-01 3:17 ` Amit Kumar Salecha [this message]
2010-09-01 3:17 ` [PATCHv2 NEXT 07/10] qlcnic: fix mac override capability Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 08/10] qlcnic: support mac learning Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 09/10] qlcnic: mac vlan learning support Amit Kumar Salecha
2010-09-01 3:17 ` [PATCHv2 NEXT 10/10] qlcnic: add cksum flag Amit Kumar Salecha
2010-09-01 17:42 ` [PATCHv2 0/10]qlcnic: Fixes and enhancement David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1283311073-7165-7-git-send-email-amit.salecha@qlogic.com \
--to=amit.salecha@qlogic.com \
--cc=ameen.rahman@qlogic.com \
--cc=anirban.chakraborty@qlogic.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=rajesh.borundia@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).