提交 3805a938 编写于 作者: E Eric Garver 提交者: David S. Miller

flow_dissector: Check skb for VLAN only if skb specified.

Fixes a panic when calling eth_get_headlen(). Noticed on i40e driver.

Fixes: d5709f7a ("flow_dissector: For stripped vlan, get vlan info from skb->vlan_tci")
Signed-off-by: NEric Garver <e@erig.me>
Reviewed-by: NJakub Sitnicki <jkbs@redhat.com>
Acked-by: NAmir Vadai <amir@vadai.me>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b4f0fd4b
......@@ -247,12 +247,10 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
case htons(ETH_P_8021Q): {
const struct vlan_hdr *vlan;
if (skb_vlan_tag_present(skb))
if (skb && skb_vlan_tag_present(skb))
proto = skb->protocol;
if (!skb_vlan_tag_present(skb) ||
proto == cpu_to_be16(ETH_P_8021Q) ||
proto == cpu_to_be16(ETH_P_8021AD)) {
if (eth_type_vlan(proto)) {
struct vlan_hdr _vlan;
vlan = __skb_header_pointer(skb, nhoff, sizeof(_vlan),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册