Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3805a938 authored by Eric Garver's avatar Eric Garver Committed by David S. Miller
Browse files

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: default avatarEric Garver <e@erig.me>
Reviewed-by: default avatarJakub Sitnicki <jkbs@redhat.com>
Acked-by: default avatarAmir Vadai <amir@vadai.me>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b4f0fd4b
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -247,12 +247,10 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
	case htons(ETH_P_8021Q): {
	case htons(ETH_P_8021Q): {
		const struct vlan_hdr *vlan;
		const struct vlan_hdr *vlan;


		if (skb_vlan_tag_present(skb))
		if (skb && skb_vlan_tag_present(skb))
			proto = skb->protocol;
			proto = skb->protocol;


		if (!skb_vlan_tag_present(skb) ||
		if (eth_type_vlan(proto)) {
		    proto == cpu_to_be16(ETH_P_8021Q) ||
		    proto == cpu_to_be16(ETH_P_8021AD)) {
			struct vlan_hdr _vlan;
			struct vlan_hdr _vlan;


			vlan = __skb_header_pointer(skb, nhoff, sizeof(_vlan),
			vlan = __skb_header_pointer(skb, nhoff, sizeof(_vlan),