Thread (4 messages) flat view 4 messages, 2 authors, 2018-09-11

Re: [PATCH] ip6_gre: simplify gre header parsing in ip6gre_err

From: Jiri Benc <hidden>
Date: 2018-09-11 06:47:53
Also in: lkml

On Tue, 11 Sep 2018 10:19:31 +0800, Haishuang Yan wrote:
quoted hunk ↗ jump to hunk
Since csum_err may not be used outside, how about refactoring gre_parse_header function like this:
--- a/net/ipv4/gre_demux.c
+++ b/net/ipv4/gre_demux.c
@@ -86,7 +86,7 @@ int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,

        options = (__be32 *)(greh + 1);
        if (greh->flags & GRE_CSUM) {
-               if (skb_checksum_simple_validate(skb)) {
+               if (csum_err && skb_checksum_simple_validate(skb)) {
Something like this, yes.

Thanks!

 Jiri
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help