summaryrefslogtreecommitdiff
path: root/net/core/flow_dissector.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2017-03-06 16:39:53 +0100
committerDavid S. Miller <davem@davemloft.net>2017-03-08 23:08:57 -0800
commitd5774b93f04252b81bd2c2cc84ec663c6aa798d1 (patch)
treec4c2895201f91f0cb5cfb5d78cc96501bd468007 /net/core/flow_dissector.c
parent4a5d6c8b14b81e3704607a354434321e390d228a (diff)
flow_dissector: Fix GRE header error path
Now, when an unexpected element in the GRE header appears, we break so the l4 ports are processed. But since the ports are processed unconditionally, there will be certainly random values dissected. Fix this by just bailing out in such situations. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/flow_dissector.c')
-rw-r--r--net/core/flow_dissector.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 8d012987e3c3..cefaf2368a3f 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -479,18 +479,18 @@ ip_proto_again:
/* Only look inside GRE without routing */
if (hdr->flags & GRE_ROUTING)
- break;
+ goto out_good;
/* Only look inside GRE for version 0 and 1 */
gre_ver = ntohs(hdr->flags & GRE_VERSION);
if (gre_ver > 1)
- break;
+ goto out_good;
proto = hdr->protocol;
if (gre_ver) {
/* Version1 must be PPTP, and check the flags */
if (!(proto == GRE_PROTO_PPP && (hdr->flags & GRE_KEY)))
- break;
+ goto out_good;
}
offset += sizeof(struct gre_base_hdr);