Re: [PATCH net-next] flow_dissector: fix vlan tag handling

Arnd Bergmann
2016-10-24T16:06:50Z

On Monday, October 24, 2016 10:17:36 AM CEST Jiri Pirko wrote:
> Sat, Oct 22, 2016 at 10:30:08PM CEST, arnd@arndb.de wrote:
> >diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> >index 44e6ba9d3a6b..17be1b66cc41 100644
> >--- a/net/core/flow_dissector.c
> >+++ b/net/core/flow_dissector.c
> >@@ -246,13 +246,10 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
> > case htons(ETH_P_8021AD):
> > case htons(ETH_P_8021Q): {
> > const struct vlan_hdr *vlan;
> >+ struct vlan_hdr _vlan;
> >+ bool vlan_tag_present = (skb && skb_vlan_tag_present(skb));
>
> Drop the unnecessary "()"

ok

> >
> >- if (skb && skb_vlan_tag_present(skb))
> >- proto = skb->protocol;
>
> This does not look correct. I believe that you need to set proto for
> further processing.
>

Ah, of course. I only looked at the usage in this 'case' statement,
but the variable is also used after the 'goto again' and at
the end of the function.

Arnd