* [PATCH net] flow_dissector: Check skb for VLAN only if skb specified.
@ 2016-10-17 20:21 Eric Garver
2016-10-17 20:27 ` Eric Garver
0 siblings, 1 reply; 2+ messages in thread
From: Eric Garver @ 2016-10-17 20:21 UTC (permalink / raw)
To: netdev; +Cc: Hadar Hen Zion
From: Eric Garver <egarver@redhat.com>
Fixes a panic when calling eth_get_headlen(). Noticed on i40e driver.
Fixes: d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan info from skb->vlan_tci")
Signed-off-by: Eric Garver <e@erig.me>
---
net/core/flow_dissector.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 1a7b80f73376..44e6ba9d3a6b 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -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),
--
2.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] flow_dissector: Check skb for VLAN only if skb specified.
2016-10-17 20:21 [PATCH net] flow_dissector: Check skb for VLAN only if skb specified Eric Garver
@ 2016-10-17 20:27 ` Eric Garver
0 siblings, 0 replies; 2+ messages in thread
From: Eric Garver @ 2016-10-17 20:27 UTC (permalink / raw)
To: netdev; +Cc: Hadar Hen Zion
On Mon, Oct 17, 2016 at 04:21:57PM -0400, Eric Garver wrote:
> From: Eric Garver <egarver@redhat.com>
>
> Fixes a panic when calling eth_get_headlen(). Noticed on i40e driver.
>
> Fixes: d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan info from skb->vlan_tci")
> Signed-off-by: Eric Garver <e@erig.me>
Oops. Messed the From. Sending a v2.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-17 20:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-17 20:21 [PATCH net] flow_dissector: Check skb for VLAN only if skb specified Eric Garver
2016-10-17 20:27 ` Eric Garver
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.