提交 dcb50aff 编写于 作者: R Rajesh Borundia 提交者: David S. Miller

qlcnic: fix panic while using eth_hdr

o skb->mac_header is not set, so machine panics while using function eth_hdr.
Signed-off-by: NRajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: NAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7613c87b
无相关合并请求
...@@ -1991,6 +1991,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -1991,6 +1991,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
struct qlcnic_skb_frag *buffrag; struct qlcnic_skb_frag *buffrag;
struct cmd_desc_type0 *hwdesc, *first_desc; struct cmd_desc_type0 *hwdesc, *first_desc;
struct pci_dev *pdev; struct pci_dev *pdev;
struct ethhdr *phdr;
int i, k; int i, k;
u32 producer; u32 producer;
...@@ -2003,7 +2004,8 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -2003,7 +2004,8 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
} }
if (adapter->flags & QLCNIC_MACSPOOF) { 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)) adapter->mac_addr))
goto drop_packet; goto drop_packet;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部